Несовпадение версий SOAP

В настоящее время я работаю над клиентским Java-приложением, которое вызывает веб-службу на основе Soap (v1.2). Сервис предоставляет вызов метода 'ping()' для проверки статуса сервиса (доступен ли он в данный момент или нет). После вызова метода ping () с использованием экземпляра прокси-класса я получаю java.rmi.RemoteException (400)[ISS.0088.9168] Несоответствие версии SOAP.

Следующие артефакты раскрыты здесь для вашей справки;

  1. WSDL для сервиса

Я также отследил Soap-запрос, который был отправлен от клиента к сервису из инструмента с именем TcpMon. Я также использовал другой инструмент с именем SoapUI для вызова вызова метода ping (), и он сгенерировал успешный ответ.

Soap-запрос, генерируемый приложением Java, отличается от Soap-запроса, генерируемого SoapUI, что означает конфликт версии Soap. Эти форматы запросов также раскрыты для вашего понимания.

  1. Java-приложение, сгенерированное с помощью Soap-запроса (отслеживается из TcpMon)
  2. Soap-запрос и Soap-ответ, генерируемые SoapUI

Каково было бы решение для этого?

1. WSDL для службы

<wsdl:definitions xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapjms="http://www.w3.org/2010/soapjms/" xmlns:tns="http://xxxxxxxxxx" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" name="v1" targetNamespace="http://xxxxxxxxxx">
<wsdl:types>
<pre>
<xsd:schema xmlns:tns="http://xxxxxxxxxx" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xxxxxxxxxx">
<xsd:element name="xxxxxxxxxx" type="tns:xxxxxxxxxx"/>
<xsd:element name="xxxxxxxxxx" type="tns:xxxxxxxxxx"/>
<xsd:element name="xxxxxxxxxx" type="tns:xxxxxxxxxx"/>
<xsd:element name="xxxxxxxxxx" type="tns:xxxxxxxxxx"/>
<xsd:element name="xxxxxxxxxx" type="tns:xxxxxxxxxx"/>
<xsd:element name="xxxxxxxxxx" type="tns:xxxxxxxxxx"/>
<xsd:element name="xxxxxxxxxx" type="tns:xxxxxxxxxx"/>
<xsd:element name="xxxxxxxxxx" type="tns:xxxxxxxxxx"/>
<xsd:element name="xxxxxxxxxx" type="tns:xxxxxxxxxx"/>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence>
<xsd:element name="xxxxxxxxxx" nillable="true" type="tns:xxxxxxxxxx"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence>
<xsd:element name="xxxxxxxxxx" type="tns:xxxxxxxxxx"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="xxxxxxxxxx">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="30"/>
<xsd:whiteSpace value="preserve"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence>
<xsd:element minOccurs="0" name="status" nillable="true" type="tns:xxxxxxxxxx"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence>
<xsd:element name="xxxxxxxxxx" type="xsd:int"/>
<xsd:element name="xxxxxxxxxx" type="xsd:string"/>
<xsd:element maxOccurs="unbounded" name="errors" nillable="true" type="tns:xxxxxxxxxx"/>
<xsd:element maxOccurs="unbounded" name="warnings" nillable="true" type="tns:warning"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence>
<xsd:element name="xxxxxxxxxx" type="xsd:string"/>
<xsd:element name="xxxxxxxxxx" type="xsd:string"/>
<xsd:element name="xxxxxxxxxx" type="xsd:string"/>
<xsd:element name="xxxxxxxxxx" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence>
<xsd:element name="xxxxxxxxxx" type="xsd:string"/>
<xsd:element name="xxxxxxxxxx" type="xsd:string"/>
<xsd:element name="xxxxxxxxxx" type="xsd:string"/>
<xsd:element name="xxxxxxxxxx" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" name="faults" nillable="true" type="tns:xxxxxxxxxx"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence>
<xsd:element name="xxxxxxxxxx" nillable="true" type="xsd:string"/>
<xsd:element name="xxxxxxxxxx" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence></xsd:sequence>
</xsd:complexType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="xxxxxxxxxx" nillable="true" type="tns:xxxxxxxxxx"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence>
<xsd:element name="xxxxxxxxxx" type="xsd:string"/>
<xsd:element name="xxxxxxxxxx" type="xsd:boolean"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence></xsd:sequence>
</xsd:complexType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence>
<xsd:element name="xxxxxxxxxx" nillable="true" type="xsd:boolean"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence>
<xsd:element name="xxxxxxxxxx" nillable="true" type="tns:xxxxxxxxxx"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence>
<xsd:element name="xxxxxxxxxx" type="xsd:base64Binary"/>
<xsd:element name="xxxxxxxxxx" type="tns:xxxxxxxxxx"/>
<xsd:element minOccurs="0" name="private" type="xsd:boolean"/>
<xsd:element name="xxxxxxxxxx" type="tns:xxxxxxxxxx"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="xxxxxxxxxx">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="500"/>
<xsd:whiteSpace value="preserve"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="xxxxxxxxxx">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="xxx"/>
<xsd:enumeration value="xxx"/>
<xsd:whiteSpace value="preserve"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence>
<xsd:element name="xxxxxxxxxx" nillable="true" type="tns:xxxxxxxxxx"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="xxxxxxxxxx">
<xsd:sequence>
<xsd:element name="xxxxxxxxxx" type="xsd:boolean"/>
<xsd:element minOccurs="0" name="paymentId" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="unbounded" name="errors" nillable="true" type="tns:error"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="xxxxxxxxxx">
<wsdl:part name="parameters" element="tns:xxxxxxxxxx"></wsdl:part>
</wsdl:message>
<wsdl:message name="xxxxxxxxxx">
<wsdl:part name="parameters" element="tns:xxxxxxxxxx"></wsdl:part>
</wsdl:message>
<wsdl:message name="xxxxxxxxxx">
<wsdl:part name="parameters" element="tns:xxxxxxxxxx"></wsdl:part>
</wsdl:message>
<wsdl:message name="xxxxxxxxxx">
<wsdl:part name="parameters" element="tns:xxxxxxxxxx"></wsdl:part>
</wsdl:message>
<wsdl:message name="xxxxxxxxxx">
<wsdl:part name="parameters" element="tns:xxxxxxxxxx"></wsdl:part>
</wsdl:message>
<wsdl:message name="xxxxxxxxxx">
<wsdl:part name="parameters" element="tns:xxxxxxxxxx"></wsdl:part>
</wsdl:message>
<wsdl:message name="xxxxxxxxxx">
<wsdl:part name="parameters" element="tns:xxxxxxxxxx"></wsdl:part>
</wsdl:message>
<wsdl:message name="xxxxxxxxxx">
<wsdl:part name="parameters" element="tns:xxxxxxxxxx"></wsdl:part>
</wsdl:message>
<wsdl:message name="xxxxxxxxxx">
<wsdl:part name="parameters" element="tns:xxxxxxxxxx"></wsdl:part>
</wsdl:message>
<wsdl:portType name="xxxxxxxxxx">
<wsdl:operation name="xxxxxxxxxx">
<wsdl:input message="tns:xxxxxxxxxx"></wsdl:input>
<wsdl:output message="tns:xxxxxxxxxx"></wsdl:output>
<wsdl:fault name="faults" message="tns:xxxxxxxxxx"></wsdl:fault>
</wsdl:operation>
<wsdl:operation name="xxxxxxxxxx">
<wsdl:input message="tns:xxxxxxxxxx"></wsdl:input>
<wsdl:output message="tns:xxxxxxxxxx"></wsdl:output>
<wsdl:fault name="xxxxxxxxxx" message="tns:xxxxxxxxxx"></wsdl:fault>
</wsdl:operation>
<wsdl:operation name="xxxxxxxxxx">
<wsdl:input message="tns:xxxxxxxxxx"></wsdl:input>
<wsdl:output message="tns:xxxxxxxxxx"></wsdl:output>
</wsdl:operation>
<wsdl:operation name="xxxxxxxxxx">
<wsdl:input message="tns:xxxxxxxxxx"></wsdl:input>
<wsdl:output message="tns:xxxxxxxxxx"></wsdl:output>
<wsdl:fault name="xxxxxxxxxx" message="tns:xxxxxxxxxx"></wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="xxxxxxxxxx" type="tns:xxxxxxxxxx">
<soap12:binding style="xxxxxxxxxx" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="xxxxxxxxxx">
<soap12:operation soapAction="xxxxxxxxxx" style="document"/>
<wsdl:input>
<soap12:body parts="parameters" use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body parts="parameters" use="literal"/>
</wsdl:output>
<wsdl:fault name="xxxxxxxxxx">
<soap12:fault name="xxxxxxxxxx" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="xxxxxxxxxx">
<soap12:operation soapAction="xxxxxxxxxx"/>
<wsdl:input>
<soap12:body parts="parameters" use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body parts="parameters" use="literal"/>
</wsdl:output>
<wsdl:fault name="xxxxxxxxxx">
<soap12:fault name="xxxxxxxxxx" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="ping">
<soap12:operation soapAction="xxxxxxxxxx" style="document"/>
<wsdl:input>
<soap12:body parts="parameters" use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body parts="parameters" use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="xxxxxxxxxx">
<soap12:operation soapAction="xxxxxxxxxx" style="document"/>
<wsdl:input>
<soap12:body parts="parameters" use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body parts="parameters" use="literal"/>
</wsdl:output>
<wsdl:fault name="xxxxxxxxxx">
<soap12:fault name="xxxxxxxxxx" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="xxxxxxxxxx">
<wsdl:port name="xxxxxxxxxx" binding="tns:xxxxxxxxxx">
<soap12:address location="https://xxxxxxxxxx"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

2. Java-приложение, сгенерированное с помощью Soap-запроса (отслеживается из TcpMon) [Failed]

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <ping xmlns="http://xxxxxxxxxx"/>
    </soapenv:Body>
</soapenv:Envelope>

3. Soap-запрос, сгенерированный SoapUI [Успешно]

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:dir="http://xxxxxxxxxx">
   <soap:Header/>
   <soap:Body>
      <dir:ping/>
   </soap:Body>
</soap:Envelope>

3. Soap-ответ, генерируемый SoapUI [Успешно]

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
    <soapenv:Body>
        <ser-root:pingResponse xmlns:ser-root="http://xxxxxxxxxx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <status>true</status>
        </ser-root:pingResponse>
    </soapenv:Body>
</soapenv:Envelope>

1 ответ

Решение

Измените ваш клиент, как предложено в этой ссылке. JAX WS SOAP 1.2

Другие вопросы по тегам