php调用.net的Web service,传递参数要求:
string param1
xmldocument param2
string param3实现代码如下:
<?php
$param1="test";
$xmlDocument = '
<root>
<book>php</book>
</root>';
$param3="php";$client = new SoapClient(
"http://localhost/test.amxs?WSDL",
array(
'trace' => 1,
'exceptions' => 1,
'encoding' => 'UTF-8',
)
);$xmlvar = new SoapVar(
$xmlDocument,
XSD_ANYXML
);
$params->xmlDocument = (object)$xmlvar;
$parameters = array(
'param1'=>$param1,
'param2'=>$params,
'param3'=>$param3,
);
print_r($parameters);
try{
$response = $client->Test_php(array('parameters'=>$parameters));
}
catch{
trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
}
?>执行此php,总返回:
SOAP Fault: (faultcode: soap:Server, faultstring: Server was unable to process request. ---> Object reference not set to an instance of an object.)请高手指点~~
string param1
xmldocument param2
string param3实现代码如下:
<?php
$param1="test";
$xmlDocument = '
<root>
<book>php</book>
</root>';
$param3="php";$client = new SoapClient(
"http://localhost/test.amxs?WSDL",
array(
'trace' => 1,
'exceptions' => 1,
'encoding' => 'UTF-8',
)
);$xmlvar = new SoapVar(
$xmlDocument,
XSD_ANYXML
);
$params->xmlDocument = (object)$xmlvar;
$parameters = array(
'param1'=>$param1,
'param2'=>$params,
'param3'=>$param3,
);
print_r($parameters);
try{
$response = $client->Test_php(array('parameters'=>$parameters));
}
catch{
trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
}
?>执行此php,总返回:
SOAP Fault: (faultcode: soap:Server, faultstring: Server was unable to process request. ---> Object reference not set to an instance of an object.)请高手指点~~
解决方案 »
- 后台主页面使用iframe做的,登陆页登陆后不显示主页面的iframe部分是怎么回事
- 来看一下哪里出错了,应该是配置问题吧?
- 问一个xml的问题
- 关于 逗号空格 正则表达式
- 高手快来 php怎么调用ActiveX控件 在线等~
- 从mysql_connect得到值
- Warning: Smarty error: unable to read resource: "index.htm" in E:\客户网站\include\Smarty\Smarty.class.php on line 1082
- Warning: mysql_data_seek():急~请高手帮忙,100分!
- 请大家根据自己的经验帮我推荐几本学习php的好书。谢谢。
- disuz for sae 为什么找不到style_1_common.css跟style_1_index.css?
- php点击按钮或链接显示上一条和下一条记录如何做?
- 一个关于fopen(url)的怪现象.
===========================
貌似SOAP里面没有xmldocument这种数据类型吧