You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Glen Mazza <gl...@verizon.net> on 2007/10/22 15:25:03 UTC
Re: JAX-WS + JAXB problem - javax.xml.ws.soap.SOAPFaultException
thrown instead of custom exception
Am Montag, den 22.10.2007, 11:37 +0200 schrieb Piotr PiBis Berlowski:
> Hi,
>
> We consider this issue to be a huge blocker for a major project. When a
> user-defined exception is thrown by the server, a client receives a
> SOAPExceptionFault (with the message that belonged to the user-defined
> exception).
I'm missing something here. What is it that you are expecting the
client to receive instead--why is the above wrong? You're not expecting
a SOAP server to be sending Java exceptions to the SOAP client, right?
Glen
> CXF version is 2.0.2. You can find generated exception
> class, exception details class and relevant parts od wsdl attached to
> this message.
>
> If any more information is required, I will be more than happy to post
> it. We are really stuck with this!
>
RE: JAX-WS + JAXB problem - javax.xml.ws.soap.SOAPFaultException
thrown instead of custom exception
Posted by "Piotr W. Berlowski" <Pi...@gmail.com>.
I have placed a bug on JIRA -> https://issues.apache.org/jira/browse/CXF-1131
Piotr W. Berlowski wrote:
>
> I'll try to put it all together.
> Hmm... What category? JAXB or JAX-WS?
>
>
> bmargulies wrote:
>>
>> Someone needs to make a JIRA with all the bits and pieces in place.
>>
>
--
View this message in context: http://www.nabble.com/JAX-WS-%2B-JAXB-problem---javax.xml.ws.soap.SOAPFaultException-thrown-instead-of-custom-exception-tf4669782.html#a13363748
Sent from the cxf-user mailing list archive at Nabble.com.
RE: JAX-WS + JAXB problem - javax.xml.ws.soap.SOAPFaultException thrown instead of custom exception
Posted by Benson Margulies <bi...@basistech.com>.
We won't know until we debug it :-)! Just pick one.
> -----Original Message-----
> From: Piotr W. Berlowski [mailto:Piotr.Berlowski@gmail.com]
> Sent: Tuesday, October 23, 2007 8:29 AM
> To: cxf-user@incubator.apache.org
> Subject: RE: JAX-WS + JAXB problem -
javax.xml.ws.soap.SOAPFaultException
> thrown instead of custom exception
>
>
> I'll try to put it all together.
> Hmm... What category? JAXB or JAX-WS?
>
>
> bmargulies wrote:
> >
> > Someone needs to make a JIRA with all the bits and pieces in place.
> >
> --
> View this message in context: http://www.nabble.com/JAX-WS-%2B-JAXB-
>
problem---javax.xml.ws.soap.SOAPFaultException-thrown-instead-of-custom-
> exception-tf4669782.html#a13363084
> Sent from the cxf-user mailing list archive at Nabble.com.
RE: JAX-WS + JAXB problem - javax.xml.ws.soap.SOAPFaultException
thrown instead of custom exception
Posted by "Piotr W. Berlowski" <Pi...@gmail.com>.
I'll try to put it all together.
Hmm... What category? JAXB or JAX-WS?
bmargulies wrote:
>
> Someone needs to make a JIRA with all the bits and pieces in place.
>
--
View this message in context: http://www.nabble.com/JAX-WS-%2B-JAXB-problem---javax.xml.ws.soap.SOAPFaultException-thrown-instead-of-custom-exception-tf4669782.html#a13363084
Sent from the cxf-user mailing list archive at Nabble.com.
RE: JAX-WS + JAXB problem - javax.xml.ws.soap.SOAPFaultException
thrown instead of custom exception
Posted by "Piotr W. Berlowski" <Pi...@gmail.com>.
I'll try to put it all together.
bmargulies wrote:
>
> Someone needs to make a JIRA with all the bits and pieces in place.
>
--
View this message in context: http://www.nabble.com/JAX-WS-%2B-JAXB-problem---javax.xml.ws.soap.SOAPFaultException-thrown-instead-of-custom-exception-tf4669782.html#a13363084
Sent from the cxf-user mailing list archive at Nabble.com.
RE: JAX-WS + JAXB problem - javax.xml.ws.soap.SOAPFaultException thrown instead of custom exception
Posted by Benson Margulies <bi...@basistech.com>.
Someone needs to make a JIRA with all the bits and pieces in place.
> -----Original Message-----
> From: Piotr W. Berlowski [mailto:Piotr.Berlowski@gmail.com]
> Sent: Tuesday, October 23, 2007 8:06 AM
> To: cxf-user@incubator.apache.org
> Subject: RE: JAX-WS + JAXB problem -
javax.xml.ws.soap.SOAPFaultException
> thrown instead of custom exception
>
>
> Classes are generated from wsdl using ant that i attached to my first
post.
> Then the client is used as follows:
>
> public static void main(String args[]) throws Exception
> {
>
> if (args.length == 0)
> {
> System.out.println("please specify wsdl");
> System.exit(1);
> }
> URL wsdlURL = null;
> File wsdlFile = new File(args[0]);
> try
> {
> if (wsdlFile.exists())
> {
> wsdlURL = wsdlFile.toURL();
> }
> else
> {
> wsdlURL = new URL(args[0]);
> }
> }
> catch (MalformedURLException e)
> {
> e.printStackTrace();
> }
>
> IntegrationService ss = new IntegrationService(wsdlURL,
> SERVICE_NAME);
> Integration port = ss.getIntegrationPort();
>
> ((BindingProvider)
>
port).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,
> true);
>
> [...]
>
> WSDL location is passed on the commandline as a parameter. I use
either:
>
> file:/my/project/resource/dir/Integration.wsdl
>
> or
>
> http://localhost:8080/integration/services/Integration?wsdl
>
> both of them being the same wsdl, both of them producing the same
effect.
>
>
> bmargulies wrote:
> >
> > How did you generate your client?
> >
> >> I believe that I don't understand what you mean. What I expect is
that
> >> when I
> >> declare a custom exception in my wsdl (and thus in my interface),
and
> >> throw
> >> it on the server side in the implementation class, the client that
> > invokes
> >> a
> >> method, will get exactly that declared exception.
> >>
> >> To illustrate:
> >>
> >> I have
> >>
> >> @WebMethod...
> >> public void foo() throws MyCustomException;
> >>
> >> @WebException...
> >> class MyCustomException extends Exception
> >>
> >> And client invokes:
> >>
> >> try {
> >> ws.foo();
> >> catch (MyCustomException e) {
> >> do.failsafe();
> >> }
> >>
> >> I do expect my failsafe to work instead of client bailing out with
a
> > boom
> >> and SoapFaultException stacktrace. And I have a good reason for the
> >> expectations like that - it should work and moreover in some cases
it
> >> works
> >> fine. But there is a set of situations, where it just breaks down.
> >>
> >> My problem is, that those situations happen more or less random and
> > there
> >> is
> >> no change (that I can locate) in WSDL nor in generated classes that
> > would
> >> sanction this different behaviour.
> >>
> >> Best regards,
> >> Piotr Berlowski
> >>
> >>
> >> Glen Mazza-2 wrote:
> >> >
> >> >
> >> > I'm missing something here. What is it that you are expecting
the
> >> > client to receive instead--why is the above wrong? You're not
> > expecting
> >> > a SOAP server to be sending Java exceptions to the SOAP client,
> > right?
> >> >
> >> > Glen
> >> >
> >> >
> >> >> CXF version is 2.0.2. You can find generated exception
> >> >> class, exception details class and relevant parts od wsdl
attached
> > to
> >> >> this message.
> >> >>
> >> >> If any more information is required, I will be more than happy
to
> > post
> >> >> it. We are really stuck with this!
> >
> >
>
> --
> View this message in context: http://www.nabble.com/JAX-WS-%2B-JAXB-
>
problem---javax.xml.ws.soap.SOAPFaultException-thrown-instead-of-custom-
> exception-tf4669782.html#a13362683
> Sent from the cxf-user mailing list archive at Nabble.com.
RE: JAX-WS + JAXB problem - javax.xml.ws.soap.SOAPFaultException
thrown instead of custom exception
Posted by "Piotr W. Berlowski" <Pi...@gmail.com>.
Classes are generated from wsdl using ant that i attached to my first post.
Then the client is used as follows:
public static void main(String args[]) throws Exception
{
if (args.length == 0)
{
System.out.println("please specify wsdl");
System.exit(1);
}
URL wsdlURL = null;
File wsdlFile = new File(args[0]);
try
{
if (wsdlFile.exists())
{
wsdlURL = wsdlFile.toURL();
}
else
{
wsdlURL = new URL(args[0]);
}
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
IntegrationService ss = new IntegrationService(wsdlURL,
SERVICE_NAME);
Integration port = ss.getIntegrationPort();
((BindingProvider)
port).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,
true);
[...]
WSDL location is passed on the commandline as a parameter. I use either:
file:/my/project/resource/dir/Integration.wsdl
or
http://localhost:8080/integration/services/Integration?wsdl
both of them being the same wsdl, both of them producing the same effect.
bmargulies wrote:
>
> How did you generate your client?
>
>> I believe that I don't understand what you mean. What I expect is that
>> when I
>> declare a custom exception in my wsdl (and thus in my interface), and
>> throw
>> it on the server side in the implementation class, the client that
> invokes
>> a
>> method, will get exactly that declared exception.
>>
>> To illustrate:
>>
>> I have
>>
>> @WebMethod...
>> public void foo() throws MyCustomException;
>>
>> @WebException...
>> class MyCustomException extends Exception
>>
>> And client invokes:
>>
>> try {
>> ws.foo();
>> catch (MyCustomException e) {
>> do.failsafe();
>> }
>>
>> I do expect my failsafe to work instead of client bailing out with a
> boom
>> and SoapFaultException stacktrace. And I have a good reason for the
>> expectations like that - it should work and moreover in some cases it
>> works
>> fine. But there is a set of situations, where it just breaks down.
>>
>> My problem is, that those situations happen more or less random and
> there
>> is
>> no change (that I can locate) in WSDL nor in generated classes that
> would
>> sanction this different behaviour.
>>
>> Best regards,
>> Piotr Berlowski
>>
>>
>> Glen Mazza-2 wrote:
>> >
>> >
>> > I'm missing something here. What is it that you are expecting the
>> > client to receive instead--why is the above wrong? You're not
> expecting
>> > a SOAP server to be sending Java exceptions to the SOAP client,
> right?
>> >
>> > Glen
>> >
>> >
>> >> CXF version is 2.0.2. You can find generated exception
>> >> class, exception details class and relevant parts od wsdl attached
> to
>> >> this message.
>> >>
>> >> If any more information is required, I will be more than happy to
> post
>> >> it. We are really stuck with this!
>
>
--
View this message in context: http://www.nabble.com/JAX-WS-%2B-JAXB-problem---javax.xml.ws.soap.SOAPFaultException-thrown-instead-of-custom-exception-tf4669782.html#a13362683
Sent from the cxf-user mailing list archive at Nabble.com.
RE: JAX-WS + JAXB problem - javax.xml.ws.soap.SOAPFaultException thrown instead of custom exception
Posted by Benson Margulies <bi...@basistech.com>.
How did you generate your client?
> -----Original Message-----
> From: Piotr W. Berlowski [mailto:Piotr.Berlowski@gmail.com]
> Sent: Tuesday, October 23, 2007 6:02 AM
> To: cxf-user@incubator.apache.org
> Subject: Re: JAX-WS + JAXB problem -
javax.xml.ws.soap.SOAPFaultException
> thrown instead of custom exception
>
>
> I believe that I don't understand what you mean. What I expect is that
> when I
> declare a custom exception in my wsdl (and thus in my interface), and
> throw
> it on the server side in the implementation class, the client that
invokes
> a
> method, will get exactly that declared exception.
>
> To illustrate:
>
> I have
>
> @WebMethod...
> public void foo() throws MyCustomException;
>
> @WebException...
> class MyCustomException extends Exception
>
> And client invokes:
>
> try {
> ws.foo();
> catch (MyCustomException e) {
> do.failsafe();
> }
>
> I do expect my failsafe to work instead of client bailing out with a
boom
> and SoapFaultException stacktrace. And I have a good reason for the
> expectations like that - it should work and moreover in some cases it
> works
> fine. But there is a set of situations, where it just breaks down.
>
> My problem is, that those situations happen more or less random and
there
> is
> no change (that I can locate) in WSDL nor in generated classes that
would
> sanction this different behaviour.
>
> Best regards,
> Piotr Berlowski
>
>
> Glen Mazza-2 wrote:
> >
> >
> > I'm missing something here. What is it that you are expecting the
> > client to receive instead--why is the above wrong? You're not
expecting
> > a SOAP server to be sending Java exceptions to the SOAP client,
right?
> >
> > Glen
> >
> >
> >> CXF version is 2.0.2. You can find generated exception
> >> class, exception details class and relevant parts od wsdl attached
to
> >> this message.
> >>
> >> If any more information is required, I will be more than happy to
post
> >> it. We are really stuck with this!
> >>
> >
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/JAX-WS-%2B-JAXB-
>
problem---javax.xml.ws.soap.SOAPFaultException-thrown-instead-of-custom-
> exception-tf4669782.html#a13360841
> Sent from the cxf-user mailing list archive at Nabble.com.
Re: JAX-WS + JAXB problem - javax.xml.ws.soap.SOAPFaultException
thrown instead of custom exception
Posted by "Piotr W. Berlowski" <Pi...@gmail.com>.
I believe that I don't understand what you mean. What I expect is that when I
declare a custom exception in my wsdl (and thus in my interface), and throw
it on the server side in the implementation class, the client that invokes a
method, will get exactly that declared exception.
To illustrate:
I have
@WebMethod...
public void foo() throws MyCustomException;
@WebException...
class MyCustomException extends Exception
And client invokes:
try {
ws.foo();
catch (MyCustomException e) {
do.failsafe();
}
I do expect my failsafe to work instead of client bailing out with a boom
and SoapFaultException stacktrace. And I have a good reason for the
expectations like that - it should work and moreover in some cases it works
fine. But there is a set of situations, where it just breaks down.
My problem is, that those situations happen more or less random and there is
no change (that I can locate) in WSDL nor in generated classes that would
sanction this different behaviour.
Best regards,
Piotr Berlowski
Glen Mazza-2 wrote:
>
>
> I'm missing something here. What is it that you are expecting the
> client to receive instead--why is the above wrong? You're not expecting
> a SOAP server to be sending Java exceptions to the SOAP client, right?
>
> Glen
>
>
>> CXF version is 2.0.2. You can find generated exception
>> class, exception details class and relevant parts od wsdl attached to
>> this message.
>>
>> If any more information is required, I will be more than happy to post
>> it. We are really stuck with this!
>>
>
>
>
>
--
View this message in context: http://www.nabble.com/JAX-WS-%2B-JAXB-problem---javax.xml.ws.soap.SOAPFaultException-thrown-instead-of-custom-exception-tf4669782.html#a13360841
Sent from the cxf-user mailing list archive at Nabble.com.