BEA Systems, Inc.

WebLogic Server 6.1 API Reference

weblogic.soap
Class WebServiceProxy

java.lang.Object
  |
  +--weblogic.soap.WebServiceProxy

public class WebServiceProxy
extends java.lang.Object

The proxy class for the WebLogic web service client API. It is used to invoke remote web services.

Version:
6.0, 04/16/01
Author:
BEA system
Copyright © 2001 BEA Systems, Inc. All Rights Reserved.

Method Summary
 SoapMethod addMethod(java.lang.String name, SoapType returnType, SoapType[] parameters)
          creates and add a soap method to this proxy with the specified name, return type and parameters.
static WebServiceProxy createService(java.lang.String name, java.lang.String namespace, java.net.URL location)
          Creates a web service which can invoke soap methods on the specified location.
static WebServiceProxy createService(java.net.URL location)
          Creates a web service which can invoke soap methods on the specified location.
 CodecFactory getCodecFactory()
          returns the encoding/decoding factory used by this web service
 java.net.URL getLocation()
          returns the endpoint of this proxy.
 SoapMethod getMethod(java.lang.String name)
          returns the method with the given name.
 java.util.Iterator getMethods()
          returns all the methods available in this proxy.
 java.lang.String getName()
          returns the name of this service
 java.lang.String getNamespace()
          returns the namespace of the service
static WebServiceProxy getServiceAt(java.net.URL wsdlLocation)
          Creates a Web Service proxy based on the WSDL file available on the specified location.
static WebServiceProxy getServiceAt(java.net.URL wsdlLocation, CodecFactory factory, boolean verbose)
          Creates a Web Service proxy based on the WSDL file available on the specified location.
static WebServiceProxy getServiceAt(java.net.URL wsdlLocation, CodecFactory factory, boolean verbose, java.io.InputStream[] certs)
           
static WebServiceProxy getServiceAt(java.net.URL wsdlLocation, CodecFactory factory, boolean verbose, java.lang.String userName, java.lang.String password)
           
static WebServiceProxy getServiceAt(java.net.URL wsdlLocation, CodecFactory factory, boolean verbose, java.lang.String userName, java.lang.String password, java.io.InputStream[] certs)
           
static WebServiceProxy getServiceFrom(java.lang.String wsdlDoc)
          Creates a Web Service proxy based on the WSDL document specified as a string.
static WebServiceProxy getServiceFrom(java.lang.String wsdlDoc, CodecFactory factory, boolean verbose)
          Creates a Web Service proxy based on the WSDL document specified as a string.
 java.net.URL getWsdlLocation()
          returns the location of the WSDL file.
static java.lang.Object implementInterface(java.lang.Class interfaceType, WebServiceProxy proxy)
           
 void setCertificate(java.io.InputStream[] certs)
           
 void setCodecFactory(CodecFactory codec)
          sets the factory for encoding/decoding parameters and return type
 void setLocation(java.net.URL location)
          sets the endpoint of this proxy.
 void setName(java.lang.String name)
          sets the name of the service
 void setNamespace(java.lang.String namespace)
          sets the namespace of the proxy.
 void setPassword(java.lang.String password)
          sets the password for the user
 void setUserName(java.lang.String userName)
          sets the user name
 void setVerbose(boolean flag)
          sets the soap proxy verbose.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createService

public static WebServiceProxy createService(java.net.URL location)
Creates a web service which can invoke soap methods on the specified location. This method is used when WSDL is not available for the service. If WSDL is available use getServiceAt() or getServiceFrom(). The proxy returned will be empty and the user needs to call addMethod() to populate the proxy.

Parameters:
location - endpoint of the service. (service/port/soap:address-location in WSDL)
Returns:
proxy empty proxy pointing to the specified location.

createService

public static WebServiceProxy createService(java.lang.String name,
                                            java.lang.String namespace,
                                            java.net.URL location)
Creates a web service which can invoke soap methods on the specified location. This method should be used when WSDL is not available for the service. If WSDL is available use getServiceAt() or getServiceFrom(). The proxy returned will be empty and the user needs to call addMethod() to populate the proxy.

Parameters:
name - name of the proxy. typically name of the service class/interface.
namespace - namespace of the proxy. typically the package name of the service class prefixed with "java:". for eg: "java:weblogic.samples.ejb"
location - endpoint of the service. (service/port/soap:address-location in WSDL)
Returns:
empty proxy pointing to the specified location.

getServiceAt

public static WebServiceProxy getServiceAt(java.net.URL wsdlLocation)
                                    throws java.io.IOException,
                                           org.xml.sax.SAXException
Creates a Web Service proxy based on the WSDL file available on the specified location. The returned proxy contains all the methods defined in WSDL. To invoke a service method: proxy.getMethod( "foo" ).invoke( args );

Parameters:
wsdlLocation - location of the WSDL file
Returns:
web service proxy as defined in the WSDL
Throws:
java.io.IOException - failed to connect/read WSDL file
org.xml.sax.SAXException - failed to parse WSDL document

getServiceAt

public static WebServiceProxy getServiceAt(java.net.URL wsdlLocation,
                                           CodecFactory factory,
                                           boolean verbose)
                                    throws java.io.IOException,
                                           org.xml.sax.SAXException
Creates a Web Service proxy based on the WSDL file available on the specified location. The returned proxy contains all the methods defined in WSDL. To invoke a service method: proxy.getMethod( "foo" ).invoke( args );

