• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NuSoap - NullPointerException

#1
[eluser]hamiltonian[/eluser]
I am trying to call my java webservice through PHP using NuSoap and I get
Quote:ns2:Server: java.lang.NullPointerException
thrown. I use
Quote:$client->debug_str
to get the debug thread, but I can't see anything that is wrong. It also says
Quote:found root struct Fault, pos 2
...

Anybody know anything about this error?

Thanks,

#2
[eluser]Randy Casburn[/eluser]
it means you have a fundamental error at the server. It has not recognized a component in your WSDL file. Some variable or function call or the like. These errors are not at all helpful without capturing the headers. Do you use Firefox and TamperData or LiveHttpHeaders? If so, capture the return headers from the SOAP server and it will shed some more light on what it did not like.

Randy

#3
[eluser]hamiltonian[/eluser]
My request looks like:
Quote:<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1843="http://l01ra25e:8080/ESP/">
<SOAP-ENV:Body>
<getTLResponseSet >
<RequestSetTL >
<declaredValue >0</declaredValue>
<deliveryDay >0</deliveryDay>
<deliveryMonth >0</deliveryMonth>
<deliveryYear >0</deliveryYear>
<destCity >ATLANTA</destCity>
<destCountry >USA</destCountry>
<destState >GA</destState>
<destStateCity >GAATL</destStateCity>
<destZIP >30301</destZIP>
<hazmat >false</hazmat>
<miles >900</miles>
<origCity >CHICAGO</origCity>
<origCountry >USA</origCountry>
<origState >IL</origState>
<origStateCity >ILCHI</origStateCity>
<origZIP >60661</origZIP>
<pickupDay >22</pickupDay>
<pickupMonth >7</pickupMonth>
<pickupYear >2008</pickupYear>
<truckTransitDays >2</truckTransitDays>
<weight >0</weight>
</RequestSetTL>
</getTLResponseSet>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
and my response looks like:
Quote:&lt;?xml version="1.0" ?&gt;
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:Fault xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns3="http://www.w3.org/2003/05/soap-envelope">
<faultcode>ns2:Server</faultcode>
<faultstring>java.lang.NullPointerException</faultstring>\
<detail>
<ns2:exception xmlns:ns2="http://jax-ws.dev.java.net/" class="java.lang.NullPointerException" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false">
<ns2ConfusedtackTrace>
<ns2:frame class="com.sun.xml.ws.util.QNameMap" file="QNameMap.java" line="476" method="getEntry"/>
<ns2:frame class="com.sun.xml.ws.util.QNameMap" file="QNameMap.java" line="149" method="get"/>
<ns2:frame class="com.sun.xml.ws.server.sei.PayloadQNameBasedDispatcher" file="PayloadQNameBasedDispatcher.java" line="127" method="getEndpointMethodHandler"/>
<ns2:frame class="com.sun.xml.ws.server.sei.SEIInvokerTube" file="SEIInvokerTube.java" line="88" method="processRequest"/>
<ns2:frame class="com.sun.xml.ws.server.WSEndpointImpl$2" file="WSEndpointImpl.java" line="243" method="process"/>
<ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit" file="HttpAdapter.java" line="444" method="handle"/>
<ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter" file="HttpAdapter.java" line="244" method="handle"/>
<ns2:frame class="com.sun.xml.ws.transport.http.server.WSHttpHandler" file="WSHttpHandler.java" line="106" method="handleExchange"/>
<ns2:frame class="com.sun.xml.ws.transport.http.server.WSHttpHandler" file="WSHttpHandler.java" line="91" method="handle"/>
<ns2:frame class="com.sun.net.httpserver.Filter$Chain" file="Filter.java" line="65" method="doFilter"/>
<ns2:frame class="sun.net.httpserver.AuthFilter" file="AuthFilter.java" line="65" method="doFilter"/>
<ns2:frame class="com.sun.net.httpserver.Filter$Chain" file="Filter.java" line="68" method="doFilter"/>
<ns2:frame class="sun.net.httpserver.ServerImpl$Exchange$LinkHandler" file="ServerImpl.java" line="575" method="handle"/>
<ns2:frame class="com.sun.net.httpserver.Filter$Chain" file="Filter.java" line="65" method="doFilter"/>
<ns2:frame class="sun.net.httpserver.ServerImpl$Exchange" file="ServerImpl.java" line="547" method="run"/>
<ns2:frame class="java.util.concurrent.ThreadPoolExecutor$Worker" file="ThreadPoolExecutor.java" line="650" method="runTask"/>
<ns2:frame class="java.util.concurrent.ThreadPoolExecutor$Worker" file="ThreadPoolExecutor.java" line="675" method="run"/>
<ns2:frame class="java.lang.Thread" file="Thread.java" line="595" method="run"/>
</ns2ConfusedtackTrace>
</ns2:exception>
</detail>
</ns2:Fault>
</S:Body>
</S:Envelope>
Some response has been left out to not exceed maximum post length.

I notice that getTLResponseSet RequestSetTL do not have the namespaces in the request. How can I set these? I pass the namespace in the client->call() function. Is the NullPointerException thrown from jax-ws? And would disabeling com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace help? If so, where do I set this to false?

I would appreciate any help - this thing is driving me crazy!

#4
[eluser]Randy Casburn[/eluser]
you should have list of function calls exposed by this SOAP server. one of them should be a "setter" function for the var com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace that will allow you to set this to false. That will take you out of debug mode and get rid of the stack trace. Now whether that will get rid of the nullpointer exception or not I cannot tell you from what I see. But do that first and let's see.

There should be a command to run on the SOAP server that exposes all the available methods available to you. Run that.


Is this a publicly available server? Can you PM me the URL?

Randy

#5
[eluser]hamiltonian[/eluser]
The server is not publicly available...

I am nu testing by building the XML to pass to the webservice and instead I get:
"HTTP Error: socket read of headers timed out"

I am not having much luck at all...

#6
[eluser]Randy Casburn[/eluser]
Now your WSDL XML file is structured incorrectly. Are you using an XML editor? that shows you errors in your XML structure? That would be very helpful.

#7
[eluser]hamiltonian[/eluser]
So I realize my XML is constructed wrong; but how do I know what the definition should be? I am able to consume the java-webservice from java (Netbeans and JAX-WS). Is there a way to retrieve the XML that my java client is passing the webservice?

Thanks,

#8
[eluser]Randy Casburn[/eluser]
I would suggest you send you question into a java forum.

#9
[eluser]hamiltonian[/eluser]
I finally got it to work building my own XML and running the webservice in debug. It was a trial and error type approach - the issue was the namespaces.

Thank you for your help!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.