我的网络服务出错了。 错误是:
从元素'callerNumber'开始发现无效内容。此时不会有子元素。
服务发送对象RelationCARO包含3个字符串:caName,roName和callerNumber(可选)。
当callerNumber为NULL时,它可以工作,当callerNumber不为NULL时,我有上述错误。
当我尝试使用soapUI调用服务时,它甚至可以使用callerNumber。
WSDL:
<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions name="RMDManagementService" targetNamespace="http://ws.mom.rmd.atos.net/ws" xmlns:ns1="http://cxf.apache.org/bindings/xformat" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.mom.rmd.atos.net/ws" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xs:schema elementFormDefault="unqualified" targetNamespace="http://ws.mom.rmd.atos.net/ws" version="1.0" xmlns:tns="http://ws.mom.rmd.atos.net/ws" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="createRelationCaRo" type="tns:createRelationCaRo" />
<xs:element name="createRelationCaRoResponse" type="tns:createRelationCaRoResponse" />
<xs:complexType name="createRelationCaRo">
<xs:sequence>
<xs:element minOccurs="0" name="relationCaRo" type="tns:relationCaRo" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="relationCaRo">
<xs:sequence>
<xs:element minOccurs="0" name="caName" type="xs:string" />
<xs:element minOccurs="0" name="roName" type="xs:string" />
<xs:element minOccurs="0" name="callerNumber" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="createRelationCaRoResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="tns:relationCaRoFeedback" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="relationCaRoFeedback">
<xs:sequence>
<xs:element minOccurs="0" name="caName" type="xs:string" />
<xs:element minOccurs="0" name="roName" type="xs:string" />
<xs:element minOccurs="0" name="statusReturnCode" type="tns:statusReturnCodeEnum" />
</xs:sequence>
</xs:complexType>
<xs:simpleType name="statusReturnCodeEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="CDE_RMD000" />
<xs:enumeration value="CDE_RMD001" />
<xs:enumeration value="CDE_RMD300" />
<xs:enumeration value="CDE_RMD303" />
<xs:enumeration value="CDE_RMD304" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
</wsdl:types>
<wsdl:message name="createRelationCaRo">
<wsdl:part element="tns:createRelationCaRo" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="createRelationCaRoResponse">
<wsdl:part element="tns:createRelationCaRoResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="RMDManagement">
<wsdl:operation name="createRelationCaRo">
<wsdl:input message="tns:createRelationCaRo" name="createRelationCaRo">
</wsdl:input>
<wsdl:output message="tns:createRelationCaRoResponse" name="createRelationCaRoResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="RMDManagementServiceSoapBinding" type="tns:RMDManagement">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="createRelationCaRo">
<soap:operation soapAction="" style="document" />
<wsdl:input name="createRelationCaRo">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="createRelationCaRoResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="RMDManagementService">
<wsdl:port binding="tns:RMDManagementServiceSoapBinding" name="RMDManagementSOAPPort">
<soap:address location="http://...../RMDManagementService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
在客户端,我用wsdl2java生成了所有类。
我不明白这个问题,因为参数中只有3个字符串,没有子节点。
感谢您的帮助。
答案 0 :(得分:0)
你的wsdl完全没问题。 请在此处发布您的代码(消息上下文部分和肥皂信封创建也),我无法弄清楚您的问题。