在PHP代码上调用.net webservice [英] calling .net webservice on php code
本文介绍了在PHP代码上调用.net webservice的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有
我试图从我的PHP代码中调用.Net webservice。
WSDL如下:
POST /SMCIVRServices.asmx HTTP / 1.1
主机:192.168.100.16
内容类型:text / xml; charset = utf-8
内容长度:长度
SOAPAction:http://tempuri.org/CardCheck
< ; xml version = 1.0 编码 = utf-8 ? >
< 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/\">
< < span class =code-leadattribute> soap:正文 >
< CardCheck xmlns = http://tempuri.org/ >
< CardNumber > string < / CardNumber >
< / CardCheck >
< / soap:Body >
< / soap:信封 >
HTTP / 1.1 200 OK
内容类型:text / xml; charset = utf-8
内容长度:长度
<? xml version = < span class =code-keyword> 1.0 encoding = utf-8 ? >
< soap:Envelope xmlns:xsi = http://www.w3.org/2001/XMLSchema-instance xmlns:xsd = htt p://www.w3.org/2001/XMLSchema xmlns:soap < span class =code-keyword> = http://schemas.xmlsoap.org/soap/envelope/ >
< soap:Body >
< CardCheckResponse xmlns = http://tempuri.org/ >
< CardCheckResult > 布尔< / CardCheckResult >
< / CardCheckResponse >
< / soap:Body >
< / soap:Envelope >
这是我的代码:
$ wsdl = http://192.168.100.16:8022/SMCIVRServices.asmx?wsdl跨度>;
$ soap_client = new SoapClient($ wsdl);
$ CN = array(' CardNumber' => $ CardNum);
$ response = $ soap_client-> __ soapCall(' CardNumber,array( $ CardNum => $ CN ));
$ CardNum变量的值来自输入。
我无法连接到webserice。
任何帮助将不胜感激。
提前谢谢。
解决方案
wsdl = http://192.168.100.16:8022/SMCIVRServices.asmx?wsdl;
soap_client = new SoapClient(
WSDL);
Dear all
I trying to call .Net webservice from my PHP code.
The WSDL as below:
POST /SMCIVRServices.asmx HTTP/1.1
Host: 192.168.100.16
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/CardCheck"
<?xml version="1.0" encoding="utf-8"?>
<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/">
<soap:Body>
<CardCheck xmlns="http://tempuri.org/">
<CardNumber>string</CardNumber>
</CardCheck>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<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/">
<soap:Body>
<CardCheckResponse xmlns="http://tempuri.org/">
<CardCheckResult>boolean</CardCheckResult>
</CardCheckResponse>
</soap:Body>
</soap:Envelope>
and this is my code:
$wsdl = "http://192.168.100.16:8022/SMCIVRServices.asmx?wsdl";
$soap_client = new SoapClient($wsdl);
$CN = array ('CardNumber' => $CardNum);
$response = $soap_client->__soapCall('CardNumber', array( $CardNum => $CN ));
$CardNum Variables have a value that get from input.
I could not connect to webserice.
Any help will be appreciated.
Thanks in advance.
解决方案
wsdl = "http://192.168.100.16:8022/SMCIVRServices.asmx?wsdl";
soap_client = new SoapClient(
wsdl);
这篇关于在PHP代码上调用.net webservice的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文