How to build a SOAP request to?

Hello!

Asking for help in composing a SOAP request to this SOAP never worked.

XSD
The WSDL description

Sending request:
$client = new \SoapClient($service ['trace' => true]);

 $message = new Message();
 $message->Message = 'Message';
 $message->AuthRequest = 'AuthRequest';
 $message->AuthAppInfo = 'AuthAppInfo';
 $message->MasterToken = 'MasterToken'.env('MASTER_TOKEN');

 $data = $client->getMessage($message);

 $this->log($client->__getLastRequest(), 'request');
 $this->log($client->__getLastResponse(), 'response');


The Message Class
class Message
{
 public $Message;
 public $AuthRequest;
 public $AuthAppInfo;
 public $MasterToken;
}


Get errors like this:
Unmarshalling Error: cvc-complex-type.2.4.b: The content of element 'ns1:Message' is not complete. One of '{WC[##other:"urn://x-artefacts-gnivc-EN/inplat/servin/OpenApiMessageConsumerService/types/1.0"]}' is expected.
April 19th 20 at 12:35
1 answer
April 19th 20 at 12:37
If I understand correctly the WSDL, then the getMessage request only one parameter - MessageId.
6.1.2. Method of receiving message GetMessage designed to receive xml messages in accordance with a particular for a particular service scheme.
6.1.2.1. Method signature: GetMessageResponse GetMessage(GetMessageRequest request) throws AuthenticationException, MessageNotFoundException,
where
GetMessageRequest request containing a single element MessageId – the message ID assigned to the request you want to send to get a response.
GetMessageResponse – reply containing 2 elements: ProcessingStatus status of the query, and the Message – the message that is allowed to contain any xmlс the obligatory indication of the scheme. ProcessingStatus – an enumeration with two values: PROCESSING –the request is processed, COMPLETED –the request has finished processing.
The Message element is returned only if ProcessingStatus is equal to COMPLETED
https://www.nalog.ru/files/kkt/pdf/%D0%A2%D0%B5%D1...
Generally there is an implementation in Ruby, trying in php to move, so the Ruby code
let(:correct_namespaces) do
{
 'xmlns:xs' => 'http://www.w3.org/2001/XMLSchema',
 'xmlns:tns' => 'urn://x-artefacts-gnivc-EN/ais3/kkt/AuthService/types/1.0',
 'targetNamespace' => 'urn://x-artefacts-gnivc-EN/ais3/kkt/AuthService/types/1.0'
}
end
 let(:correct_message_hash) do
{
 'Message' => {
 'tns:AuthRequest' => {
 'tns:AuthAppInfo' => {
 'tns:MasterToken' => 'test_key'
}
}
}
}
 end

AuthRequest and AuthAppInfo is in xsd
It seems to be all the same, but not working. - Jermey_Olson commented on April 19th 20 at 12:40
@Jermey_Olson, except that the WSDL you are not from authorization and from asynchronous API validation check (OpenApiAsyncMessageConsumerService). - ernestina_Me commented on April 19th 20 at 12:43
@ernestina_Me, Yes, thank you, I will update the WSDL description - Jermey_Olson commented on April 19th 20 at 12:46
@Jermey_Olson, And it is a synchronous API validation check.
If you believe the same documentation, the Message needs to emerge here is the query:
<tns:AuthRequest xmlns:tns="urn://x-artefacts-gnivc-EN/ais3/kkt/AuthService/types/1.0">
<tns:AuthAppInfo>
<tns:AppId>REGISTERED_APPLICATION_ID</tns:AppId>
<tns:MasterToken>MASTER_TOKEN_ISSUED_BY_FNS</tns:MasterToken>
</tns:AuthAppInfo>
</tns:AuthRequest>

But then I couldn't help with namespaces in SOAP ever was not the case. - ernestina_Me commented on April 19th 20 at 12:49
@ernestina_Me, Tried it as a string to send, the result is slightly different but the picture is the same. About AppId not given. - Jermey_Olson commented on April 19th 20 at 12:52

Find more questions by tags SOAPPHP