How to Post SOAP Envelope XML Request From PHP

In this post, i will show you How to send soap envelope XML requests in PHP. No need to declare a long request array, just simple pass soap xml as request using header information. The soap envelope contains the headers and soap body. You need to call a function or method on a web server with some parameters to process the request.

Some users might get confused when seeing the soap XML request format. Like they use SOAPAction URL value as request action or don’t get the header parameters. In this tutorial, we are going to clear your confusion.

Let’s see how soap envelope XML look like.

Soap Envelope XML Request Format is like that:

As you see above Host, Content-Type, Content-Length, and SoapAction, all are the header parameters.

And right below is the XML request string you need to pass. Make sure you put the right value in XML parameter element.

You May Also Like:

How to Authenticate with D&B Direct API Web Service
How to Implement UPS API and Create Shipping Label
How to Get User Data From Slideshare.net API
How to Send Order Data in Shipstation Via API Call

How to Post Soap Envelop XML Request in PHP

We can post soap XML using curl method. Define the curl request header and post the soap envelop XML data. Check the below code to execute this request.

You need to change SOAPaction and request URL as per soap envelop request pattern and call method this curl method in PHP. This is quite easy to implement this soap api call.

Recommended Posts For You

About Harish

I am professional web developer and blogger. Use this blog to share own api and other web development experience with you. I do accept paid work. Write to me at - [email protected]

View all posts by Harish

2 thoughts on “How to Post SOAP Envelope XML Request From PHP”

Leave a Comment

Your email address will not be published. Required fields are marked *