php call .net web service?该如何解决
程序员文章站
2022-04-27 09:29:21
...
php call .net web service???
Hello,every body:
I have a question about PHP call .net webservice, please help me.
Why the server can not access the array value i sent?
===================================================================
Here is the SOAP 1.1 request and respond example
------------------------------------------------
POST /DMService.asmx HTTP/1.1
Host: sboserver1
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/InsertTest"
string
string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
string
string
======================================================
Here is the method that client code call the method 'InsertTest':
----------------------------------------------------
$soap = new soapclient($wsdl,'wsdl');
$soap->soap_defencoding = 'UTF-8';
$soap->decode_utf8 = false;
$soap->xml_encoding = 'UTF-8';
$result = $soap->call('InsertTest',array('s' => array('0000','aaaa')),'', '', false, true,'document','encoded');
var_dump($result);
?>
Why the server can not access the array value i sent?
======================================================
The .net webservice WSDL file is as follows:
======================================================
Hi ,this article too long,please see here ( http://sourceforge.net/community/forum/topic.php?id=827&page&replies=1) ,
thanks.
------解决方案--------------------
Are you Chinese?
If you are Chinese, please refer to http://blog.csdn.net/mynamesucks/archive/2006/05/26/756480.aspx
Otherwise, see following.
replace
$result = $soap-> call('InsertTest',array('s' => array('0000','aaaa')),'', '', false, true,'document','encoded');
to
$proxy = $soap->getProxy();
$result = $proxy-> InsertTest(array('s' => array('0000','aaaa')),'', '', false, true,'document','encoded');
------解决方案--------------------
.NET的WS有若干种编码方式,其中有一种是和PHP不兼容的。我忘记了具体是Encoded还是Literal。不过已经有人用NuSoap解决了这个问题。具体代码如果你要,我大概还是能找到的。
Hello,every body:
I have a question about PHP call .net webservice, please help me.
Why the server can not access the array value i sent?
===================================================================
Here is the SOAP 1.1 request and respond example
------------------------------------------------
POST /DMService.asmx HTTP/1.1
Host: sboserver1
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/InsertTest"
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
======================================================
Here is the method that client code call the method 'InsertTest':
----------------------------------------------------
$soap = new soapclient($wsdl,'wsdl');
$soap->soap_defencoding = 'UTF-8';
$soap->decode_utf8 = false;
$soap->xml_encoding = 'UTF-8';
$result = $soap->call('InsertTest',array('s' => array('0000','aaaa')),'', '', false, true,'document','encoded');
var_dump($result);
?>
Why the server can not access the array value i sent?
======================================================
The .net webservice WSDL file is as follows:
======================================================
Hi ,this article too long,please see here ( http://sourceforge.net/community/forum/topic.php?id=827&page&replies=1) ,
thanks.
------解决方案--------------------
Are you Chinese?
If you are Chinese, please refer to http://blog.csdn.net/mynamesucks/archive/2006/05/26/756480.aspx
Otherwise, see following.
replace
$result = $soap-> call('InsertTest',array('s' => array('0000','aaaa')),'', '', false, true,'document','encoded');
to
$proxy = $soap->getProxy();
$result = $proxy-> InsertTest(array('s' => array('0000','aaaa')),'', '', false, true,'document','encoded');
------解决方案--------------------
.NET的WS有若干种编码方式,其中有一种是和PHP不兼容的。我忘记了具体是Encoded还是Literal。不过已经有人用NuSoap解决了这个问题。具体代码如果你要,我大概还是能找到的。
相关文章
相关视频
推荐阅读
-
linux 下 php的mysql扩展编译成功 显示mysql support yes 下面一切顺利 但是页面上却call undefined functio,该如何解决
-
linux 下 php的mysql扩展编译成功 显示mysql support yes 下面一切顺利 但是页面上却call undefined functio,该如何解决
-
想把原来C/S系统转为PHP的B/S结构,问能Web页面与PHP代码分离编程吗?该如何解决
-
linux 下 php的mysql扩展编译成功 显示mysql support yes 下面一切顺利 但是页面上却call undefined functio,该如何解决
-
php call .net web service?该如何解决
-
php call .net web service?该如何解决
-
linux 下 php的mysql扩展编译成功 显示mysql support yes 下面一切顺利 但是页面上却call undefined functio,该如何解决
-
php call .net web service?该如何解决