Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error sending DataHandler  RSS feed

 
Dhiren Joshi
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone ,
I am requesting a datahandler froma webservice and I get an error.
This is the response I get . This is the SOAP response :
Print response value == [Header=null] [methodName=null] [targetObjectURI=null] [encodingStyleURI=null] [SOAPContext=[Parts={[cid:null type: text/xml; charset=utf-8 enc: null]}]] [fault=[Attributes={}] [faultCode=SOAP-ENV:Server] [faultString=java.lang.NullPointerException] [faultActorURI=/dapws/servlet/rpcrouter] [DetailEntries=
[(0)=<stackTrace>[SOAPException: faultCode=SOAP-ENV:Server; msg=java.lang.NullPointerException]
at org.apache.soap.providers.RPCJavaProvider.invoke(RPCJavaProvider.java:138)

Print fault = trueprint fault= [Attributes={}] [faultCode=SOAP-ENV:Server] [faultString=java.lang.NullPointerException] [faultActorURI=/dapws/servlet/rpcrouter] [DetailEntries=
[(0)=<stackTrace>[SOAPException: faultCode=SOAP-ENV:Server; msg=java.lang.NullPointerException]
at org.apache.soap.providers.RPCJavaProvider.invoke(RPCJavaProvider.java:138)
at org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:301)

If I call the same webservices for return type String it works just fine.
Print response value == [Header=null] [methodName=genericRequest] [targetObjectURI=http://tempuri.org/com.webservices.ServicesImpl] [encodingStyleURI=http://schemas.xmlsoap.org/soap/encoding/] [SOAPContext=[Parts={[cid:null type: text/xml; charset=utf-8 enc: null]}]] [return=[name=return] [type=class java.lang.String] [value=<some XML>]
Can some one tell me Why I get an error if I return a datahandler and it works if I return a String.
At the server end .. I can see the webservices exiting without any exception ..
These are the ending system outs in the webservices
<< ....
[2/13/04 16:45:03:955 CST] 7ceab658 SystemOut U Created baInputStream
[2/13/04 16:45:22:024 CST] 7ceab658 SystemOut U Created b for zipping
[2/13/04 16:45:22:025 CST] 7ceab658 SystemOut U ByteDatasource ..
[2/13/04 16:45:22:025 CST] 7ceab658 SystemOut U Created handler new DataHand
ler()
>>
And this is the actually webservice method :
public DataHandler genericRequestDataHandler(String queryString) {
String responseXml = genericRequest(queryString);
DataHandler handler = null;
try {
..
System.out.println("Created baInputStream ");
//StreamSource source = new StreamSource(reader);
byte[] b =
.Gzipper
.getCompressedByteArray(baInputStream);
System.out.println("Created b for zipping ");
ByteDataSource bds = new ByteDataSource(b, "myByteData", null);
System.out.println("ByteDatasource .. ");
handler = new DataHandler(bds);
System.out.println("Created handler new DataHandler()");
} catch (Exception e) {
e.printStackTrace(System.out);
}
return handler;
}
Thanks
Dhiren
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is probably that you haven't told the web services engine how to deserialize the DataHandler class.
 
Dhiren Joshi
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lasse,
Thanks for the response.
I have the DDS.xml file mapped correctly .
What could I have missed that identifies a web services to know how to deserialise a datahandler ..
I havent been able to figure this issue.
Thanks
Dhiren
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!