Answer the question
In order to leave comments, you need to log in
How to build a request to SOAP?
Hello!
I ask for help in compiling a SOAP request, because I have never worked with SOAP before.
XSD
WSDL description
Sending a 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');
class Message
{
public $Message;
public $AuthRequest;
public $AuthAppInfo;
public $MasterToken;
}
Answer the question
In order to leave comments, you need to log in
If I understand the WSDL correctly, then the getMessage request has a single parameter - MessageId.
6.1.2. The GetMessage method for receiving a message is designed to receive an xml message in accordance with the scheme defined for a specific service.https://www.nalog.ru/files/kkt/pdf/%D0%A2%D0%B5%D1...
6.1.2.1. Method Signature: GetMessageResponse GetMessage(GetMessageRequest request) throws AuthenticationException, MessageNotFoundException,
where
GetMessageRequest is a request containing a single MessageId element, the message identifier assigned to the request that must be sent to receive the response.
GetMessageResponse - a response containing 2 elements: ProcessingStatus - the status of the request, and Message - a message that allows you to contain any xml with a mandatory schema. ProcessingStatus is an enumeration with two values: PROCESSING – the request is being processed, COMPLETED – the request has been processed.
The Message element is returned only if ProcessingStatus is COMPLETED
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question