You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Robert Hecht <Ro...@gmx.at> on 2010/03/02 13:04:58 UTC

[Axis] Problem with multiple error messages using the same xsd type (ADB)

Hi, 

I’m using a WSDL which defines several fault messages that use the same xsd type. If I generate server skeleton and client stubs with ADB, I can throw an exception in the server, but the client stub does not recognize the type and wraps it in a RemoteException.

The structure of the WSDL is like this:

…
<types>
                <xsd:schema …>
                                …
                                <xsd:element name=”FaultType”>
                                                …
                                </xsd:element>
                </xsd:schema>
</types>
<wsdl:message name=”Op1_fault”>
                <wsdl:part element=”tns:FaultType” name=”parameters”/>
</wsdl:message>
<wsdl:message name=”Op2_fault”>
                <wsdl:part element=”tns:FaultType” name=”parameters”/>
</wsdl:message>

<wsdl:portType name=”MyService”>
                <wsdl:operation name=”Op1”>
                                <wsdl:input message=”…”/>
                                <wsdl:output message=”…”/>
                                <wsdl:fault message=”tns:Op1_fault” name=”fault”/>
                </wsdl:operation>
                <wsdl:operation name=”Op2”>
                                <wsdl:input message=”…”/>
                                <wsdl:output message=”…”/>
                                <wsdl:fault message=”tns:Op2_fault” name=”fault”/>
                </wsdl:operation>
</wsdl:portType>
…

The problem is that the generated Stub class (in the method Op1) uses a Map where the class of the internal exception type (FaultType) is the key and the name of the external Type (e.g. Op2_fault) is the value. But in my case the internal type is always the same, so the mapping fails. Later there is a check if the generated Exception is actually declared by the method (this check fails, because the method declares Op1_fault, but an Op2_fault was actually instantiated). If not, the Exception is wrapped in a RemoteException.

Now I wrote client code that catches the Op1_fault, but not RemoteException. But this code is never called because of the problem described above.

Is there a solution for this problem (other than editing the generated code or changing the WSDL)?

Thanks in advance,
Robert

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


RE: Using ?wsdl query in Axis2 URI causes DataRetrievalException

Posted by William Walsh <WW...@curamsoftware.com>.
I found the solution to this, so in case it's helpful to anyone else:

Based on this similar issue someone else had reported in:
http://issues.apache.org/jira/browse/ODE-668

I added serializer.jar to the war file lib directory and ?wsdl seems to be working OK for us.

We already had our classpath settings correct.


William



-----Original Message-----
From: William Walsh [mailto:WWalsh@curamsoftware.com] 
Sent: Tuesday, March 23, 2010 3:32 PM
To: java-user@axis.apache.org
Subject: Using ?wsdl query in Axis2 URI causes DataRetrievalException

Hi,  

We're using Axis2 and deploying our services using the exploded format (instead of aar files) and when we use the ?wsdl query string in our URL (e.g. from the listServices page) we get the error below.  I looked through JIRA  and https://issues.apache.org/jira/browse/AXIS2-2763 seemed like the closest hit since we're using custom services.xml files.  So, I deployed the Axis2 Version service in an exploded format and aar format (aars usually causes Java 2 security errors on WebSphere for us) and still have the same error.

https://issues.apache.org/jira/browse/AXIS2-3601 shows unresolved with no further activity from the initial opening.  I'm using 1.5.1.

I've also tried setting <parameter name="useOriginalwsdl"> true </parameter> and including the wsdl file in the META-INF directory with no change in behavior.

Any ideas?

Thanks,
William


http://localhost:9082/TestModelWS2/services/Version?wsdl

Error 500: org.apache.axis2.dataretrieval.DataRetrievalException: org/apache/xml/serializer/Serializer.asContentHandler()Lorg/xml/sax/ContentHandler; 

