Package com.sun.identity.shared.jaxrpc
Class SOAPClient
- java.lang.Object
-
- com.sun.identity.shared.jaxrpc.SOAPClient
-
public class SOAPClient extends Object
The classSOAPClientprovides methods for SOAP and JAXRPC client to send and receive messages. The methodcall(..)will be used by SOAP client to send SOAP messages, and JAXRPC clients will useencodeMessageandsendto send JAXRPC requests. The methodencodeMessage(String functionName, Object[] args), encodes the JAXRPC data in SOAP, which can then be sent using thesend( String message, String cookies).The
SOAPClientcan 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 javaObject; else an exception is thrown.
-
-
Constructor Summary
Constructors Constructor Description SOAPClient()Constructor for applications that would like to dynamically set the SOAP endponts usingsetUrls(String[] urls)before invoking eithersend()orcall().SOAPClient(String serviceName)Constructor for services that use JAXRPC as their communication protocol.SOAPClient(String[] urls)Constructor for applications that have the list of end point URLs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamcall(String message, String lbcookie, String cookies)Performs a raw SOAP call with "message" as the SOAP data and response is returned asInputStreamMapdecodeMap(String xmlMap)StringencodeMap(String name, Map map)StringencodeMap(Map map)StringencodeMessage(String function, Object param)Returns a SOAP request compliant with JAXRPC for the provide function namefunctionthat takes the parameterparamas the only argument.StringencodeMessage(String function, Object[] params)Returns a SOAP request compliant with JAXRPC for the provide function namefunctionthat takes the parametersparamsas its arguments.Objectsend(String functionName, Object[] params, String lbcookie, String cookies)Performs a JAXRPC method call.Objectsend(String functionName, Object param, String lbcookie, String cookies)Performs a JAXRPC method call.Objectsend(String message, String lbcookie, String cookies)voidsetURL(String url)
-
-
-
Constructor Detail
-
SOAPClient
public SOAPClient() throws IOExceptionConstructor for applications that would like to dynamically set the SOAP endponts usingsetUrls(String[] urls)before invoking eithersend()orcall().- 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. TheSOAPClientwill iterate through the URLs in case of server failure.
-
-
Method Detail
-
call
public InputStream call(String message, String lbcookie, String cookies) throws Exception
Performs a raw SOAP call with "message" as the SOAP data and response is returned asInputStream- Throws:
Exception
-
send
public Object send(String functionName, Object[] params, String lbcookie, String cookies) throws Exception
Performs a JAXRPC method call. The parameterfunctionNameis the JAXRPC function to be called with parametersparams. Returns an object on success, else throws anException.- Throws:
Exception
-
send
public Object send(String functionName, Object param, String lbcookie, String cookies) throws Exception
Performs a JAXRPC method call. The parameterfunctionNameis the JAXRPC function to be called with parameterparam. Returns an object on success, else throws anException.- Throws:
Exception
-
send
public Object send(String message, String lbcookie, String cookies) throws Exception
- Throws:
Exception
-
setURL
public void setURL(String url)
-
encodeMessage
public String encodeMessage(String function, Object param)
Returns a SOAP request compliant with JAXRPC for the provide function namefunctionthat takes the parameterparamas the only argument.
-
-