woyf
(woyf)
注册会员

初级会员
UID 19021
精华
0
积分 67
帖子 37
金钱 67 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2003-3-18
状态 离线
|
请问我处理SOAP怎么总是有错呢
Fault
Array
(
[faultcode] => Server
[faultactor] =>
[faultstring] => unable to serialize result
[detail] =>
)
总是报这个错,请问是什么原因呢
apserver_client1.php
<?php
require_once('soap/lib/nusoap.php');
//设置参数数组
$PropertyData[] = array(
'dataName' => 'CUT',
'dataValue' => 'Malvern'
);
$para=array("orgID"=>"1",
"prodID"=>"2",
"purchaseID"=>"3",
"loginID"=>"4",
"userName"=>"ffff",
"ip"=>"192.168.0.90",
"actionCode"=>1,
"details"=>$PropertyData
);
//生成客户端对象,注意下面的url ?wsdl是必须加的前面为服务端的文件
$client=new soapclient("http://localhost/soap/apserver_test1.php?WSDL");
//呼叫/使用 那个函数,注意名字空间的区分
$return=$client->call('manageProduct',$para,"http://localhost/soap/APservice","APservice#manageProduct");
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($return);
echo '</pre>';
} else {
// Check for errors
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
// Display the result
echo '<h2>Result</h2><pre>';
print_r($result);
echo '</pre>';
}
}
?>
apserver_test1.php
<?php
require_once('nusoap.php');
$server = new soap_server("apservice.wsdl");
function manageProduct($orgID,$prodID,$purchaseID,$actionCode,$details) {
return $details;
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>
apservice.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://soap.model.service.harmony.runway.com" xmlns:impl="http://soap.model.service.harmony.runway.com" xmlns:intf="http://soap.model.service.harmony.runway.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://eofficeasp.kmip.net/soap/apserver_test1.php">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="PropertyData">
<sequence>
<element name="dataName" nillable="true" type="soapenc:string"/>
<element name="dataValue" nillable="true" type="soapenc:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfPropertyData">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="impl:PropertyData[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="OperateResult">
<sequence>
<element name="errorInfo" nillable="true" type="soapenc:string"/>
<element name="resultCode" type="xsd:int"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="manageUserResponse">
<wsdl:part name="manageUserReturn" type="impl:OperateResult"/>
</wsdl:message>
<wsdl:message name="manageUserRequest">
<wsdl:part name="orgID" type="soapenc:string"/>
<wsdl:part name="prodID" type="soapenc:string"/>
<wsdl:part name="purchaseID" type="soapenc:string"/>
<wsdl:part name="loginID" type="soapenc:string"/>
<wsdl:part name="userName" type="soapenc:string"/>
<wsdl:part name="ip" type="soapenc:string"/>
<wsdl:part name="actionCode" type="xsd:int"/>
<wsdl:part name="details" type="impl:ArrayOfPropertyData"/>
</wsdl:message>
<wsdl:message name="manageProductResponse">
<wsdl:part name="manageProductReturn" type="impl:OperateResult"/>
</wsdl:message>
<wsdl:message name="manageProductRequest">
<wsdl:part name="orgID" type="soapenc:string"/>
<wsdl:part name="prodID" type="soapenc:string"/>
<wsdl:part name="purchaseID" type="soapenc:string"/>
<wsdl:part name="actionCode" type="xsd:int"/>
<wsdl:part name="details" type="impl:ArrayOfPropertyData"/>
</wsdl:message>
<wsdl:portType name="ApService">
<wsdl:operation name="manageProduct" parameterOrder="orgID prodID purchaseID actionCode details">
<wsdl:input name="manageProductRequest" message="impl:manageProductRequest"/>
<wsdl:output name="manageProductResponse" message="impl:manageProductResponse"/>
</wsdl:operation>
<wsdl:operation name="manageUser" parameterOrder="orgID prodID purchaseID purchaseID userName ip actionCode details">
<wsdl:input name="manageUserRequest" message="impl:manageUserRequest"/>
<wsdl:output name="manageUserResponse" message="impl:manageUserResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ApServiceSoapBinding" type="impl:ApService">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="manageProduct">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="manageProductRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soap.model.service.harmony.runway.com"/>
</wsdl:input>
<wsdl:output name="manageProductResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soap.model.service.harmony.runway.com"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="manageUser">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="manageUserRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soap.model.service.harmony.runway.com"/>
</wsdl:input>
<wsdl:output name="manageUserResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soap.model.service.harmony.runway.com"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ApServiceService">
<wsdl:port name="ApService" binding="impl:ApServiceSoapBinding">
<wsdlsoap:address location="http://eofficeasp.kmip.net/soap/apService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
[ 本帖最后由 woyf 于 2006-9-19 01:31 AM 编辑 ]
|
|