[23/03/10 21:22:57:029 GMT] 00000017 servlet       E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception crea
ted in one of the service methods of the servlet CuramAxis2Servlet in application TestModelWebServices2. Exception created : org.apache.axis2.
dataretrieval.DataRetrievalException: org/apache/xml/serializer/Serializer.asContentHandler()Lorg/xml/sax/ContentHandler;
        at org.apache.axis2.dataretrieval.AxisDataLocatorImpl.getData(AxisDataLocatorImpl.java:85)
        at org.apache.axis2.description.AxisService.getData(AxisService.java:2808)
        at org.apache.axis2.description.AxisService.getWSDL(AxisService.java:1512)
        at org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1329)
        at org.apache.axis2.transport.http.ListingAgent.processListService(ListingAgent.java:270)
        at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:249)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1583)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:870)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
        at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
        at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3799)
        at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
        at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:930)
        at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
        at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:182)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
        at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
        at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
        at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
        at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
        at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
        at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
        at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
        at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
        at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
Caused by: java.lang.VerifyError: org/apache/xml/serializer/Serializer.asContentHandler()Lorg/xml/sax/ContentHandler;
        at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:293)
        at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:330)
        at org.apache.ws.commons.schema.XmlSchema.serialize_internal(XmlSchema.java:533)
        at org.apache.ws.commons.schema.XmlSchema.write(XmlSchema.java:473)
        at org.apache.axis2.description.AxisService2WSDL11.generateOM(AxisService2WSDL11.java:211)
        at org.apache.axis2.dataretrieval.WSDLDataLocator.outputInlineForm(WSDLDataLocator.java:131)
        at org.apache.axis2.dataretrieval.WSDLDataLocator.getData(WSDLDataLocator.java:73)
        at org.apache.axis2.dataretrieval.AxisDataLocatorImpl.getData(AxisDataLocatorImpl.java:81)
        ... 29 more


The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorized. If you are not the intended recipient, any disclosure,
copying, distribution or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful. If you are not the intended
addressee please contact the sender and dispose of this e-mail. Thank you.


The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorized. If you are not the intended recipient, any disclosure,
copying, distribution or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful. If you are not the intended
addressee please contact the sender and dispose of this e-mail. Thank you.

Using ?wsdl query in Axis2 URI causes DataRetrievalException

Posted by William Walsh <WW...@curamsoftware.com>.
Hi,  

We're using Axis2 and deploying our services using the exploded format (instead of aar files) and when we use the ?wsdl query string in our URL (e.g. from the listServices page) we get the error below.  I looked through JIRA  and https://issues.apache.org/jira/browse/AXIS2-2763 seemed like the closest hit since we're using custom services.xml files.  So, I deployed the Axis2 Version service in an exploded format and aar format (aars usually causes Java 2 security errors on WebSphere for us) and still have the same error.

https://issues.apache.org/jira/browse/AXIS2-3601 shows unresolved with no further activity from the initial opening.  I'm using 1.5.1.

I've also tried setting <parameter name="useOriginalwsdl"> true </parameter> and including the wsdl file in the META-INF directory with no change in behavior.

Any ideas?

Thanks,
William


http://localhost:9082/TestModelWS2/services/Version?wsdl

Error 500: org.apache.axis2.dataretrieval.DataRetrievalException: org/apache/xml/serializer/Serializer.asContentHandler()Lorg/xml/sax/ContentHandler; 

[23/03/10 21:22:57:029 GMT] 00000017 servlet       E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception crea
ted in one of the service methods of the servlet CuramAxis2Servlet in application TestModelWebServices2. Exception created : org.apache.axis2.
dataretrieval.DataRetrievalException: org/apache/xml/serializer/Serializer.asContentHandler()Lorg/xml/sax/ContentHandler;
        at org.apache.axis2.dataretrieval.AxisDataLocatorImpl.getData(AxisDataLocatorImpl.java:85)
        at org.apache.axis2.description.AxisService.getData(AxisService.java:2808)
        at org.apache.axis2.description.AxisService.getWSDL(AxisService.java:1512)
        at org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1329)
        at org.apache.axis2.transport.http.ListingAgent.processListService(ListingAgent.java:270)
        at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:249)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1583)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:870)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
        at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
        at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3799)
        at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
        at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:930)
        at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
        at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:182)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
        at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
        at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
        at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
        at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
        at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
        at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
        at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
        at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
        at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
