SOAP Webservice call from Java gives “Object reference not set to an instance of an object”

前端 未结 1 977
孤城傲影
孤城傲影 2020-12-19 18:21

I have a requirement where I call a SOAP based web service from Java using Axis2 from eclipse. The web service code is in C#, with a BasicHttpBinding.

相关标签:
1条回答
  • 2020-12-19 18:56

    The message is from the C# web service side ("Object reference not set to an instance of an object" is basically a Java equivalent of NullPointerException) but it might be because of something you send from your Java client or maybe you don't send.

    The error usually means that you didn't send a required parameter and that the web service didn't do a proper job of validating it's input and missing parameter got to a point when caused the NullReferenceException.

    But there is only one way to be sure, and that is to troubleshoot the call.

    I suggest you use something like SoapUI to create a message and send that to the service. Once you get a succesfull call in SoapUI, make a call with the same parameters from your Java client and see what happens. When you do that, using a proxy for logging is very useful to see if the sent message is actually the expected one.

    0 讨论(0)
提交回复
热议问题