Which of the following experts helped me adapt and use curl to call webservice?
Source: Internet
Author: User
Who helped me adapt and use curl to call webservice & lt ;? Php & nbsp; $ s = newSoapClient (& quot; http://www.abc.com/WebServices/Service1.asmx? Wsdl & quot;, true); & nbsp; $ s-& gt; soap_defencod who helped me adapt and use curl to call web service
$ 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?
// 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
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service