This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes jax-ws handler causing exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "jax-ws handler causing exception" Watch "jax-ws handler causing exception" New topic
Author

jax-ws handler causing exception

vik ar
Ranch Hand

Joined: Jul 31, 2009
Posts: 104
Hi I have developed a jax-ws app. When I fire off a SOAP message it goes into the endpoint impl fine. However when I introduce a handler, I fire off the same SOAP and I can debug through the handleMessage() method but after it returns true it throws the exception below. It doesnt go to the endpoint impl and it doesnt go to the handlefault() method. Any ideas?

<faultcode>soapenv:Server</faultcode>
<faultstring>javax.xml.bind.UnmarshalException
- with linked exception:
[java.lang.NullPointerException]</faultstring>
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
It sounds like you do something wrong in your handler. It is difficult to tell exactly what, since you haven't included the code of the handler.
Below is the code of a JAX-WS handler that logs SOAP messages, showing how a handler can be implemented:

Try to use the above handler with your service and/or client. If you still get an exception, there is something else wrong.
Best wishes!
vik ar
Ranch Hand

Joined: Jul 31, 2009
Posts: 104
I am still getting exception with your handler. I should also mention I am using was7. Exception trace in SystemOut as follows:
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Ah, WAS... Sadly(?) I do not have any experience of WAS.
I have only tested my handler with the JAX-WS reference implementation (Metro) in GlassFish.
Best wishes!
vik ar
Ranch Hand

Joined: Jul 31, 2009
Posts: 104
Any ideas? LogicalHandler is working fine for me. Just a problem with SOAPHandler
vik ar
Ranch Hand

Joined: Jul 31, 2009
Posts: 104
i have found what is causing the exception. one of the elements in my soap has an attribute as follows: <person id="-1"/>. when i remove the attribute the message gets to the endpoint impl fine. Any ideas?
 
 
subject: jax-ws handler causing exception
 
Similar Threads
Service with handlers on JBoss. BIG Problem
Handling non numeric argument
Question on Soap Faults and Application Exceptions
JAX-WS: when input soap validation fails
What's Wrong with this simple WSDL