web services - SOAP: PHP invoking .net webservice -
Hi friends, anyone can find out how this request can be made in php. I am starting a pure soap web service.
& lt; Soap: envelope xmlns: soap = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: xsd = "http : //www.w3.org/2001/XMLSchema "& gt; & Lt; Soaps: Body & gt; & Lt; ConfirmCustomerReq xmlns = "http://www.nrs.eskom.co.za/xmlvend/revenue/2.1/schema" & gt; & Lt; Client id xmlns = "http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xsi: type = "ENDeviceID" ean = "xx" /> & Lt; Terminal xmlns = "http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xsi: type = "ENDeviceID" ean = "xx" /> & Lt; MsgID xmlns = "http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" DateTime = "xx" uniqueNumber = "xx" /> & Lt; AuthCred xmlns = "http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" & gt; & Lt; OpName & gt; Xxx & lt; / OpName & gt; & Lt; Password & gt; Xxx @ # 1 & lt; / Password & gt; & Lt; / AuthCred & gt; & Lt; IdMethod xmlns: q1 = "http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xsi: type = "q1: vend idem" & gt; & Lt; Q1: meteridentifier xsi: type = "q1: meter number" msno = "xx" /> & Lt; / IdMethod & gt; & Lt; / ConfirmCustomerReq & gt; & Lt; / Soap: body & gt; & Lt; / Soap: Envelope & gt;
I tried to use the SOAP client class and curls but still the exact XML could not be found below. My code snippet is SOAP client class
< Code> array ('ConfirmCustomerReq' = & gt; array ('ClientID' = & gt; array ('xsi: type' => 'ENDeviceID', 'ean' => 'Xxxx'), 'TerminID '= & Gt; array (' xsi: type '=> gtc: "idvice id",'in' => gt; 'xxx'), 'authCred' => array ('opName' = & gt; "$ This '& gt; username', 'password' = & gt; "$ this-> pass"), 'msgID' = & gt; array ('dateTime' = & gt; "xxx", 'uniqueNumber' = & Gt; "X1: Array ('xsi: type' = & gt; "q1: vandy idm method", 'meteridifa' = & gt; array ('xsi: type' = 'meter number', 'xxx:'), 'idMethod' & Gt; Msno '= & gt; "xxx"))));
and curl
function main () {$ xml = '& lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Soaps: Envelope xmlns: Soap = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: xsd = "http : //www.w3.org/2001/XMLSchema "& gt; & Lt; Soaps: Body & gt; & Lt; ConfirmCustomerReq xmlns = "http://www.nrs.eskom.co.za/xmlvend/revenue/2.1/schema" & gt; & Lt; Client id xmlns = "http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xsi: type = "ENDeviceID" ean = "xx" /> & Lt; Terminal xmlns = "http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xsi: type = "ENDeviceID" ean = "xx" /> & Lt; MsgID xmlns = "http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" DateTime = "xx" uniqueNumber = "xx" /> & Lt; AuthCred xmlns = "http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" & gt; & Lt; OpName & gt; Xxx & lt; / OpName & gt; & Lt; Password & gt; Xxx @ # 1 & lt; / Password & gt; & Lt; / AuthCred & gt; & Lt; IdMethod xmlns: q1 = "http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xsi: type = "q1: vend idem" & gt; & Lt; Q1: meteridentifier xsi: type = "q1: meter number" msno = "xx" /> & Lt; / IdMethod & gt; & Lt; / ConfirmCustomerReq & gt; & Lt; / Soap: body & gt; & Lt; / Soap: Envelope & gt; '; Try {$ soap_do = curl_init (); Curl_setopt ($ soap_do, CURLOPT_URL, "https://www.utilitiesworld.co.za/SecureThirdPartyInterface/VendingService.asmx"); Curl_setopt ($ soap_do, CURLOPT_RETURNTRANSFER, is true); Curl_setopt ($ soap_do, CURLOPT_SSL_VERIFYPEER, incorrect); // curl_setopt ($ soap_do, CURLOPT_CAINFO, 'XXXXXXXXXXXXXX'); Curl_setopt ($ soap_do, CURLOPT_POST, true); Curl_setopt ($ soap_do, CURLOPT_FRESH_CONNECT, TRUE); Curl_setopt ($ soap_do, CURLOPT_POSTFIELDS, $ xml); // curl_setopt ($ soap_do, CURLOPT_HEADER, incorrect); $ Xml_result = Curl_xAk ($ soap_do); Echo curl_error ($ soap_do); // $ result = parse_str ($ xml_result); // var_dump ($ xml_result); Curl_close ($ soap_do);
Soap client Moodle is present in php
Comments
Post a Comment