Friday, July 07, 2006

Netbeans java web service with delphi consumer.

Problem : After creating a web service with netbeans 5.0 bundled with Sun Java System Application Server 8.2, and publishing it on localhost, then using the delphi BDS 2006 WSDL importer to create a delphi module, and then calling webservice methods from delphi, exceptions arise.
  • If NO message handler is included in the web service, the exception reads <>
  • If a default message handler is added to the web service (right click the web service, configure handlers, add), the exception is JAXRPC.TIE.04: Internal Server Error (JAXRPCTIE01: caught exception while handling request: java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.impl.TextImpl
Solution :
  • Make sure there is NO message handler for the webservice (remove it)
  • Right click on the webservice, go to the options, select the 'web service' page, and set 'document literal' OFF, and standard RPC ON.
  • On the Delphi side, open the WSDL-importer generated module, go to the initialization-part (below), and change the ioLiteral parameter from the RegisterInvokeOptions to ioDefault (default means : RPC-style encoding of the soap message).

0 Comments:

Post a Comment

<< Home