axis2写的ws,用Stub方式能接收到数据,用RPC方式却不行

dingheng 发布于 2011/07/08 14:28
阅读 1K+
收藏 0

用axis2写的一个复合数据调用,客户端发出请求(SmsSendResult对象,包含3个属性),服务端用RPC方式接收不到数据,用Stub方式却没问题,代码如下

客户端:

RPCServiceClient serviceClient = new RPCServiceClient();

Options options = serviceClient.getOptions();

 

// 指定调用WebService 的URL

EndpointReference targetEPR = new EndpointReference("http://192.168.1.138:8888//service/ISendCallHistory");

options.setTo(targetEPR);

 

// 指定要调用的getGreeting 方法及WSDL 文件的命名空间

QName opAddEntry = new QName("http://service.cmscs.com", "sendSmsSendResult");

 

SmsSendResult smsSendResult = new SmsSendResult();

smsSendResult.setHookSmsSendResult(1);

smsSendResult.setMissedSmsSendReslt(2);

smsSendResult.setRcId(1);

ReturnMessage returnMessage=(ReturnMessage) serviceClient.invokeBlocking(opAddEntry,

new Object[]{smsSendResult},

new Class[]{ReturnMessage.class})[0];

System.out.println(returnMessage.getOperTime());

System.out.println(returnMessage.getRcId());

System.out.println(returnMessage.getReason());

System.out.println(returnMessage.getResult());

System.exit(0);

}

服务端WSDL:

<wsdl:definitions targetNamespace="http://service.cmscs.com">
<wsdl:types>
<xsd:schema attributeFormDefault="qualifiedelementFormDefault="qualifiedtargetNamespace="http://callhistory.bean.service.cmscs.com">
<xsd:complexType name="SmsSendResult">
<xsd:sequence>
<xsd:element minOccurs="name="hookSmsSendResulttype="xsd:int"/>
<xsd:element minOccurs="name="missedSmsSendReslttype="xsd:int"/>
<xsd:element minOccurs="name="rcIdtype="xsd:long"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="IvrCallReord">
<xsd:sequence>
<xsd:element minOccurs="name="callLongtype="xsd:long"/>
<xsd:element minOccurs="name="callRecordernillable="truetype="xsd:string"/>
<xsd:element minOccurs="name="rcIdtype="xsd:long"/>
<xsd:element minOccurs="name="resulttype="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
<xsd:schema attributeFormDefault="qualifiedelementFormDefault="qualifiedtargetNamespace="http://service.cmscs.com">
<xsd:element name="sendSmsSendResult">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1minOccurs="1name="in0nillable="truetype="ns1:SmsSendResult"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="sendSmsSendResultResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1minOccurs="1name="outnillable="truetype="ns2:ReturnMessage"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="sendIvrCallRecord">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1minOccurs="1name="in0nillable="truetype="ns1:IvrCallReord"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="sendIvrCallRecordResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1minOccurs="1name="outnillable="truetype="ns2:ReturnMessage"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<xsd:schema attributeFormDefault="qualifiedelementFormDefault="qualifiedtargetNamespace="http://returntype.bean.service.cmscs.com">
<xsd:complexType name="ReturnMessage">
<xsd:sequence>
<xsd:element minOccurs="name="operTimenillable="truetype="xsd:string"/>
<xsd:element minOccurs="name="rcIdtype="xsd:long"/>
<xsd:element minOccurs="name="reasonnillable="truetype="xsd:string"/>
<xsd:element minOccurs="name="resultnillable="truetype="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="sendIvrCallRecordRequest">
<wsdl:part name="parameterselement="tns:sendIvrCallRecord">   </wsdl:part>
</wsdl:message>
<wsdl:message name="sendSmsSendResultResponse">
<wsdl:part name="parameterselement="tns:sendSmsSendResultResponse">   </wsdl:part>
</wsdl:message>
<wsdl:message name="sendIvrCallRecordResponse">
<wsdl:part name="parameterselement="tns:sendIvrCallRecordResponse">   </wsdl:part>
</wsdl:message>
<wsdl:message name="sendSmsSendResultRequest">
<wsdl:part name="parameterselement="tns:sendSmsSendResult">   </wsdl:part>
</wsdl:message>
<wsdl:portType name="ISendCallHistoryPortType">
<wsdl:operation name="sendSmsSendResult">
<wsdl:input name="sendSmsSendResultRequestmessage="tns:sendSmsSendResultRequest">   </wsdl:input>
<wsdl:output name="sendSmsSendResultResponsemessage="tns:sendSmsSendResultResponse">   </wsdl:output>
</wsdl:operation>
<wsdl:operation name="sendIvrCallRecord">
<wsdl:input name="sendIvrCallRecordRequestmessage="tns:sendIvrCallRecordRequest">   </wsdl:input>
<wsdl:output name="sendIvrCallRecordResponsemessage="tns:sendIvrCallRecordResponse">   </wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ISendCallHistoryHttpBindingtype="tns:ISendCallHistoryPortType">
<wsdlsoap:binding style="documenttransport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="sendSmsSendResult">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="sendSmsSendResultRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="sendSmsSendResultResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="sendIvrCallRecord">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="sendIvrCallRecordRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="sendIvrCallRecordResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ISendCallHistory">
<wsdl:port name="ISendCallHistoryHttpPortbinding="tns:ISendCallHistoryHttpBinding">
<wsdlsoap:address location="http://192.168.1.138:81//service/ISendCallHistory"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

加载中
返回顶部
顶部