JAXWS service with unwrapped parameters can only be called once.
----------------------------------------------------------------
Key: AXIS2-4151
URL: https://issues.apache.org/jira/browse/AXIS2-4151
Project: Axis 2.0 (Axis2)
Issue Type: Bug
Components: jaxws
Affects Versions: 1.4.1
Environment: AXIS2 1.4.1
JAXWS RI 2.1.1
JDK 1.6 Update 10
Reporter: Thomas Reuhl
Priority: Minor
A jaxws-service using unwrapped parameters can only be called once
successfully. It
produces an error on all subsequent requests (see section Exception).
Creating the service uinsg the wrapped style works all the time.
To reproduce:
- Use wsimport of the jaxws reference implementation to produce two webservices
from the
wsdl below.
- For the one using parameter unwrapping use a customization file with the
following content:
<bindings
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
wsdlLocation="http://localhost:8085/test/WrappedTest.wsdl"
xmlns="http://java.sun.com/xml/ns/jaxws">
<enableWrapperStyle>true</enableWrapperStyle>
</bindings>
- For the not one using wrapped parameters use a customization file with the
following content:
<bindings
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
wsdlLocation="http://localhost:8085/test/WrappedTest.wsdl"
xmlns="http://java.sun.com/xml/ns/jaxws">
<enableWrapperStyle>false</enableWrapperStyle>
</bindings>
- Create an annotated impelementation.
- Deploy both jars in the servicejars directory.
WSDL
=====
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="Messages"
targetNamespace="http://services.test.tom.com"
xmlns:tns="http://services.test.tom.com"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<types>
<xs:schema
targetNamespace="http://services.test.tom.com"
xmlns="http://services.test.tom.com"
elementFormDefault="qualified">
<xs:element name="LoadMessage" type="LoadMessage"/>
<xs:complexType name="LoadMessage">
<xs:sequence>
<xs:element name="messageID"
type="xs:long"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Message" type="Message"/>
<xs:complexType name="Message">
<xs:sequence>
<xs:element name="content"
type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</types>
<message name="LoadMessageRequest">
<part name="filter" element="tns:LoadMessage"/>
</message>
<message name="LoadMessageResponse">
<part name="return" element="tns:Message"/>
</message>
<portType name="Messages">
<operation name="LoadMessage">
<input name="LoadMessageRequestPT"
message="tns:LoadMessageRequest"/>
<output name="LoadMessageResponsePT"
message="tns:LoadMessageResponse"/>
</operation>
</portType>
<binding name="MessagesBinding" type="tns:Messages">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="LoadMessage">
<soap:operation soapAction="LoadMessage"
style="document"/>
<input name="LoadMessageRequestPT">
<soap:body use="literal"/>
</input>
<output name="LoadMessageResponsePT">
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="MessagesService">
<port name="Messages" binding="tns:MessagesBinding">
<soap:address
location="http://127.0.0.1:5555/ws/wsdl:Messages"/>
</port>
</service>
</definitions>
EXCEPTION
==========
[ERROR] javax.xml.bind.UnmarshalException
- with linked exception:
[javax.xml.bind.UnmarshalException: unexpected element
(uri:"http://services.test.tom.com", local:"LoadMessage"). Expected elements
are (none)]
org.apache.axis2.AxisFault: javax.xml.bind.UnmarshalException - with linked
exception:
[javax.xml.bind.UnmarshalException: unexpected element
(uri:"http://services.test.tom.com", local:"LoadMessage"). Expected elements
are (none)]
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at
org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:220)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq
uest(HTTPTransportUtils.java:275) at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:818)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.ws.WebServiceException: javax.xml.bind.UnmarshalException
- with linked exception:
[javax.xml.bind.UnmarshalException: unexpected element
(uri:"http://services.test.tom.com", local:"LoadMessage"). Expected elements
are (none)]
at
org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:175)
at
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
at
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:128)
at
org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:217)
... 17 more
Caused by: javax.xml.bind.UnmarshalException - with linked exception:
[javax.xml.bind.UnmarshalException: unexpected element
(uri:"http://services.test.tom.com", local:"LoadMessage"). Expected elements
are (none)]
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:421)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:360)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:330)
at
org.apache.axis2.datasource.jaxb.JAXBDSContext$4.run(JAXBDSContext.java:693)
at
org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:76)
at
org.apache.axis2.datasource.jaxb.JAXBDSContext.unmarshalByElement(JAXBDSContext.java:690)
at
org.apache.axis2.datasource.jaxb.JAXBDSContext.unmarshal(JAXBDSContext.java:243)
at
org.apache.axis2.datasource.jaxb.JAXBCustomBuilder.create(JAXBCustomBuilder.java:80)
at
org.apache.axiom.om.impl.builder.StAXOMBuilder.createWithCustomBuilder(StAXOMBuilder.java:291)
at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:178)
at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:172)
at
org.apache.axiom.soap.impl.llom.SOAPBodyImpl.buildNext(SOAPBodyImpl.java:171)
at
org.apache.axiom.om.impl.llom.OMNodeImpl.getNextOMSibling(OMNodeImpl.java:141)
at
org.apache.axiom.om.impl.llom.OMElementImpl.getFirstElement(OMElementImpl.java:961)
at
org.apache.axiom.soap.impl.llom.SOAPBodyImpl.getFirstElementLocalName(SOAPBodyImpl.java:220)
at
org.apache.axiom.soap.impl.llom.SOAPBodyImpl.hasFault(SOAPBodyImpl.java:99)
at
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.hasFault(SOAPEnvelopeImpl.java:262)
at
org.apache.axis2.jaxws.message.util.MessageUtils.getMessageFromMessageContext(MessageUtils.java:177)
at
org.apache.axis2.jaxws.core.MessageContext.<init>(MessageContext.java:101)
at
org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:114)
... 17 moreCaused by: javax.xml.bind.UnmarshalException: unexpected
element (uri:"http://services.test.tom.com", local:"LoadMessage"). Expected
elements are (none)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:603)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:244)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:239)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:116)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:1009)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:446)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:427)
at
com.sun.xml.bind.v2.runtime.unmarshaller.MTOMDecorator.startElement(MTOMDecorator.java:107)
at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:275)
at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:209)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:358)
... 35 more
Caused by: javax.xml.bind.UnmarshalException: unexpected element
(uri:"http://services.test.tom.com", local:"LoadMessage"). Expected elements
are (none)
... 46 more
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]