简体   繁体   中英

Java - Client received SOAP Fault from server: Server was unable to process request. ---> Object reference not set to an instance of an object

I am trying to make a call to SOAP Web service from my local code and see the response successfully. The same code deployed to QA environment and getting the following error:

com.sun.xml.internal.ws.fault.ServerSOAPFaultException: Client received SOAP Fault from server: Server was unable to process request. ---> Object reference not set to an instance of an object. Please see the server log to find more detail regarding exact cause of the failure. at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178) at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:116) at com.sun.xml.internal.ws.client.sei.StubHandler.readResponse(StubHandler.java:238) at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:189) at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:276) at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:104) at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:77) at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:147)

it looks like your function params are not declared as WebParams. You have to annontate these as WebParams like:

public String yourFunction(@WebParam(name = "YourObject") YourObject object){

    // Do some stuff

     return "done";
}

And your class has to be defined as a WebParam as well.

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "YourObject", propOrder = { "thingOne", "thingTwo", "thingThree"})
@XmlRootElement
public class AutoQuoteRequest {

     @XmlElement
     private String thingOne;

     @XmlElement
     private String thingTwo;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM