MConnect · Catalog Semantic (mock)
Schimb de date guvernamental — mimează semantic.gov.md · servicii SOAP/REST cu date fake coerente
Catalog › Interpelări › GetAnimals

GetAnimals Interpelări

GetAnimals · rev. 1.1.0 · categorii: Agricultură, Pescuit, Silvicultură, Produse Alimentare, Adresa, Economie și Finanțe, Populație

Interpelarea ”GetAnimals” are drept scop returnarea listei animalelor în baza numărului de identificare (IDNP sau IDNO) al stăpânului, codului exploatației și speciei animalului

SOAP · GetAnimals(IDNx: string, ExploitationCode: string, AnimalType: AnimalTypeId) : Animals

Date de intrare — Request

CâmpTipOblig.ExempluDescriere
IDNxstringDa2000000000001Numărul de identificare al persoanei fizice sau a persoanei juridice
ExploitationCodestringDaC737Codul exploatației
AnimalTypeAnimalTypeIdDaBovineSpecia animalului conform clasificatorului “AnimalTypeId”

Date de intrare — RequestHeaders

CâmpTipOblig.ExempluDescriere
CallingUserstring(13)DaNumărul de identificare (IDNP) al utilizatorului sau identificatorul (ID-ul) sistemului care procesează datele cu caracter personal
CallingEntitystring(13)DaNumărul de identificare (IDNO) al persoanei juridice din care face parte utilizatorul care procesează datele cu caracter personal, sau care gestionează sistemul informațional
CallBasisstring(256)DaTemeiul legal al apelului
CallReasonstring(512)DaScopul legal al apelului

Date de ieșire — Response

CâmpTipOblig.ExempluDescriere
AnimalsobjectLista animalelor
· Animalsarray<object>DaDate de identificare a animalelor (bovine, caprine, etc.) în Registrul de Stat al Animalelor
·· CountryCodestring(2)DaMDCodul țării din două litere (ex: AF - Afganistan, RO - România)
·· LabelCodestring(50)DaC196Numărul mijlocului de identificare al animalului (crotalie / transponder)
·· AnimalTypeIdAnimalTypeIdDaBovineSpecia animalului conform clasificatorului “AnimalTypeId”
·· AnimalTypeNamestring(50)DaBovineDenumirea speciei animalului
·· AnimalBreedIdnumberDa22.12Codul rasei animalului
·· AnimalBreedNamestring(100)DaRoșie de stepăDenumirea rasei animalului
·· BirthDateDateDa1985-03-12Data nașterii animalului
·· ExploitationCodestring(10)DaC737Codul exploatației
·· SexnumberDa1Sexul animalului (1 - Masculin, 2 - Feminin)
·· AgenumberDa40Vârsta animalului (luni)
·· AnimalStatusAnimalStatusDa0Statutul curent al animalului
·· LastChangeStatusDateDateDa2024-01-05Data schimbării statutului animalului
·· IDNXstringDa2000000000001Numărul de identificare (IDNP sau IDNO) al stăpânului

Exemple de apel SOAP

Apel reușit
Cerere validă cu RequestHeaders complete → date sample.

Cerere

curl -X POST https://mconnect.evisoft.com/ConsumerService.svc \
  -H 'Content-Type: text/xml; charset=utf-8' \
  -H 'SOAPAction: http://mconnect.gov.md/consumer/GetAnimals' \
  --data '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetAnimals xmlns="http://mconnect.gov.md/consumer">
      <Request>
        <IDNx>2000000000001</IDNx>
        <ExploitationCode>C737</ExploitationCode>
        <AnimalType>Bovine</AnimalType>
      </Request>
      <RequestHeaders>
        <CallingUser>2000000000001</CallingUser>
        <CallingEntity>1002600024777</CallingEntity>
        <CallBasis>Legea 133/2011 privind protecția datelor</CallBasis>
        <CallReason>Prestare serviciu public</CallReason>
      </RequestHeaders>
    </GetAnimals>
  </soap:Body>
</soap:Envelope>'

