本文介绍了如何在nusoap客户端中使用复杂类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 大家好。 在我的情况下,服务器端有这个方法和tns类型:hi ALL .in my case,the server side has this methode and tns type:<s:element name="AuthHeader" type="tns:AuthHeader" /> <s:complexType name="AuthHeader"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="UserName" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" /> </s:sequence> <s:anyAttribute /> </s:complexType> <s:element name="GetCustomerInformation"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="CustomerNumber" type="s:string" /> </s:sequence> </s:complexType> </s:element> <s:element name="GetCustomerInformationResponse"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="GetCustomerInformationResult"> <s:complexType> <s:sequence> <s:element ref="s:schema" /> <s:any /> </s:sequence> </s:complexType> </s:element> </s:sequence> </s:complexType> </s:element> 我在asp.net中使用此代码的结果: (refrence添加到名为'Server'的服务引用中) in asp.net i take result by this code:(refrence added into service refrence named 'Server')Server.ServiceSoapClient cli = new Server.ServiceSoapClient(); Server.AuthHeader Auth = new Server.AuthHeader(); Auth.UserName = "myusername"; Auth.Password = "mypassword"; string CustomerNumber="123456789"; DataSet ds = cli.GetCustomerInformation(Auth, CustomerNumber); 但是当使用php nusoap返回错误时: PHP代码:but when use php nusoap returned fault: PHP Code:$param=array('AuthHeader'=>array('UserName'=>'myusername','Password'=>'mypassword') ,'CustomerNumber'=>'123456789');$cli2= new nusoap_client('http://10.10.10.10:8080/Service.asmx?wsdl', true);$err = $cli2->getError();if ($err){ print_r($err);}$res=$cli2->call('GetCustomerInformation',$param);if ($cli2->fault){ print_r($res);}else{ $err = $cli2->getError(); if ($err) {print_r($err); } else {print_r($res); }} 返回此错误: wsdl错误:http:/10.10.10.10:8080 /:GetCustomerInformation ^(GetCustomerInformation ^)不是受支持的类型。Return This Error:wsdl error: http:/10.10.10.10:8080/:GetCustomerInformation^ (GetCustomerInformation^) is not a supported type.推荐答案 这篇关于如何在nusoap客户端中使用复杂类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
05-26 21:07
查看更多