Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jax-ws handler causing exception

 
vik ar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any ideas? LogicalHandler is working fine for me. Just a problem with SOAPHandler
 
vik ar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic