XML : How to send $_POST data using SOAP

I have a form that takes data from the user. I'm using post so the array is like this:

  array (size=11)   'form' => string 'form-elements' (length=13)    'company' => string 'test 1' (length=6)    'cod_postal' => string 'test 2' (length=6)    'test' => string 'test 3' (length=6)    'contact' => string 'test 4' (length=6)    'phone' => string '7568768768' (length=10)    'email' => string 'andrey61312@yahoo.com' (length=21)    'message' => string 'test 5' (length=6)    'RadioButtons' => string 'Element 2' (length=9)    'recaptcha_challenge_field' => string '03AHJ_VuuEJpyd4cFGybiaeDxPqA0V8oxGWVsgdJYCNLx3VqRyJAwNH4y1KupxP8MYxv1Jbs_4NaTq2tby1Epl-ha6E5XicRLb-SrRjEhYHELkSPK5U4acqgBPnX14d93geHll3Y61_8JbA6zyVIseEDgHWdHw7EBN7lu3UdebgIKOXOM2shbotKyxlaecF1HdK2kjuhDR_MLDObIYDmGVhAxUqhYvb7KNi5Flcf4EZKDEbU2590cV7Kmft0sT6GXfJiYlGwOJgsz_uNNJi9M4hMXPn5cIWx0_Fg' (length=292)    'recaptcha_response_field' => string '437' (length=3)    

From this array I don't need "recaptcha_challenge_field" and "recaptcha_response_field".

So this is what is stored in $_POST. Now I need to use soap to send this information to a service using SOAP.

The SOAP format needs to be like :

  POST /Service.asmx HTTP/1.1  Host: test.test.com  Content-Type: text/xml; charset=utf-8  Content-Length: length  SOAPAction: "http://test.test.com/Inserttest"  <?xml version="1.0" encoding="utf-8"?>  <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">    <soap:Body>      <InsertLead xmlns="http://test.test.com/">        <Key>string</Key>        <EMailSendingID>int</EMailSendingID>        <SendingListID>int</SendingListID>        <EmailAddress>string</EmailAddress>        <IP>string</IP>        <ALL>int</ALL>        <XMLData>here is the xml data from $_POST formated like : [["company:","test1",1],["cod_postal:","test 2",2],["Company:","test 3",2],["contact:","test 4",2],["phone:","7568768768",3],["Email:","email@email.com",4],["message:","test 5",5],["RadioButtons:","Element 2",0]] </XMLData>      </InsertLead>    </soap:Body>  </soap:Envelope>    

How I can do this ?

No comments:

Post a Comment