1

Topic: Explain what not so with Soap

I try to cause a method the following :

$wsdl = "http://api.vetrf.ru/schema/platform/services/2.0-RC-last/ams-mercury-g2b.service_v2.0_pilot.wsdl";
$submitApplicationRequest = [
' apiKey ' => ' *** ';
' application ' => [
' serviceId ' => ' mercury-g2b.service ';
' issuerId ' => ' *** ';
' issueDate ' => ' 2018-06-10T12:00:00-05:00 ';
' data ' => [
' getVetDocumentListRequest ' => [
' localTransactionId ' => ' a10003 ';
' initiator ' => [
' login ' => ' *** ';
];
' vetDocumentType ' => ' OUTGOING ';
' vetDocumentStatus ' => ' WITHDRAWN ';
' businessMember ' => [
' businessEntity ' => [
' guid ' => ' ***'
];
' enterprise ' => [
' guid ' => ' ***'
]
]
]
]
]
];
$client = new SoapClient ($wsdl, [
' login ' => ' *** ';
' password ' => ' *** ';
' exceptions ' => TRUE;
' trace ' => TRUE
]);
$client-> submitApplicationRequest ($submitApplicationRequest);
echo ":\n". $client-> __ getLastRequest (). "\n";

But I receive

<b> Fatal error </b>: Uncaught SoapFault exception: [soap-env:Client] in C:\xampp\htdocs\merkyriy_test\index.php:39
Stack trace:
#0 C:\xampp\htdocs\merkyriy_test\index.php (39): SoapClient->__call (' submitApplicati... ', Array)
#1 C:\xampp\htdocs\merkyriy_test\index.php (39): SoapClient->submitApplicationRequest (Array)
#2 {main}
thrown in <b> C:\xampp\htdocs\merkyriy_test\index.php </b> on line <b> 39 </b>

Prompt where I  please.

2

Re: Explain what not so with Soap

If I try to catch an exception I receive the error description:

object (stdClass) #2 (1) {
["incorrectRequestFault"] =>
object (stdClass) #3 (2) {
["message"] =>
string (22) "Request is incorrect."
["error"] =>
string (91) "the Given requests are mandatory for instructions in request."
}
}

The array which I transfer turns out is transferred in that type as it is necessary. Though I built it according to structure xml circuits:

<SOAP-ENV:Envelope xmlns:dt = "http://api.vetrf.ru/schema/cdm/dictionary/v2" xmlns:bs = "http://api.vetrf.ru/schema/cdm/base" xmlns:merc = "http://api.vetrf.ru/schema/cdm/mercury/g2b/applications/v2" xmlns:apldef = "http://api.vetrf.ru/schema/cdm/application/ws-definitions" xmlns:apl = "http://api.vetrf.ru/schema/cdm/application" xmlns:vd = "http://api.vetrf.ru/schema/cdm/mercury/vet-document/v2" xmlns:SOAP-ENV = "http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<apldef:submitApplicationRequest>
<apldef:apiKey> apikey </apldef:apiKey>
<apl:application>
<apl:serviceId>mercury-g2b.service:2.0</apl:serviceId>
<apl:issuerId> issuerId </apl:issuerId>
<apl:issueDate>2017-09-29T16:58:15</apl:issueDate>
<apl:data>
<merc:getVetDocumentListRequest>
<merc:localTransactionId>a10003</merc:localTransactionId>
<merc:initiator>
<vd:login> user_login </vd:login>
</merc:initiator>
<bs:listOptions>
<bs:count> 10 </bs:count>
<bs:offset> 0 </bs:offset>
</bs:listOptions>
<vd:vetDocumentType>OUTGOING</vd:vetDocumentType>
<vd:vetDocumentStatus>WITHDRAWN</vd:vetDocumentStatus>
<dt:enterpriseGuid>ac264dc6-a3eb-4b0f-a86a-9c9577209d6f</dt:enterpriseGuid>
</merc:getVetDocumentListRequest>
</apl:data>
</apl:application>
</apldef:submitApplicationRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

3

Re: Explain what not so with Soap

Question I remove. Understood.