1

I am consuming a java web service from .Net web application and i get the mentioned exception "java.lang.NullPointerException", the .NET exception type is Sysem.ServiceModel.FaultException. I have not access to the web service code

The web service call is :

var response = tere.agregarGuia( guia );

Relevant wsdl:

<xs:complexType name="agregarGuia">
    <xs:sequence>
    <xs:element minOccurs="0" name="guia" type="xs:string"/>
    <xs:element minOccurs="0" name="autenticacion" type="tns:autenticacion"/>
    </xs:sequence>
</xs:complexType>
<xs:complexType name="autenticacion">
    <xs:sequence>
    <xs:element minOccurs="0" name="codAduana" type="xs:string"/>
    <xs:element minOccurs="0" name="firmaWSAA" type="xs:string"/>
    <xs:element minOccurs="0" name="idUsuario" type="xs:string"/>
    <xs:element minOccurs="0" name="ticketWSAA" type="xs:string"/></xs:sequence></xs:complexType>
.....
<operation name="agregarGuia" parameterOrder="agregarGuia">
    <input message="tns:serviciotereSoap_agregarGuia"/>
    <output message="tns:serviciotereSoap_agregarGuiaResponse"/>
</operation>

What could be the problem? Is there a tool that allows me to get more inside from the web service execution?

Diane
  • 428
  • 2
  • 6
  • 16
  • 1
    It's an error in the code of the java service. Contact the people in charge of that service and tell them to fix their horrible bug. – Federico Berasategui May 13 '14 at 18:36
  • @HighCore, i want to do that but first i would like to know if i can get some feedback from the web service, sadly the programmers of the service are not very colaborative kind. – Diane May 13 '14 at 18:50
  • inspect the Exception's properties while debugging to see if you can get a Stack Trace or something. Not sure how java web services work, but it's definitely an error on `their` code, not yours. If a certain piece of data is required by the service (so that their code isn't expecting it to be `null`) that should be explicitly described by the WSDL. The web service is really poorly implemented. – Federico Berasategui May 13 '14 at 18:52
  • 1
    @HighCore, After debugging sessions, logs readings and discussion with the web service provider i found the web service requires WS-Security using X.509 certificates, therefore the SOAP message sent to the server must be digitally signed. I have open a new question for this if you can help. Thanks http://stackoverflow.com/questions/23654842/consume-a-web-service-that-requiere-ws-security-from-asp-net-4-5-application – Diane May 14 '14 at 12:36
  • great!, however, requiring a certificate is no reason to throw a `NullPointerException`, which is equivalent to `NullReferenceException` in .Net. I still think the service is pooly implemented, and that if it requires a certificate it should throw a `"Certificate Required"` error or the like, NOT a NPE. – Federico Berasategui May 14 '14 at 12:51
  • @HighCore agree totaly with you. – Diane May 14 '14 at 13:15
  • 1
    @HighCore I have elaborated the answer in this thread: http://stackoverflow.com/questions/23663007/invoking-a-web-service-with-ws-security-from-net .Thanks. – Diane May 19 '14 at 01:09

0 Answers0