Forum Stats

  • 3,838,515 Users
  • 2,262,378 Discussions
  • 7,900,681 Comments

Discussions

JAXWS Metro-JAXB error Expecting payload with {...}Opwebmethod1

user13756783
user13756783 Member Posts: 5
edited Dec 19, 2015 7:05AM in Java Technology & XML

Hi

I deploy my java maven webservice applications in Tomcat 7.0.57 64bit , jdk 1.8.0_66 using dependencies:

<dependency><!-- forl webcontext annotation injection-->

            <groupId>javax.annotation</groupId>

            <artifactId>jsr250-api</artifactId>

            <version>1.0</version>

        </dependency>

        <dependency>

            <groupId>com.sun.xml.ws</groupId>

            <artifactId>jaxws-rt</artifactId>

            <version>2.2.10</version>

        </dependency>

        <dependency>

            <groupId>com.sun.xml.ws</groupId>

            <artifactId>jaxws-tools</artifactId>

            <version>2.2.10</version>

        </dependency>

        <dependency>

            <groupId>javax.servlet</groupId>

            <artifactId>servlet-api</artifactId>

            <version>2.5</version>

            <scope>provided</scope>

        </dependency>

for generated resources and wsdl i use

<plugin>

                <groupId>org.codehaus.mojo</groupId>

                <artifactId>jaxws-maven-plugin</artifactId>

                <version>1.10</version>

                <executions>

                    <execution>

                        <id>generate-wsdl</id>

                        <phase>generate-resources</phase>

                    </execution>

                </executions>

                <configuration>

                    <genWsdl>true</genWsdl>

                    <sei>it.xxxxx.fatcaWs.FatcaWSSIF</sei>

                </configuration>

            </plugin>

when i deploy it, i get endpoint wsdl normally via http link : http://localhost:8080/contextpath/url-pattern(sun-jaxb-xml)?wsdl

When i make a call using a jaxws  client, i get soap fault exception:

Exception in thread "main" com.sun.xml.internal.ws.fault.ServerSOAPFaultException: Client received SOAP Fault from server: No payload. Expecting payload with {http://fatcaWs.xxxxx.it/}Opwebmethod1 element Please see the server log to find more detail regarding exact cause of the failure.

    at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)

    at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:116)

    at com.sun.xml.internal.ws.client.sei.StubHandler.readResponse(StubHandler.java:238)

    at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:189)

    at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:276)

    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:104)

    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:77)

    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:147)

    at com.sun.proxy.$Proxy32.opwebmethod1(Unknown Source)

Why?

The webmethod has got a Boolean parameter and return an Object class of type Data. Data have the right requirements of Jaxb class (costructors without parameters and with parameters,set and get method, right annotation on property result ecc..)

This is my network sniffing using tcpmon utility:

GET /fatcaWs/FatcaWSSIF?wsdl HTTP/1.1

User-Agent: Java/1.8.0_25

Host: localhost

Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

Connection: keep-alive

POST /fatcaWs/FatcaWSSIF HTTP/1.1

Accept: text/xml, multipart/related

Content-Type: text/xml; charset=utf-8

SOAPAction: "http://fatcaWs.xxxx.it/FatcaWSSIF/Opwebmethod1Request"

User-Agent: JAX-WS RI 2.2.9-b130926.1035 svn-revision#5f6196f2b90e9460065a4c2f4e30e065b245e51e

Host: localhost

Connection: keep-alive

Content-Length: 211

<?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">

<S:Body><ns2:Opwebmethod1 xmlns:ns2="http://fatcaWs.xxxx.it/"><ns2:ok>true</ns2:ok></ns2:Opwebmethod1>

</S:Body></S:Envelope>

HTTP/1.1 200 OK

Server: Apache-Coyote/1.1

Content-Type: text/xml;charset=utf-8

Transfer-Encoding: chunked

Date: Fri, 18 Dec 2015 21:49:28 GMT

7ec

<?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.2.10 svn-revision#919b322c92f13ad085a933e8dd6dd35d4947364b. -->

<!-- Generated by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.10 svn-revision#919b322c92f13ad085a933e8dd6dd35d4947364b. -->

<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"

xmlns:wsp="http://www.w3.org/ns/ws-policy"

xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy"

xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"

xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

xmlns:tns="http://fatcaWs.xxxx.it/"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://fatcaWs.xxxx.it/" name="FatcaWSSIFService">

<types>

<xsd:schema>

<xsd:import namespace="http://fatcaWs.xxxx.it/" schemaLocation="http://localhost:80/fatcaWs/FatcaWSSIF?xsd=1"/>

</xsd:schema>

</types>

<message name="Opwebmethod1">

<part name="parameters" element="tns:Opwebmethod1"/>

</message>

<message name="Opwebmethod1Response">

<part name="parameters" element="tns:Opwebmethod1Response"/>

</message>

<portType name="FatcaWSSIF">

<operation name="Opwebmethod1">

<input wsam:Action="http://fatcaWs.xxxx.it/FatcaWSSIF/Opwebmethod1Request" message="tns:Opwebmethod1"/>

<output wsam:Action="http://fatcaWs.xxxx.it/FatcaWSSIF/Opwebmethod1Response" message="tns:Opwebmethod1Response"/>

</operation>

</portType>

<binding name="FatcaWSSIFPortBinding" type="tns:FatcaWSSIF">

<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>

<operation name="Opwebmethod1">

<soap:operation soapAction=""/>

<input>

<soap:body use="literal"/>

</input>

<output>

<soap:body use="literal"/>

</output>

</operation>

</binding>

<service name="FatcaWSSIFService">

<port name="FatcaWSSIFPort" binding="tns:FatcaWSSIFPortBinding">

<soap:address location="http://localhost:80/fatcaWs/FatcaWSSIF"/>

</port>

</service>

</definitions>

0

HTTP/1.1 500 Internal Server Error

Server: Apache-Coyote/1.1

Content-Type: text/xml;charset=utf-8

Transfer-Encoding: chunked

Date: Fri, 18 Dec 2015 21:49:28 GMT

Connection: close

6e

<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body>

e8

<S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope"><faultcode>S:Server</faultcode><faultstring>No payload. Expecting payload with {http://fatcaWs.xxxx.it/}Opwebmethod1 element</faultstring></S:Fault></S:Body></S:Envelope>

0

This discussion has been closed.