Class SOAPClient


  • public class SOAPClient
    extends Object
    The class SOAPClient provides methods for SOAP and JAXRPC client to send and receive messages. The method call(..) will be used by SOAP client to send SOAP messages, and JAXRPC clients will use encodeMessage and send to send JAXRPC requests. The method encodeMessage(String functionName, Object[] args), encodes the JAXRPC data in SOAP, which can then be sent using the send( String message, String cookies).

    The SOAPClient can be initialized either with known SOAP endpoint URLs or it will find an active server using Naming service. In the case of JAXRPC, the SOAP response is decoded and returns a java Object; else an exception is thrown.

    • Constructor Detail

      • SOAPClient

        public SOAPClient()
                   throws IOException
        Constructor for applications that would like to dynamically set the SOAP endponts using setUrls(String[] urls) before invoking either send() or call().
        Throws:
        IOException
      • SOAPClient

        public SOAPClient​(String serviceName)
        Constructor for services that use JAXRPC as their communication protocol. The URL end points for these services will be obtained from Naming service for jaxrpc service, and the service name will appended to it as the JAXRPC interface name.
      • SOAPClient

        public SOAPClient​(String[] urls)
        Constructor for applications that have the list of end point URLs. The SOAPClient will iterate through the URLs in case of server failure.
    • Method Detail

      • send

        public Object send​(String functionName,
                           Object[] params,
                           String lbcookie,
                           String cookies)
                    throws Exception
        Performs a JAXRPC method call. The parameter functionName is the JAXRPC function to be called with parameters params. Returns an object on success, else throws an Exception .
        Throws:
        Exception
      • send

        public Object send​(String functionName,
                           Object param,
                           String lbcookie,
                           String cookies)
                    throws Exception
        Performs a JAXRPC method call. The parameter functionName is the JAXRPC function to be called with parameter param. Returns an object on success, else throws an Exception .
        Throws:
        Exception
      • setURL

        public void setURL​(String url)
      • encodeMap

        public String encodeMap​(Map map)
      • decodeMap

        public Map decodeMap​(String xmlMap)
      • encodeMessage

        public String encodeMessage​(String function,
                                    Object param)
        Returns a SOAP request compliant with JAXRPC for the provide function name function that takes the parameter param as the only argument.
      • encodeMessage

        public String encodeMessage​(String function,
                                    Object[] params)
        Returns a SOAP request compliant with JAXRPC for the provide function name function that takes the parameters params as its arguments.