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.