org.andromda.cartridges.support.webservice.client
Class WebServiceClient

java.lang.Object
  extended by org.andromda.cartridges.support.webservice.client.WebServiceClient

public class WebServiceClient
extends Object

A webservice client using Axis2 libraries that allows you to invoke operations on wrapped style services.

Author:
Chad Brandon

Constructor Summary
WebServiceClient(String wsdlUrl, Class serviceClass)
          Constructs a new client taking a WSDL and serviceClass
WebServiceClient(String wsdlUrl, Class serviceClass, String username, String password)
          Constructs a new client taking a WSDL, the serviceClass and username and password.
WebServiceClient(String wsdlUrl, String endpointAddress, Class serviceClass, String username, String password)
          Constructs a new client taking a WSDL, endpointAddress, serviceClass and username and password.
 
Method Summary
 void cleanup()
          Reclaims any resources used by the client.
 Object invokeBlocking(String operationName, Object[] arguments)
          Invokes the operation identified by the given operationName with the given arguments.
 void invokeNonBlocking(String operationName, Object[] arguments, org.apache.axis2.client.async.Callback callback)
          Invoke the nonblocking/Asynchronous call
 void invokeRobust(String operationName, Object[] arguments)
           
 void setTimeout(long seconds)
          Sets the timeout in seconds.
 void setTypeMapper(TypeMapper typeMapper)
          Sets the optional object creator implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebServiceClient

public WebServiceClient(String wsdlUrl,
                        Class serviceClass)
Constructs a new client taking a WSDL and serviceClass

Parameters:
wsdlUrl - the URL to the WSDL for the service.
serviceClass - the class used for communicating with the service (i.e. can be a regular java object).

WebServiceClient

public WebServiceClient(String wsdlUrl,
                        Class serviceClass,
                        String username,
                        String password)
Constructs a new client taking a WSDL, the serviceClass and username and password.

Parameters:
wsdlUrl - the URL to the WSDL for the service.
serviceClass - the class used for communicating with the service (i.e. can be a regular java object).
username - the username to access to the service (if its protected by basic auth).
password - the password to access the service (if its protected by basic auth).

WebServiceClient

public WebServiceClient(String wsdlUrl,
                        String endpointAddress,
                        Class serviceClass,
                        String username,
                        String password)
Constructs a new client taking a WSDL, endpointAddress, serviceClass and username and password.

Parameters:
wsdlUrl - the URL to the WSDL for the service.
endpointAddress - the "end point" or "port" address of the service (if null, then the one in the WSDL will be used).
serviceClass - the class used for communicating with the service (i.e. can be a regular java object).
username - the username to access to the service (if its protected by basic auth).
password - the password to access the service (if its protected by basic auth).
Method Detail

setTypeMapper

public void setTypeMapper(TypeMapper typeMapper)
Sets the optional object creator implementation.

Parameters:
typeMapper - the type mapper used for mapping types.

setTimeout

public void setTimeout(long seconds)
Sets the timeout in seconds.

Parameters:
seconds -

invokeBlocking

public Object invokeBlocking(String operationName,
                             Object[] arguments)
Invokes the operation identified by the given operationName with the given arguments.

Parameters:
operationName - the name of the operation to invoke.
arguments - the arguments of the operation.
Returns:
invoke result
See Also:
Axis2ClientUtils.deserialize(OMElement, Class, TypeMapper)

invokeNonBlocking

public void invokeNonBlocking(String operationName,
                              Object[] arguments,
                              org.apache.axis2.client.async.Callback callback)
Invoke the nonblocking/Asynchronous call

Parameters:
operationName -
arguments -
callback -

invokeRobust

public void invokeRobust(String operationName,
                         Object[] arguments)
Parameters:
operationName -
arguments -

cleanup

public void cleanup()
Reclaims any resources used by the client.



Copyright © 2003-2012 AndroMDA.org. All Rights Reserved.