Răspuns

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetAnimalsResponse xmlns="http://mconnect.gov.md/consumer">
      <Response>
        <Animals>
          <Animals>
            <CountryCode>MD</CountryCode>
            <LabelCode>C196</LabelCode>
            <AnimalTypeId>Bovine</AnimalTypeId>
            <AnimalTypeName>Bovine</AnimalTypeName>
            <AnimalBreedId>22.12</AnimalBreedId>
            <AnimalBreedName>Roșie de stepă</AnimalBreedName>
            <BirthDate>1985-03-12</BirthDate>
            <ExploitationCode>C737</ExploitationCode>
            <Sex>1</Sex>
            <Age>40</Age>
            <AnimalStatus>0</AnimalStatus>
            <LastChangeStatusDate>2024-01-05</LastChangeStatusDate>
            <IDNX>2000000000001</IDNX>
          </Animals>
        </Animals>
      </Response>
    </GetAnimalsResponse>
  </soap:Body>
</soap:Envelope>
Eroare: lipsesc RequestHeaders
Fără CallingUser/CallingEntity → fault (headerele MConnect sunt obligatorii).

Cerere

curl -X POST https://mconnect.evisoft.com/ConsumerService.svc \
  -H 'Content-Type: text/xml; charset=utf-8' \
  -H 'SOAPAction: http://mconnect.gov.md/consumer/GetAnimals' \
  --data '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetAnimals xmlns="http://mconnect.gov.md/consumer">
      <Request>
        <IDNx>2000000000001</IDNx>
        <ExploitationCode>C737</ExploitationCode>
        <AnimalType>Bovine</AnimalType>
      </Request>
    </GetAnimals>
  </soap:Body>
</soap:Envelope>'

Răspuns (fault)

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Client</faultcode>
      <faultstring>Missing RequestHeaders: CallingUser and CallingEntity are required by MConnect.</faultstring>
      <detail>
        <MConnectFault xmlns="http://mconnect.gov.md/consumer">
          <Code>Client</Code>
          <Message>Missing RequestHeaders: CallingUser and CallingEntity are required by MConnect.</Message>
        </MConnectFault>
      </detail>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>
Eroare: subiect inexistent (IDNP …0000)
IDNP cu sufix …0000 → fault NotFound.

Cerere

curl -X POST https://mconnect.evisoft.com/ConsumerService.svc \
  -H 'Content-Type: text/xml; charset=utf-8' \
  -H 'SOAPAction: http://mconnect.gov.md/consumer/GetAnimals' \
  --data '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetAnimals xmlns="http://mconnect.gov.md/consumer">
      <Request>
        <IDNx>2000000000000</IDNx>
        <ExploitationCode>C422</ExploitationCode>
        <AnimalType>Caprine</AnimalType>
      </Request>
      <RequestHeaders>
        <CallingUser>2000000000001</CallingUser>
        <CallingEntity>1002600024777</CallingEntity>
        <CallBasis>Legea 133/2011 privind protecția datelor</CallBasis>
        <CallReason>Prestare serviciu public</CallReason>
      </RequestHeaders>
    </GetAnimals>
  </soap:Body>
</soap:Envelope>'

Răspuns (fault)

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Client</faultcode>
      <faultstring>No data found for the requested subject '2000000000000'.</faultstring>
      <detail>
        <MConnectFault xmlns="http://mconnect.gov.md/consumer">
          <Code>NotFound</Code>
          <Message>No data found for the requested subject '2000000000000'.</Message>
        </MConnectFault>
      </detail>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>
Eroare: eroare server (IDNP …0009)
IDNP cu sufix …0009 → fault ServerError.

Cerere

curl -X POST https://mconnect.evisoft.com/ConsumerService.svc \
  -H 'Content-Type: text/xml; charset=utf-8' \
  -H 'SOAPAction: http://mconnect.gov.md/consumer/GetAnimals' \
  --data '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetAnimals xmlns="http://mconnect.gov.md/consumer">
      <Request>
        <IDNx>2000000000009</IDNx>
        <ExploitationCode>C096</ExploitationCode>
        <AnimalType>Caprine</AnimalType>
      </Request>
      <RequestHeaders>
        <CallingUser>2000000000001</CallingUser>
        <CallingEntity>1002600024777</CallingEntity>
        <CallBasis>Legea 133/2011 privind protecția datelor</CallBasis>
        <CallReason>Prestare serviciu public</CallReason>
      </RequestHeaders>
    </GetAnimals>
  </soap:Body>
</soap:Envelope>'

Răspuns (fault)

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Server</faultcode>
      <faultstring>Simulated server error.</faultstring>
      <detail>
        <MConnectFault xmlns="http://mconnect.gov.md/consumer">
          <Code>ServerError</Code>
          <Message>Simulated server error.</Message>
        </MConnectFault>
      </detail>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>

WSDL: /ConsumerService.svc?singleWsdl · REST: /rest/GetAnimals