所以我在一个with服务上运行了一些测试,它在我的C#代码中运行得很好:
// The objet to do the request
server.CustomerWS Auth = new server.CustomerWS();
// The object we will use to store the request
server.customerXML Cust = new server.customerXML();
// Request
Cust = Auth.authenticate(login, password);
if (cust.retour == true)
{
MessageBox.Show("OK");
}
else
{
MessageBox.Show("KO");
}我需要将这段代码转换成PHP,作为一个完全的新手,我会得到任何帮助,我可以让我开始,主要的问题是我不知道如何处理来自PHP的get服务的对象。
我没有在服务器上使用php5,所以我不能使用soap php函数。
谢谢你的帮助
发布于 2014-11-07 21:34:20
// -- specify your Web Service URL and also the login and password (should be really protected : use HTTPS and send these parameters in POST)
$url = 'http://....';
// The objet to do the request
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_COOKIESESSION, true);
// The object we will use to store the request
$result = NULL;
$xml = new SimpleXmlElement(curl_exec($curl));
if ($xml->retour[0] == true){
print ("OK");
}else{
print("KO");
}希望这能有所帮助:)
https://stackoverflow.com/questions/26802195
复制相似问题