喜悦国际村 
» 游客:  注册 | 登录 | 搜索 | 统计 | 喜悦证交所 | 帮助

RSS 订阅当前论坛  

[北京]代朋友公司招聘PHP高级程序员多名

上一主题 下一主题
     
标题: [问题] 请问我处理SOAP怎么总是有错呢  
 
woyf (woyf)
注册会员
Rank: 2
初级会员



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 编辑 ]
2006-9-19 01:29 AM#1
查看资料  发短消息  顶部
 
cfz_548 (cfz_548)
高级会员
Rank: 4
老会员



UID 20905
精华 0
积分 537
帖子 542
金钱 537 喜悦币
威望 0
人脉 0
阅读权限 50
注册 2003-6-19
状态 离线
[推荐阅读] 招牛人的帖
<?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);
?>
应该要有个register函数吧!
2006-9-19 12:30 PM#2
查看资料  Blog  发短消息  顶部
 
ack2
新手上路
Rank: 1



UID 80297
精华 0
积分 14
帖子 13
金钱 14 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2006-9-20
状态 离线
[推荐阅读] 请教apache的一条log日志
没用过wsdl的方式
2006-9-20 12:41 PM#3
查看资料  发短消息  顶部
 
糖豆儿
新手上路
Rank: 1



UID 80267
精华 0
积分 12
帖子 15
金钱 12 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2006-9-19
状态 离线
[推荐阅读] ppwind 1.2 影视系统 正式发布--包揽全国所有p2p节目
纯粹帮顶的说
2006-9-20 10:37 PM#4
查看资料  发短消息  顶部
     


  可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题 | 开通个人空间  


 




Powered by Discuz! 6.1.0  © 2001-2010 Comsenz Inc.
Processed in 0.029441 second(s), 6 queries

(冀ICP备05009913号) 管理员:sadly 邮箱/MSN: sadly@phpx.com QQ:824008(长隐) 清除 Cookies - - Archiver - WAP