Parameters:
wsdlLocation - location of the WSDL file
factory - CodecFactory to use. if null, default CodecFactory will be use.
verbose - true to view xml messages passed between proxy and server.
Returns:
web service proxy as defined in the WSDL
Throws:
java.io.IOException - failed to connect/read WSDL file
org.xml.sax.SAXException - failed to parse WSDL document

getServiceAt

public static WebServiceProxy getServiceAt(java.net.URL wsdlLocation,
                                           CodecFactory factory,
                                           boolean verbose,
                                           java.lang.String userName,
                                           java.lang.String password)
                                    throws java.io.IOException,
                                           org.xml.sax.SAXException

getServiceAt

public static WebServiceProxy getServiceAt(java.net.URL wsdlLocation,
                                           CodecFactory factory,
                                           boolean verbose,
                                           java.io.InputStream[] certs)
                                    throws java.io.IOException,
                                           org.xml.sax.SAXException

getServiceAt

public static WebServiceProxy getServiceAt(java.net.URL wsdlLocation,
                                           CodecFactory factory,
                                           boolean verbose,
                                           java.lang.String userName,
                                           java.lang.String password,
                                           java.io.InputStream[] certs)
                                    throws java.io.IOException,
                                           org.xml.sax.SAXException

getServiceFrom

public static WebServiceProxy getServiceFrom(java.lang.String wsdlDoc)
                                      throws java.io.IOException,
                                             org.xml.sax.SAXException
Creates a Web Service proxy based on the WSDL document specified as a string. The returned proxy contains all the methods defined in WSDL. To invoke a service method: proxy.getMethod( "foo" ).invoke( args );

Parameters:
wsdlDoc - wsdl document
Returns:
web service proxy as defined in the WSDL
Throws:
java.io.IOException - failed to connect/read WSDL file
org.xml.sax.SAXException - failed to parse WSDL document

getServiceFrom

public static WebServiceProxy getServiceFrom(java.lang.String wsdlDoc,
                                             CodecFactory factory,
                                             boolean verbose)
                                      throws java.io.IOException,
                                             org.xml.sax.SAXException
Creates a Web Service proxy based on the WSDL document specified as a string. The returned proxy contains all the methods defined in WSDL. To invoke a service method: proxy.getMethod( "foo" ).invoke( args );

Parameters:
wsdlDoc - wsdl document
factory - a CodecFactory to be used by the proxy
verbose - Output verbose information
Returns:
web service proxy as defined in the WSDL
Throws:
java.io.IOException - failed to connect/read WSDL file
org.xml.sax.SAXException - failed to parse WSDL document

addMethod

public SoapMethod addMethod(java.lang.String name,
                            SoapType returnType,
                            SoapType[] parameters)
creates and add a soap method to this proxy with the specified name, return type and parameters. this method is typically called on the empty proxies created using creatService().

Parameters:
name - name of the method
returnType - return type of the method.
parameters - parameters parameters of the method
Returns:
newly created soap method

getMethod

public SoapMethod getMethod(java.lang.String name)
                     throws java.lang.NoSuchMethodException
returns the method with the given name. Note: this method may change in the future if we support overloading.

Parameters:
name - name of the method to be retrieved.
Returns:
soap method with the given name
Throws:
java.lang.NoSuchMethodException - if there is no method with the specified name.

getMethods

public java.util.Iterator getMethods()
returns all the methods available in this proxy.

Returns:
iterator to a list of methods

getLocation

public java.net.URL getLocation()
returns the endpoint of this proxy. defined in wsdl at definition/service/port/soap:address - location

Returns:
location

setLocation

public void setLocation(java.net.URL location)
sets the endpoint of this proxy. defined in wsdl at definition/service/port/soap:address - location

Parameters:
location - endpoint where the service is hosted

getName

public java.lang.String getName()
returns the name of this service

Returns:
name of the service

setName

public void setName(java.lang.String name)
sets the name of the service

Parameters:
name - name to set

getNamespace

public java.lang.String getNamespace()
returns the namespace of the service

Returns:
namespace

setNamespace

public void setNamespace(java.lang.String namespace)
sets the namespace of the proxy. typically package name of the service interface prefixed with "java:"

Parameters:
namespace - namespace to set

getCodecFactory

public CodecFactory getCodecFactory()
returns the encoding/decoding factory used by this web service

Returns:
codec factory

setCodecFactory

public void setCodecFactory(CodecFactory codec)
sets the factory for encoding/decoding parameters and return type

Parameters:
factory - codec factory

setVerbose

public void setVerbose(boolean flag)
sets the soap proxy verbose. in verbose mode the XML messages passed between the proxy and server are printed on to the std output.

Parameters:
flag - true for verbose

getWsdlLocation

public java.net.URL getWsdlLocation()
returns the location of the WSDL file.

Returns:
wsdl location or null if the wsdl location is unknown. wsdl location will be null if this proxy is created using createXXX or getServiceFrom()

setUserName

public void setUserName(java.lang.String userName)
sets the user name

Parameters:
userName - name of the user

setPassword

public void setPassword(java.lang.String password)
sets the password for the user

Parameters:
password - password to set

setCertificate

public void setCertificate(java.io.InputStream[] certs)

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

implementInterface

public static java.lang.Object implementInterface(java.lang.Class interfaceType,
                                                  WebServiceProxy proxy)
                                           throws java.io.IOException

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs61

WebLogic classes and methods that do not appear in this reference are not public and are not supported.