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

Development | Web Development
5.0 (1 ratings)
Colleagues, I have the following correct SOAP request to a certain server:

<s: Envelope xmlns: s="">
<s: Body>
<CreateOrderBroker xmlns="">
<shortApp xmlns: a="" xmlns: i="">
<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>
</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(""); } } 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:

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

<?Xml version="1.0" encoding="UTF-8"?&Gt;
<SOAP-ENV: Envelope xmlns: SOAP-ENV="" xmlns: ns1="">
<SOAP-ENV: Body><ns1: CreateOrderBroker/>
</SOAP-ENV: Body>
</SOAP-ENV: Envelope>

<s: Envelope xmlns: s="">
<s: Body><CreateOrderBrokerResponse xmlns=""><CreateOrderBrokerResult xmlns: a="" xmlns:="">
<a: OrderId>0</a: OrderId>
<a: ReturnValue>Object reference not set to an instance of an object.</a: ReturnValue>
</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"?
No attachments
All coments
Thanks a lot.
on July 30th, 2020 (10:11 pm)
You must sign in to comment!! LOGIN
We use cookies to give you the best possible experience on our site. By continuing to use the site you agree to our use of cookies. Find out more Accept