I am trying to call a SOAP webservice using Curl and it does not work. This code is used to access the webservice using the SOAP client. This is working fine and I changed the call using curl and it stopped working. Here my code is curl usage text "itemprop =" text "> If you use the CRL Using it to call the SOAP webservice and the basic example that uses it will also use additional parameters that you have used in your web service call.
$ credentials = "username: password"; $ Url = "https: // mywebserviceurl? Wsdl"; $ Body = '& lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; 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/"> & Lt; Soaps: Body & gt; & Lt; GetEvents xmlns = "https: // umywebserviceurl? Wsdl" & gt; & Lt; / GetEvents & gt; & Lt; / Soap: body & gt; & Lt; / Soap: Envelope & gt; '; Accept $ Headers = array ( 'Content-Type: text / xml; charset = "utf-8"', 'Content-Length:' .strlen ($ body), 'or: text / xml', 'Cache-control: No-cache ',' pragma: no-cache ',' SOAPAction: "GetEvents" '); $ Ch = curl_init (); Curl_setopt ($ CH, CURLOPT_SSL_VERIFYPEER, incorrect); Curl_setopt ($ ch, CURLOPT_URL, $ url); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, true); Curl_setopt ($ ch, CURLOPT_TIMEOUT, 60); Curl_setopt ($ CH, CURLOPT_HTTPHEADER, $ headers); Curl_setopt ($ CH, CURLOPT_USERAGENT, $ _SERVER ['HTTP_USER_AGENT']); // Stuff I added curl_setopt ($ ch, CURLOPT_POST, true); Curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ body); Curl_setopt ($ CH, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); Curl_setopt ($ CH, CURLOPT_USERPWD, $ Credentials); $ Data = curl_xac ($ ch); Echo '& lt; Pre & gt; '; Print_r ($ data);
$ soap = curl_init (); Curl_setopt ($ soapDo, CURLOPT_URL, "[production URL]"); // test "curl_setopt" ($ soapDo, CURLOPT_USERPWD, "[username]: [password]") in "[TestingURL]" Used; Curl_setopt ($ Soap, Curo, A Curl_setopt ($ SOAP, CURLOPT_CONNECTTIMEOUT, 10); Curl_setopt ($ SOAP, CURLOPT_TIMEOUT, 10); Curl_setopt ($ SAPDO, KUROPI T_RETURNTRANSFER, TRUE); Curl_setopt ($ SOAP, CURLOPT_FOLLOWLOCATION, TRUE); Curl_setopt ($ SOAPWAN, CURLOPT_SSL_VERIFYPEER, false); Curl_setopt ($ soap, CURLOPT_SSL_VERIFYHOST, false); Curl_setopt ($ soap, CURLOPT_POST, true); Curl_setopt ($ soap, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2); // system running on the script TLS v1.2 enabled, otherwise it curl_setopt ($ soap, CURLOPT_POSTFIELDS, $ xml) will fail; // This should be an XML string matching requirement Adwanteks XML and WSDL Curl_setopt ($ soapDo, CURLOPT_HTTPHEADER, array ( "Content-Type: text / xml; charset = UTF -8", "Content-Length:". Strlen ($ Xml)); $ Result = curl_xac ($ soap); $ Err = curl_error (soapDo $);
Comments
Post a Comment