Who helped me adapt and use curl to call webservice & lt ;? Php & nbsp; $ snewSoapClient (& quot; www. abc. comWebServicesService1.asmx? Wsdl & quot;, true); & nbsp; $ s-& gt; soap_defencodingUTF-8; & nbsp; $ s-who helped me adapt web service call with curl
$ S = new SoapClient ("http://www.abc.com/WebServices/Service1.asmx? Wsdl ", true );
$ S-> soap_defencoding = 'utf-8 ';
$ S-> decode_utf8 = false;
$ Result = $ s-> call ('userinfo', array ('user' => urldecode ($ _ GET ['username']);
If (! $ Err = $ s-> getError ()){
$ List = explode (";", $ result ["UserInfoResult"]);
Array_pop ($ list );
} Else {
Echo'
';
}
?>
Service1.asmx this web service has a UserInfo function. to pass the parameter to this function, return the result set.
This is a good idea, but the VM does not enable soap expansion, so you don't have to waste effort. how can we rewrite curl now?
------ Solution --------------------
------ Solution --------------------
$ Url = "https: // xxx/xml ";
$ Ch = curl_init ($ url );
$ Headers = array (
"POST". "https: // cxxx/integration/xml". "HTTP/1.0 ",
"Content-type: text/xml; charset = \" UTF-8 \"",
"Accept: text/xml ",
"Content-length:". strlen ($ xmlcontent ),
);
$ Ch = curl_init ();
Curl_setopt ($ ch, CURLOPT_URL, $ url );
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
Curl_setopt ($ ch, CURLOPT_TIMEOUT, 60 );
Curl_setopt ($ ch, CURLOPT_HTTPHEADER, $ headers );
Curl_setopt ($ ch, CURLOPT_SSL_VERIFYPEER, 0 );
// Apply the XML to our curl call
Curl_setopt ($ ch, CURLOPT_POST, 1 );
Curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ xmlcontent );
$ Data = curl_exec ($ ch );
If (curl_errno ($ ch )){
Die ('meeting information error. it is possible that the meeting has not started yet! ');
Exit;
} Else {
// Var_dump ($ data );
Curl_close ($ ch );
}
//
$ Succes = '';
$ CiURL = '';
$ Token = '';
$ Xml = simplexml_load_string ($ data );
$ CiURL = $ xml-> body-> ciURL;
$ Token = $ xml-> body-> token;
Var_dump ($ xml );
------ Solution --------------------
It is estimated that the landlord wants to close the link. Haha