wood burning stoves 2.0*
The moose likes Web Services and the fly likes NullPointer when calling XFire service using CXF client. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "NullPointer when calling XFire service using CXF client." Watch "NullPointer when calling XFire service using CXF client." New topic
Author

NullPointer when calling XFire service using CXF client.

John Janes
Greenhorn

Joined: Feb 01, 2011
Posts: 2
Hi All.

I am trying to call a working XFire set of services using a CXF client. Everything was working great until we noticed that XFire was leaving sockets in a CLOSE_WAIT state.

So I began looking for solutions for the CLOSE_WAITS and attempted subclassing the close method of the CommonsHttpMessageSender class. This however did not work and then decided to try CXF as the client to our XFire Services.

After implementing the CXF client like so:


with an interface of the following:


I get the following returned:
INFO: Creating Service {http://ats.olmis/}IOlmisManager from class olmis.ats.IOlmisManager
Feb 1, 2011 10:09:20 AM org.apache.cxf.interceptor.AbstractLoggingInterceptor log
INFO: Outbound Message
---------------------------
ID: 1
Address: http://localhost:8080/atsms/services/OlmisManager
Encoding: UTF-8
Content-Type: text/xml
Headers: {SOAPAction=[""], Accept=[*/*]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:serviceLogin xmlns:ns1="http://ats.olmis/"><arg0 xmlns="http://ats.olmis/">olmis</arg0><arg1 xmlns="http://ats.olmis/">wEtxRPd5vUNboYYRdkkkLw==</arg1></ns1:serviceLogin></soap:Body></soap:Envelope>
--------------------------------------
Feb 1, 2011 10:09:20 AM org.apache.cxf.interceptor.AbstractLoggingInterceptor log
INFO: Inbound Message
----------------------------
ID: 1
Response-Code: 200
Encoding: UTF-8
Content-Type: text/xml;charset=UTF-8
Headers: {content-type=[text/xml;charset=UTF-8], Date=[Tue, 01 Feb 2011 18:09:20 GMT], transfer-encoding=[chunked], Set-Cookie=[JSESSIONID=67C70EBCE3EB2F73C1076BE4C66A384A; Path=/atsms], Server=[Apache-Coyote/1.1]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><ns1:serviceLoginResponse xmlns:ns1="http://ws.oed.state.or.us"><ns1ut>true</ns1ut></ns1:serviceLoginResponse></soap:Body></soap:Envelope>
--------------------------------------
WsClient.callWebService(): Exception: java.lang.NullPointerException
Feb 1, 2011 10:09:21 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
INFO: Creating Service {http://ats.olmis/}IOlmisManager from class olmis.ats.IOlmisManager

If anyone can point me to what is wrong I would GREATLY appreciate it. If something else is needed, please let me know.

I'm sure it's something silly that I haven't done right.

Thanks!
John Janes
Greenhorn

Joined: Feb 01, 2011
Posts: 2
Solved the issue. It was all in the annotations of the service interface.

The fix was as follows:


As usual, it turned out to be something silly on my part.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: NullPointer when calling XFire service using CXF client.
 
Similar Threads
Need some help with BPEl invoking another service (define and pass the data from one to the other)
AXIS XML calling .Net Web Service
<Soap:Body> vs <SOAP-ENV:Body> Parser Error
how to set an attribute like SOAPAction in the Header?
SOAP Request and Response problem