Skip to main content

Problem:

  • Product Name: VisiBroker for Java
  • Product Version: 7.0 and above
  • Product Component: Web Service
  • Platform/OS version: all
  • JDK/Compiler version: all supported versions

How to configure Java client to consume the BankAccountManager web service

Resolution:

You have seen the steps listed in $(VBROKERDIR)\\examples\\vbroker\\ws\\bank\\bank_cpp.html, plus some amendments described in article "Unable to deploy the BankAccountManager Web Service" 

  1. Make sure the server.wsdd has the following values listed below:
    parameter name="className" value="./AccountManager.$(ext)"

    The extension of the AccountManager is dependent on the operating system you are compiling the file. e.g. Solaris ends with .so, and .dll for Windows

  2. In the Makefile_cpp, add in -encoding_soap_only parameter.

    BankWebService_ws_s.cc: BankWebService.idl
      idl2wsc -src_suffix cc -I$(VBROKERDIR)/idl -gen_cpp_bridge -encoding_soap_only \\ BankWebService.idl

    Axis C support only SOAP encoding whereas Axis Java supports both WSI and SOAP encoding styles.
  3. Ensure $AXISCPP_DEPLOY/wsdls contains this file.

    BankWebService.AccountManagerWebServiceService.wsdl
  4. Start Server Application as follows:

    $ Server -Dvbroker.ws.connection.keepAlive=false -Dvbroker.ws.enable=true -Dvbroker.ws.listener.host=<hostname> -Dvbroker.ws.listener.port=<port number> &

    There is a defect in Axis C and Java interoperability. It is important for you to specify the vbroker.ws.connection.keepAlive property for Java client to overcome this defect.

Following the steps below to configure your Java web service client:

  1. Change the Makefile_java to add in -encoding_soap_only before building the example
    idl2wsj -gen_java_bridge -encoding_soap_only
  2. Now, run the client application as
    vbj Client http://<hostname>:<port>/BankWebService.AccountManagerWebServiceService <id>

Author: Matthew Ong

Old KB# 26843

#webservice
#VisiBroker
#Security