try{ ini_set("soap.wsdl_cache_enabled", "0"); //$client = new SoapClient('http://你的.wsdl',array("trace"=>true,'soap_version' => SOAP_1_2)); //$xml=iconv('gbk','utf-8//IGNORE',$xml); //$result = $client->HIPMessageServer(array('action'=>"PatientRegistryAddRequest", 'message'=>$xml)); $client = new SoapClient(null, array( 'location' => "http://这个是wsdl里定义的location的值", 'uri' => "http://tempuri.org", 'soap_version' => SOAP_1_2, 'trace' => 1 )); $result = $client->__soapCall('HIPMessageServer',array("action"=>"PatientRegistryAddRequest", "message"=>$xml)); //var_dump($result) ; }catch(SoapFault $e){ //echo $client->__getLastRequest(); echo $client->__getLastResponse(); //echo $e->getMessage(); } $requestHeaders = $client->__getLastRequestHeaders(); $request = $client->__getLastRequest(); $responseHeaders = $client->__getLastResponseHeaders(); $response=$client->__getLastResponse(); printf("\nRequest Headers -----\n"); var_dump($requestHeaders); printf("\nRequest -----\n"); var_dump($request); printf("\nResponse Headers -----\n"); var_dump($responseHeaders); printf("\nResponse -----\n"); var_dump($response); printf("\nEND\n");
这些只是调试soap而已,对标题的问题并没有什么帮助。
wsdl里用rpc,自己写测试用例都没有问题,但是别人的工具就只有post请求到wsdl,而且返回的500错误。
------------正 文 已 结 束, 感 谢 您 的 阅 读 (折雨的天空)--------------------
转载请注明本文标题和链接:《soap1.2协议的rpc和document的区别导致php无法获取到内容》
发表评论