<?php
header("Content-type: text/html; charset=utf-8");
$client = new SoapClient('http://183.63.194.18:2000/TTS/Services/CodeService.svc?wsdl',array('soap_version' => SOAP_1_2));
$actionHeader = new SoapHeader('http://www.w3.org/2005/08/addressing','Action','http://tempuri.org/ICodeService/GetCodeBatches');
$client->__setSoapHeaders($actionHeader);
echo '<xmp>';echo "提供的方法\n";
print_r( $client->__getFunctions ());
echo "相关的数据结构\n";
print_r($client->__getTypes () );
echo '</xmp>';
$parameters = array( "codeId" => "208x6XBJ140000080" );
//$res = $client->__call('GetCodeBatches',array( 'codeId' => $parameters));
$res = $client->__call('GetCodeBatches',array('parameters' => $parameters));
//$res = $client->GetCodeBatches($parameters);
print_r($res);
?>
报错如下:
Fatal error: Uncaught SoapFault exception: [s:Sender] The message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher.Check that the sender and receiver's EndpointAddresses agree in D:\wamp\www\test.php:20 Stack trace: #0 D:\wamp\www\test.php(20): SoapClient->__call('GetCodeBatches', Array) #1 {main} thrown in D:\wamp\www\test.php on line 20"
折腾了三天了,百度上全是粘贴复制的,谷歌上又全都是C#的解决办法,我大php木有...
求高手解决
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
你这SOAP调用写得可真挫!
看看我写的例子吧。
http://www.oschina.net/question/1539302_159239
需要调用SOAP方法,最好用classmap的方式,尤其是在和.NET和Java等非PHP的面向对象的语言交互时。网上看到的例子大多数都是PHP调用PHP的webservice,这种就没什么意义了...
你这SOAP调用写得可真挫!
看看我写的例子吧。
http://www.oschina.net/question/1539302_159239
需要调用SOAP方法,最好用classmap的方式,尤其是在和.NET和Java等非PHP的面向对象的语言交互时。网上看到的例子大多数都是PHP调用PHP的webservice,这种就没什么意义了...
soapUI用起,抓包