de.fzj.unicore.wsrflite.xfire
Class XFireClientFactory

java.lang.Object
  extended by de.fzj.unicore.wsrflite.xfire.XFireClientFactory

public class XFireClientFactory
extends Object

Helper to create web service clients using XFire

Author:
schuller

Field Summary
static String LOG_INCOMING
          configuration property for enabling client-call logging.
static String LOG_OUTGOING
          configuration property for enabling client-call logging.
protected static org.apache.log4j.Logger logger
           
protected  ReliableProxyFactory proxyMaker
           
protected  ISecurityProperties securityProperties
           
protected  org.codehaus.xfire.DefaultXFire xfire
           
 
Constructor Summary
XFireClientFactory()
           
XFireClientFactory(org.codehaus.xfire.XFire xfire)
           
 
Method Summary
protected  void configureSecurity(org.codehaus.xfire.client.Client client, ISecurityProperties sec, String uri)
           
protected  void configureSecurity(Object proxy, ISecurityProperties sec, String uri)
          customize security settings on the client proxy object
 org.codehaus.xfire.client.Client createDynamicClient(String url, ISecurityProperties sec)
          creates a dynamic client from the wsdl of the service
<T> T
createPlainWSProxy(Class<T> iFace, String url, ISecurityProperties sec)
          Create a proxy for the plain web service at the given URL, i.e. not using ws-addressing
<T> T
createProxy(Class<T> iFace, String url, org.w3.x2005.x08.addressing.EndpointReferenceType wsaEPR, ISecurityProperties sec)
          Create a proxy for the service at the given EPR
protected  List<org.codehaus.xfire.handler.Handler> getInHandlers()
          returns a list of in handlers to add to the proxy client
protected  org.codehaus.xfire.service.Service getLocalService(String url)
           
protected  List<org.codehaus.xfire.handler.Handler> getOutHandlers()
          returns a list of out handlers to add to the proxy client
protected  boolean isLocal(String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

xfire

protected final org.codehaus.xfire.DefaultXFire xfire

proxyMaker

protected final ReliableProxyFactory proxyMaker

securityProperties

protected ISecurityProperties securityProperties

LOG_INCOMING

public static final String LOG_INCOMING
configuration property for enabling client-call logging. Set to "true" to log all incoming messages (i.e. responses) on level INFO

See Also:
Constant Field Values

LOG_OUTGOING

public static final String LOG_OUTGOING
configuration property for enabling client-call logging. Set to "true" to log all outgoing messages (i.e. requests) on level INFO

See Also:
Constant Field Values
Constructor Detail

XFireClientFactory

public XFireClientFactory()

XFireClientFactory

public XFireClientFactory(org.codehaus.xfire.XFire xfire)
Method Detail

createProxy

public <T> T createProxy(Class<T> iFace,
                         String url,
                         org.w3.x2005.x08.addressing.EndpointReferenceType wsaEPR,
                         ISecurityProperties sec)
              throws Exception
Create a proxy for the service at the given EPR

Parameters:
iFace - Interface class
url - The url to contact
wsaEPR - The EPR of the Service
securityProperties -
Returns:
Throws:
Exception
See Also:
BaseWSRFClient

getOutHandlers

protected List<org.codehaus.xfire.handler.Handler> getOutHandlers()
returns a list of out handlers to add to the proxy client

Returns:

getInHandlers

protected List<org.codehaus.xfire.handler.Handler> getInHandlers()
returns a list of in handlers to add to the proxy client

Returns:

createPlainWSProxy

public <T> T createPlainWSProxy(Class<T> iFace,
                                String url,
                                ISecurityProperties sec)
                     throws MalformedURLException
Create a proxy for the plain web service at the given URL, i.e. not using ws-addressing

Parameters:
iFace -
url -
sec -
Returns:
a proxy for the service defined by the interface iFace
Throws:
MalformedURLException
Exception

isLocal

protected boolean isLocal(String url)

getLocalService

protected org.codehaus.xfire.service.Service getLocalService(String url)

configureSecurity

protected void configureSecurity(Object proxy,
                                 ISecurityProperties sec,
                                 String uri)
customize security settings on the client proxy object

Parameters:
proxy -

configureSecurity

protected void configureSecurity(org.codehaus.xfire.client.Client client,
                                 ISecurityProperties sec,
                                 String uri)
                          throws Exception
Throws:
Exception

createDynamicClient

public org.codehaus.xfire.client.Client createDynamicClient(String url,
                                                            ISecurityProperties sec)
                                                     throws Exception
creates a dynamic client from the wsdl of the service

Parameters:
serviceURL - the URL, the service can be found
sec - Security Parameters
Returns:
a Client that supports SSL Connections
Throws:
Exception


Copyright © 2010. All Rights Reserved.