fb_pixel

How to generate a SOAP request in non-wsdl mode in PHP?

Development | Web Development
Description
Colleagues, I have the following correct SOAP request to a certain server:

<s: Envelope xmlns: s="http://schemas.xmlsoap.org/soap/envelope/">
<s: Body>
<CreateOrderBroker xmlns="http://tempuri.org/">
<shortApp xmlns: a="http://schemas.datacontract.org/2004/07/ScroogeCbformsService" xmlns: i="http://www.w3.org/2001/XMLSchema-instance">
<a: PIB>John Doe</a: PIB>
<a: agreeId>3155</a: agreeId>
<a: formId>55</a: formId>
<a: stateCode>1234567890</a: stateCode>
<a: telephone>1511528945</a: telephone>
</shortApp>
</CreateOrderBroker>
</s: Body>
</s: Envelope>

And there is also a working example in C #that forms this query:

public partial class frmMain: Form { public frmMain() { InitializeComponent(); } public EndpointAddress EndPointAddr { get {return new EndpointAddress("https://194.126.180.186:77/ScroogeCbForms.svc?wsdl"); } } private void btnSend_Click(object sender, EventArgs e) { ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(IgnoreCertificateErrorHandler); ServicePointManager.Expect100Continue=false; ServiceICreditTest.CreateOrderResponse response=new CreateOrderResponse(); ScroogeSiteGist client=new ScroogeSiteGist(Binding(), EndPointAddr); shortApplicationBroker shortAp=new shortApplicationBroker() { agreeId=3155, PIB="John Doe", stateCode="1234567890", formId=55, telephone="1511528945" }; //response=client.CreateOrder("1012021013"); response=client.CreateOrderBroker(shortAp); txtText.Text=string.Format("id={0} ErrorId={1}", response.OrderId, response.ReturnValue); }



But I get the following request and server response:

<?Php
...
echo"REQUEST:<pre>".htmlspecialchars($client->__ getLastRequest())."</pre>";
echo"CALLBACK:<pre>".htmlspecialchars($client->__ getLastResponse())."</pre>";


Request:
<?Xml version="1.0" encoding="UTF-8"?&Gt;
<SOAP-ENV: Envelope xmlns: SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns: ns1="http://tempuri.org/">
<SOAP-ENV: Body><ns1: CreateOrderBroker/>
</SOAP-ENV: Body>
</SOAP-ENV: Envelope>


Answer:
<s: Envelope xmlns: s="http://schemas.xmlsoap.org/soap/envelope/">
<s: Body><CreateOrderBrokerResponse xmlns="http://tempuri.org/"><CreateOrderBrokerResult xmlns: a="http://schemas.datacontract.org/2004/07/ScroogeCbformsService" xmlns:="http://www.w3.org/2001/XMLSchema-instance">
<a: OrderId>0</a: OrderId>
<a: ReturnValue>Object reference not set to an instance of an object.</a: ReturnValue>
</CreateOrderBrokerResult>
</CreateOrderBrokerResponse>
</s: Body>
</s: Envelope>

As you can see, the request body is empty.

What does it mean? Is the wsdl schema incorrect? Then why does the C #example form a non-empty request body?

And if the scheme is still wrong - help me manually construct the initial correct query?
And what is important - is there enough data to build it with "hands"?
Attachments
No attachments
Info
Description
Read php manual - https://www.php.net/manual/en/book.soap.php
on July 29th, 2020 (3:11 pm)
All coments
Thanks a lot.
on July 30th, 2020 (10:11 pm)