php调用webservice问题

LiveAsaMonster LiveAsaMonster 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
小弟最近在做跟外部项目接口时需要调用对方提供的webservice,Fault occurred while processing报这样一个错,谷姐之后说是传入的字符为空导致的,下面是传入的xml数据
<?xml version="1.0" encoding="UTF-8"?>
<processSP><wmsSecurityInfo><username>40222</username><password>flux22</password></wmsSecurityInfo><wmsParam><customerid>GXG</customerid><messageid>106D</messageid><stdno>SO</stdno><warehouseid>GXG_WMS</warehouseid><param>1209200001346</param></wmsParam></processSP>
,按说没有空值呀。。又想是不是xml的UTF-8格式导致的,顺便问下这样一个UTF-8格式的xml字符串,如何改变编码?($iconv_str = iconv('UTF-8', 'GBK', $str);php的这个函数不行)但这或许不是根本原因,还请大神指点,下面是我调用的代码以及webservice提供的说明

$str = array2xml($data,'processSP');
$iconv_str = iconv("UTF-8", "GBK", $str);


$soap_client = new SoapClient('http://192.168.1.9:8081/datahubWeb/WMSSOAP2/WSERPService/ERP/Service3?wsdl');
$soap_result = $soap_client->processSP($iconv_str);
,

<wsdl:operation name="processSP">
<wsdl:input message="tns:processSP" name="processSP"></wsdl:input>
<wsdl:output message="tns:processSPResponse" name="processSPResponse"></wsdl:output>
</wsdl:operation>


...全文

相关推荐

PHP调用.NET的WebService 简单实例

主要介绍了使用PHP调用.NET的WebService的一个简单实例,十分的简单,有需要的小伙伴可以自己扩展下,如有疑问请留言。

weixin_38656463

c# 调用php webservice 源代码

c# 调用php webservice 汉字乱码解决方案

wx@aiotgman

PHP中如何调用webservice的实例参考

本篇文章介绍了,PHP中如何调用webservice的实例参考。需要的朋友参考下

weixin_38645434

PHP调用C#的webservice

PHP去调用C#写的一个webservice的例子,里面有详细的文字说明,希望对初学者有一定的帮助。

alive_roy

Java调用php的webservice

Java调用php的webservice: header("Content-Type:text/html;charset=UTF-8"); // require('lib/nusoap.php'); require_once("lib/nusoap.php"); $server = new soap_server(); $server->configureWSDL('hellowsdl', 'urn:hellowsdl'); $server->wsdl->schemaTargetNamespace = 'urn:hellowsdl'; $server->register('hello', // method name array('name' => 'xsd:string'), // input parameters array('return' => 'xsd:string'), // output parameters 'urn:hellowsdl', // namespace 'urn:hellowsdl#hello', // soapaction 'rpc', // style 'encoded', // use 'Says hello to the caller' // documentation ); ... String endpoint = "http://localhost/Service1/WebContent/index.php";//该段就是上面刚将的地址 Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(new java.net.URL(endpoint)); call.setOperationName("hello"); ...

Phoenix Slade
评论 3
收藏 已收藏
分享
返回顶部
LiveAsaMonster
基础编程 21,889 成员 140,329 内容