Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Webservice JAXWS Client not working - Seems to be issue with namespace  RSS feed

 
Vishal Cfdsingh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to create a Java WebService Client using wsimport(JAXWS). I am facing a null pointer exception in the code when invoking the webservice which is working otherwise with an Axis client.

Here's the XML which isnt working:

<xml-fragment xmlns:ns2="http://www.example.com/v1/lltt" xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<filter>ALL</filter>
<dates>
<dateFilter>ACTIVE_DATE_SINCE</dateFilter>
<startDate>2014-11-28T00:00:00.000-05:00</startDate>
</dates>
<whose>
<direct>false</direct>
<third>false</third>
</whose>
</xml-fragment>


Here's the working XML:

<xml-fragment xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<lltt:filter xmlns:lltt="http://www.example.com/v1/lltt">MATCHING</lltt:filter>
<lltt:dates xmlns:lltt="http://www.example.com/v1/lltt">
<lltt:dateFilter>AUDIT_DATE</lltt:dateFilter>
<lltt:startDate>2014-11-27T22:55:00</lltt:startDate>
</lltt:dates>
<lltt:whose xmlns:lltt="http://www.example.com/v1/lltt">
<lltt:direct>true</lltt:direct>
<lltt:third>true</lltt:third>
</lltt:whose>
</xml-fragment>



I am not sure why the code is not generating the namespace with the tags. I tried using the ObjectFactory to create the webservice Objct. But when I invoke the webservice from the port its creating a null pointer exception on the server side and generating the non working XML.

Here's my code to invoke the service. Also I am using the ObjectFactory to create the inner types

MyWebServicePortType port = getServicePort();

ObjectFactory factory = new ObjectFactory();

MyDataType type = factory.createMyDataType();

.....


port.getData(type); //Here's the null pointer exception on the server side


Can anyone please help me to understand what might be going wrong which creates the request xml that doesent work?


A lot thanks in advance

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!