Caused by: java.lang.VerifyError: org/apache/xml/serializer/Serializer.asContentHandler()Lorg/xml/sax/ContentHandler;
        at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:293)
        at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:330)
        at org.apache.ws.commons.schema.XmlSchema.serialize_internal(XmlSchema.java:533)
        at org.apache.ws.commons.schema.XmlSchema.write(XmlSchema.java:473)
        at org.apache.axis2.description.AxisService2WSDL11.generateOM(AxisService2WSDL11.java:211)
        at org.apache.axis2.dataretrieval.WSDLDataLocator.outputInlineForm(WSDLDataLocator.java:131)
        at org.apache.axis2.dataretrieval.WSDLDataLocator.getData(WSDLDataLocator.java:73)
        at org.apache.axis2.dataretrieval.AxisDataLocatorImpl.getData(AxisDataLocatorImpl.java:81)
        ... 29 more


The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorized. If you are not the intended recipient, any disclosure,
copying, distribution or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful. If you are not the intended
addressee please contact the sender and dispose of this e-mail. Thank you.

Re: [Axis] Problem with multiple error messages using the same xsd type (ADB)

Posted by Amila Suriarachchi <am...@gmail.com>.
please try with a nightly build.  I think I fixed this issue some times
back.

thanks,
Amila.

On Tue, Mar 2, 2010 at 5:34 PM, Robert Hecht <Ro...@gmx.at> wrote:

> Hi,
>
> I’m using a WSDL which defines several fault messages that use the same xsd
> type. If I generate server skeleton and client stubs with ADB, I can throw
> an exception in the server, but the client stub does not recognize the type
> and wraps it in a RemoteException.
>
> The structure of the WSDL is like this:
>
> …
> <types>
>                <xsd:schema …>
>                                …
>                                <xsd:element name=”FaultType”>
>                                                …
>                                </xsd:element>
>                </xsd:schema>
> </types>
> <wsdl:message name=”Op1_fault”>
>                <wsdl:part element=”tns:FaultType” name=”parameters”/>
> </wsdl:message>
> <wsdl:message name=”Op2_fault”>
>                <wsdl:part element=”tns:FaultType” name=”parameters”/>
> </wsdl:message>
>
> <wsdl:portType name=”MyService”>
>                <wsdl:operation name=”Op1”>
>                                <wsdl:input message=”…”/>
>                                <wsdl:output message=”…”/>
>                                <wsdl:fault message=”tns:Op1_fault”
> name=”fault”/>
>                </wsdl:operation>
>                <wsdl:operation name=”Op2”>
>                                <wsdl:input message=”…”/>
>                                <wsdl:output message=”…”/>
>                                <wsdl:fault message=”tns:Op2_fault”
> name=”fault”/>
>                </wsdl:operation>
> </wsdl:portType>
> …
>
> The problem is that the generated Stub class (in the method Op1) uses a Map
> where the class of the internal exception type (FaultType) is the key and
> the name of the external Type (e.g. Op2_fault) is the value. But in my case
> the internal type is always the same, so the mapping fails. Later there is a
> check if the generated Exception is actually declared by the method (this
> check fails, because the method declares Op1_fault, but an Op2_fault was
> actually instantiated). If not, the Exception is wrapped in a
> RemoteException.
>
> Now I wrote client code that catches the Op1_fault, but not
> RemoteException. But this code is never called because of the problem
> described above.
>
> Is there a solution for this problem (other than editing the generated code
> or changing the WSDL)?
>
> Thanks in advance,
> Robert
>
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/