#java #soap #wsdl
#java #soap #wsdl
Вопрос:
У меня есть два разных WSDL для одного и того же процесса. Первый предоставляет три пакета в wsimport, а второй — два пакета в wsimport. Я думаю, что оба wsdl из разных версий, но я уверен, что обе имеют одинаковую функциональность. Первый из трех пакетов работает для меня нормально, но второй выдает ошибку, т.е. Ошибку SOAP, указанную на изображении. Я искал и работал над каждой возможностью, но все же я стою перед той же проблемой. Кто-нибудь знает, каким будет рабочее решение?
Первый wsdl
<?xml version="1.0" encoding="UTF-8" ?>
- <!-- Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.3.0-b170407.2038 svn-revision#2eaca54d17a59d265c6fe886b7fd0027836c766c.
-->
- <wsdl:definitions xmlns:tns="http://ouaf.oracle.com/webservices/c1/C1-AccountMail" xmlns:ouaf="http://ouaf.oracle.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="C1-AccountMail" targetNamespace="http://ouaf.oracle.com/webservices/c1/C1-AccountMail" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wssutil="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsp:UsingPolicy wssutil:Required="true" />
<wsdl:documentation>C1-AccountMail version 1: Retrieve an Account's Mailing Address</wsdl:documentation>
- <wsdl:types>
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ouaf="http://ouaf.oracle.com/" targetNamespace="http://ouaf.oracle.com/" elementFormDefault="unqualified">
- <xsd:element name="Fault">
- <xsd:complexType>
- <xsd:all>
<xsd:element name="ResponseStatus" type="xsd:string" />
<xsd:element name="ResponseCode" type="xsd:int" />
<xsd:element name="ResponseText" type="xsd:string" />
- <xsd:element name="ResponseData" minOccurs="0">
- <xsd:complexType>
<xsd:attribute name="parm1" type="xsd:string" />
<xsd:attribute name="parm2" type="xsd:string" />
<xsd:attribute name="parm3" type="xsd:string" />
<xsd:attribute name="parm4" type="xsd:string" />
<xsd:attribute name="parm5" type="xsd:string" />
<xsd:attribute name="parm6" type="xsd:string" />
<xsd:attribute name="parm7" type="xsd:string" />
<xsd:attribute name="parm8" type="xsd:string" />
<xsd:attribute name="parm9" type="xsd:string" />
<xsd:attribute name="text" type="xsd:string" />
<xsd:attribute name="category" type="xsd:string" />
<xsd:attribute name="numParm" type="xsd:int" />
<xsd:attribute name="number" type="xsd:int" />
</xsd:complexType>
</xsd:element>
- <xsd:element name="ServerMessage" minOccurs="0">
- <xsd:complexType>
- <xsd:all>
<xsd:element name="Category" type="xsd:string" />
<xsd:element name="Number" type="xsd:string" />
<xsd:element name="CallSequence" type="xsd:string" />
<xsd:element name="ProgramName" type="xsd:string" />
<xsd:element name="Text" type="xsd:string" />
<xsd:element name="Description" type="xsd:string" />
<xsd:element name="Table" type="xsd:string" />
<xsd:element name="Field" type="xsd:string" />
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
- <xsd:simpleType name="money">
<xsd:restriction base="xsd:decimal" />
</xsd:simpleType>
- <xsd:simpleType name="listAction">
- <xsd:restriction base="xsd:token">
<xsd:enumeration value="delete" />
<xsd:enumeration value="add" />
<xsd:enumeration value="update" />
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ouaf="http://ouaf.oracle.com/" targetNamespace="http://ouaf.oracle.com/webservices/c1/C1-AccountMail" elementFormDefault="qualified">
<xsd:import namespace="http://ouaf.oracle.com/" />
- <xsd:element name="C1-AccountMail">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="accountId" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="65536" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="results" minOccurs="0" maxOccurs="unbounded">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="premise" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="4000" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
- <xsd:element name="premiseInfo" minOccurs="0">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
<xsd:maxLength value="4000" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="action" type="ouaf:listAction" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
- <!-- wsdl:message elements describe potential transactions -->
- <!-- request for operation C1-AccountMail -->
- <wsdl:message name="C1-AccountMailRequest">
<wsdl:part name="body" element="tns:C1-AccountMail" />
</wsdl:message>
- <!-- response for operation C1-AccountMail -->
- <wsdl:message name="C1-AccountMailResponse">
<wsdl:part name="body" element="tns:C1-AccountMail" />
</wsdl:message>
- <!-- fault type -->
- <wsdl:message name="Fault">
<wsdl:part name="fault" element="ouaf:Fault" />
</wsdl:message>
- <!-- wsdl:portType describes messages in an operation -->
- <wsdl:portType name="C1-AccountMailPortType">
<wsdl:documentation>C1-AccountMail version 1: Retrieve an Account's Mailing Address</wsdl:documentation>
- <wsdl:operation name="C1-AccountMail">
<wsdl:input message="tns:C1-AccountMailRequest" />
<wsdl:output message="tns:C1-AccountMailResponse" />
<wsdl:fault name="fault" message="tns:Fault" />
</wsdl:operation>
</wsdl:portType>
- <!-- wsdl:binding states a serialization protocol for this service -->
- <wsdl:binding name="C1-AccountMailSoapBinding" type="tns:C1-AccountMailPortType">
<wsp:PolicyReference URI="policy:Wssp1.2-2007-Https-BasicAuth.xml" />
- <!-- leverage off soap:binding document style @@@(no wsdl:foo pointing at
the soap binding) -->
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <!-- semi-opaque container of network transport details classed by
soap:binding above @@@ -->
- <wsdl:operation name="C1-AccountMail">
- <!-- again bind to SOAP? @@@ -->
<soap:operation soapAction="http://10.1.5.86:6500/webservices/C1-AccountMail#C1-AccountMail" />
- <!-- further specify that the messages in the wsdl:operation
"C1-AccountMail" use SOAP? @@@ -->
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
- <wsdl:fault name="fault">
<soap:fault name="fault" use="literal" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
- <!-- wsdl:service names a new service "C1-AccountMailService" -->
<wsdl:service name="C1-AccountMailService">
<wsdl:documentation>C1-AccountMail version 1: Retrieve an Account's Mailing Address</wsdl:documentation>
- <!-- connect it to the binding "C1-AccountMailSoapBinding" above -->
- <wsdl:port name="C1-AccountMailPort" binding="tns:C1-AccountMailSoapBinding">
- <!-- give the binding a network address -->
<soap:address location="http://10.1.5.86:6500/ouaf/webservices/C1-AccountMail" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Второй WSDL
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<!-- Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.3.0-b170407.2038 svn-revision#2eaca54d17a59d265c6fe886b7fd0027836c766c. -->
<wsdl:definitions xmlns:tns="http://ouaf.oracle.com/webservices/c1/C1-AccountMail" xmlns:ouaf="http://ouaf.oracle.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wssutil="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" name="C1-AccountMail" targetNamespace="http://ouaf.oracle.com/webservices/c1/C1-AccountMail">
<wsp:UsingPolicy wssutil:Required="true"/>
<wsdl:documentation>C1-AccountMail version 1: Retrieve an Account's Mailing Address</wsdl:documentation>
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ouaf="http://ouaf.oracle.com/" targetNamespace="http://ouaf.oracle.com/" elementFormDefault="unqualified">
<xsd:element name="Fault">
<xsd:complexType>
<xsd:all>
<xsd:element name="ResponseStatus" type="xsd:string"/>
<xsd:element name="ResponseCode" type="xsd:int"/>
<xsd:element name="ResponseText" type="xsd:string"/>
<xsd:element name="ResponseData" minOccurs="0">
<xsd:complexType>
<xsd:attribute name="parm1" type="xsd:string"/>
<xsd:attribute name="parm2" type="xsd:string"/>
<xsd:attribute name="parm3" type="xsd:string"/>
<xsd:attribute name="parm4" type="xsd:string"/>
<xsd:attribute name="parm5" type="xsd:string"/>
<xsd:attribute name="parm6" type="xsd:string"/>
<xsd:attribute name="parm7" type="xsd:string"/>
<xsd:attribute name="parm8" type="xsd:string"/>
<xsd:attribute name="parm9" type="xsd:string"/>
<xsd:attribute name="text" type="xsd:string"/>
<xsd:attribute name="category" type="xsd:string"/>
<xsd:attribute name="numParm" type="xsd:int"/>
<xsd:attribute name="number" type="xsd:int"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="ServerMessage" minOccurs="0">
<xsd:complexType>
<xsd:all>
<xsd:element name="Category" type="xsd:string"/>
<xsd:element name="Number" type="xsd:string"/>
<xsd:element name="CallSequence" type="xsd:string"/>
<xsd:element name="ProgramName" type="xsd:string"/>
<xsd:element name="Text" type="xsd:string"/>
<xsd:element name="Description" type="xsd:string"/>
<xsd:element name="Table" type="xsd:string"/>
<xsd:element name="Field" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="money">
<xsd:restriction base="xsd:decimal"/>
</xsd:simpleType>
<xsd:simpleType name="listAction">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="delete"/>
<xsd:enumeration value="add"/>
<xsd:enumeration value="update"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ouaf="http://ouaf.oracle.com/" targetNamespace="http://ouaf.oracle.com/webservices/c1/C1-AccountMail" elementFormDefault="qualified">
<xsd:import namespace="http://ouaf.oracle.com/"/>
<xsd:element name="C1-AccountMail">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="accountId" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="65536"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="results" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="premise" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="4000"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="premiseInfo" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="4000"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="action" type="ouaf:listAction"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<!-- wsdl:message elements describe potential transactions -->
<!-- request for operation C1-AccountMail -->
<wsdl:message name="C1-AccountMailRequest">
<wsdl:part name="body" element="tns:C1-AccountMail"/>
</wsdl:message>
<!-- response for operation C1-AccountMail -->
<wsdl:message name="C1-AccountMailResponse">
<wsdl:part name="body" element="tns:C1-AccountMail"/>
</wsdl:message>
<!-- fault type -->
<wsdl:message name="Fault">
<wsdl:part name="fault" element="ouaf:Fault"/>
</wsdl:message>
<!-- wsdl:portType describes messages in an operation -->
<wsdl:portType name="C1-AccountMailPortType">
<wsdl:documentation>C1-AccountMail version 1: Retrieve an Account's Mailing Address</wsdl:documentation>
<wsdl:operation name="C1-AccountMail">
<wsdl:input message="tns:C1-AccountMailRequest"/>
<wsdl:output message="tns:C1-AccountMailResponse"/>
<wsdl:fault name="fault" message="tns:Fault"/>
</wsdl:operation>
</wsdl:portType>
<!-- wsdl:binding states a serialization protocol for this service -->
<wsdl:binding name="C1-AccountMailSoapBinding" type="tns:C1-AccountMailPortType">
<wsp:PolicyReference URI="policy:Wssp1.2-2007-Https-BasicAuth.xml"/>
<!-- leverage off soap:binding document style @@@(no wsdl:foo pointing at
the soap binding) -->
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<!-- semi-opaque container of network transport details classed by
soap:binding above @@@ -->
<wsdl:operation name="C1-AccountMail">
<!-- again bind to SOAP? @@@ -->
<soap:operation soapAction="http://CIS17/webservices/C1-AccountMail#C1-AccountMail"/>
<!-- further specify that the messages in the wsdl:operation
"C1-AccountMail" use SOAP? @@@ -->
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="fault">
<soap:fault name="fault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<!-- wsdl:service names a new service "C1-AccountMailService" -->
<wsdl:service name="C1-AccountMailService">
<wsdl:documentation>C1-AccountMail version 1: Retrieve an Account's Mailing Address</wsdl:documentation>
<!-- connect it to the binding "C1-AccountMailSoapBinding" above -->
<wsdl:port name="C1-AccountMailPort" binding="tns:C1-AccountMailSoapBinding">
<!-- give the binding a network address -->
<soap:address location="http://10.1.5.95:6500/ouaf/webservices/C1-AccountMail"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Комментарии:
1. Второй wsdl неверен. У вас проблема с пространством имен. вы указали, что targetnamespace для wsdl имеет ip-адрес, заканчивающийся на 95, а часть определения схемы заканчивается на 86. Пространство имен 86 имеет префикс tns. Когда вы определили
<wsdl:input message="tns:NewOperationRequest"/>
, анализатор ищет сообщение с именем NewOperationRequest с пространством имен 86, но вы определили сообщение с пространством имен 95. изменение wsdl targetnamespace на 86 решит неправильную проблему wsdl.2. Извините, это был мой недостаток во время отправки запроса, я обновил его, но все равно получаю ту же ошибку.