Details
Description
Method invocation from client fails with NPE caused by MessagePartInfo.getSchemaType() returning null at AbstractBinding.java, line 252. Tried with both XFire 1.1.2 and 1.2-RC. It only happens when an invoked method contains arguments that go into header.
MessagePartInfo.setSchemaType(..) is invoked for the SessionInfo element (see method signature below) during client initialization, setting it to JaxbType.
Client classes are generated with xfire-maven-plugin wsgen task from WSDL file (server end runs MS dotNet 1.1), using JAXB2 bindings.
Relevant stack trade section:
-------------------------------------
java.lang.NullPointerException
at org.codehaus.xfire.service.binding.AbstractBinding.writeParameter(AbstractBinding.java:252)
at org.codehaus.xfire.service.binding.ServiceInvocationHandler.writeHeaders(ServiceInvocationHandler.java:315)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:73)
at org.codehaus.xfire.client.Client.invoke(Client.java:335)
at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy12.logout(Unknown Source)
-------------------------------------
Method signature:
-------------------------------------
@WebService(name = "MardukWSSoap", targetNamespace = "http://pivotcapital.com/Marduk/1.0")
public interface MardukWSSoap {
......
@WebMethod(operationName = "Logout", action = "http://pivotcapital.com/Marduk/1.0/Logout")
public void logout(
@WebParam(name = "SessionInfo", targetNamespace = "http://pivotcapital.com/Marduk/1.0", header = true)
com.pivotcapital.horus.marduk.xfire.schema.SessionInfo SessionInfo);
......
}
-------------------------------------
SessionInfo class:
-------------------------------------
/**
- <p>Java class for SessionInfo complex type.
- <p>The following schema fragment specifies the expected content contained within this class.
- <pre>
- <complexType name="SessionInfo">
- <complexContent>
- <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- <sequence>
- <element name="sessionId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- </sequence>
- </restriction>
- </complexContent>
- </complexType>
- </pre>
-
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SessionInfo", propOrder = {
"sessionId"
})
public class SessionInfo {
protected String sessionId;
public String getSessionId() { return sessionId; }
public void setSessionId(String value) { this.sessionId = value; }
}
-------------------------------------
This sounds like a configuration issue... Can you paste your client side configuration or how you created the client?