|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wm.app.b2b.client.BaseContext
com.wm.app.b2b.client.Context
public class Context
This class extends BaseContext. You use the members of this class to build clients that invoke services on a webMethods Integration Server.
Note: Services that you invoke via this class are processed synchronously and are not submitted through the webMethods guaranteed-delivery facility. To submit requests via the guaranteed-delivery facility, you must construct your client using the TContext class.
TContext
,
BaseContext
Field Summary |
---|
Fields inherited from class com.wm.app.b2b.client.BaseContext |
---|
NO_SSL, RPC_BIN, RPC_IDAT, RPC_XML, SSL_128, SSL_40 |
Constructor Summary | |
---|---|
Context()
Constructs an unconnected Context and defaults to the binary RPC data transport. |
|
Context(java.applet.Applet a)
Constructs a Context object for the specified applet and automatically connects the applet to the webMethods Integration Server. |
|
Context(int rpcType)
Constructs an unconnected Context with the specified data transportand sets the RPC transport type . |
Method Summary | |
---|---|
void |
AppletSetup(java.applet.Applet a)
Connects the specified applet to the webMethods Integration Server. |
void |
cleanUpConnection()
Ends this client's connection. |
void |
connect(java.lang.String server)
Connects this Context object to the specified webMethods Integration Server using the log-on credentials that have been established using BaseContext.setAuthentication. |
void |
connect(java.lang.String server,
java.lang.String user,
java.lang.String pass)
Connects the client to the specified webMethods Integration Server using the specified log-on credentials. |
void |
disconnect()
Disconnects this Context object from the server and flushes its session object from the server. |
IData |
invoke(NSName svcName,
IData data)
Calls the specified service as a namespace object and passes input to that service through an IData object. |
Values |
invoke(NSName svcName,
Values data)
Calls the specified service as a namespace object and passes input to that service in a Values object. |
IData |
invoke(java.lang.String ifc,
java.lang.String svc,
IData data)
Calls the specified service by name and passes input to that service in an IData object. |
Values |
invoke(java.lang.String ifc,
java.lang.String svc,
Values data)
Calls the specified service by name and passes input to that service in a Values object. |
InvokeThread |
invokeThreaded(NSName svcName,
Values data)
Spawns a thread that invokes the specified service by namespace and passes input to that service through a Values object. |
InvokeThread |
invokeThreaded(java.lang.String ifc,
java.lang.String svc,
Values data)
Spawns a thread that invokes the specified service by name and passes input to that service through a Values object. |
Methods inherited from class com.wm.app.b2b.client.BaseContext |
---|
getSSLSupport, isClusteredEnv, isConnected, isSecure, setAllowRedir, setAuthentication, setFixedUri, setProxy, setRetryServer, setSecure, setSecureProxy, setSSLCertificates, setSSLCertificates, setSSLCertificates |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Context()
public Context(int rpcType)
rpcType
- An int that specifies transport type as follows:
Set type to
|
To
|
RPC_BIN | Pass data in binary format. Use this transport if there is no transport type restriction between the client and the server (default transport type). |
RPC_XML | Pass data in XML format. Use if RPC type limited to XML. Use this transport when the binary transport type cannot be used due to a firewall or proxy restriction. |
RPC_IDATA | Pass data in IData format.Use if client-to-server implemention uses IData objects. |
public Context(java.applet.Applet a) throws ServiceException
When you use this constructor, Context automatically connects to the server identified by the following named parameters in the applet. (These parameters must be specified in the applet using the appropriate Applet <PARAM> tags before you instantiate Context.) Instantiates a new Context and specifies that the client runs as an applet . The Context automatically connects to the server specified by applet <PARAM> tags. Applet clients that are NOT using this constructor will produce a network security exception.
Valid <PARAM> attributes are:
<PARAM> |
Description |
SERVER | The name of the Integration Server Server endpoint in the formhostname:portNumber |
SERVERUSER | The user name that Context will use to connect to the target server. |
SERVERPASS | The password that Context will use to connect to the target server.User's password |
SECURE | The boolean value, true or false, specifying whether Context will connect using HTTPS or HTTP, respectively. |
DEBUG | An int value from 0 to 10 that specifies debug level. |
FIXEDURI | The Uniform Resource Identifier (URI) that specifies the CGI script that will pass requests to the webMethods Integration Server. Used when the Integration Server resides behind a web server that submits requests to it via a CGI script. |
a
- The Aapplet that is to be connected to the Integration Server.
ServiceException
- If a connection to the Integration Server cannot be established. This can occur if the server is unavailable, a connection to the server already exists or one or more connection parameters are specified incorrectly.Method Detail |
---|
public void AppletSetup(java.applet.Applet a) throws ServiceException
When you use this method, a connection to the Integration Server is established based on the following named parameters in the applet. (These parameters must be specified in the applet using the appropriate Applet <PARAM> tags before you instantiate Context.)
Valid <PARAM> attributes are:<PARAM> |
Description |
SERVER | The name of the Integration Server Server endpoint in the formhostname:portNumber |
SERVERUSER | The user name that Context will use to connect to the target server. |
SERVERPASS | The password that Context will use to connect to the target server.User's password |
SECURE | The boolean value, true or false, specifying whether Context will connect using HTTPS or HTTP, respectively. |
DEBUG | An int value from 0 to 10 that specifies debug level. |
FIXEDURI | The Uniform Resource Identifier (URI) that specifies the CGI script that will pass requests to the Integration Server. Used when the Integration Server resides behind a web server that submits requests to it via a CGI script. |
a
- The Aapplet that is to be connected to the Integration Server.
ServiceException
- If a connection to the Integration Server cannot be established. This occurs if the server is unavailable, a connection to the server already exists or one or more connection parameters are specified incorrectly.BaseContext.setFixedUri(String)
,
BaseContext.setSecure(boolean)
,
BaseContext.setProxy(java.lang.String, java.lang.String, java.lang.String)
public void connect(java.lang.String server) throws ServiceException
When a client connects to a server, the server builds a session object for that client, which it maintains until the client disconnects or expires (a client expires if the server does not receive a request from it within a specified time.) Your client does not need to take any special steps to prevent a session from expiring, because as soon as you connect to a server using this method, your Context object automatically pings the server at regular intervals to keep its session alive.
server
- A String specifying the server's address in the form hostname:portNumber.
ServiceException
- If a connection to the server cannot be established. This can occur if the server is unavailable, a connection to the server already exists, or the server address was specified incorrectly.public void connect(java.lang.String server, java.lang.String user, java.lang.String pass) throws ServiceException
When a client connects to a server, the server builds a session object for that client, which it maintains until the client disconnects or expires (a client expires if the server does not receive a request from it within a specified time.) You do not need to take any special steps to prevent a session from expiring, because as soon as you connect to a server using this method, your Context object automatically pings the server at regular intervals to keep its session alive.
server
- A String specifying the server's address in the form hostname:portNumber.user
- A String specifying the user name that is to be used to connect to the Integration Sever.pass
- A String specifying the password that is to be used to connect to the Integration Sever.
ServiceException
- If a connection to the server cannot be established. This occurs if the server is unavailable, a connection to the server already exists, the server address was specified incorrectly, or the connection credentials are invalid.public void disconnect()
This method invokes wm.server:disconnect, which clears the client's session object on the server. If for some reason, this request cannot be executed by the server, the connection still ends on the client side. (On the server side, the session will ultimately expire on it own.)
cleanUpConnection()
public void cleanUpConnection()
disconnect()
public IData invoke(NSName svcName, IData data) throws ServiceException
Note: You must use the connect method to connect Context to a webMethods Integration Server before calling this method. If Context has not been connected to a server, a ServiceException will be thrown.
svcName
- An NSName object specifying the service that you want to execute.data
- An IData object containing the input data for the service.
ServiceException
- If the specified service cannot be executed. This can happen if this Context is not connected to a server, the target server cannot be reached, or if the specified service cannot be located.invoke(NSName, Values)
,
invoke(String, String, IData)
,
connect(String)
,
disconnect()
public Values invoke(NSName svcName, Values data) throws ServiceException
Note: You must use the connect method to connect Context to a webMethods Integration Server before calling this method. If Context has not been connected to a server, a ServiceException will be thrown.
svcName
- An NSName object specifying the service that you want to execute.data
- An Values object containing the input data for the service.
ServiceException
- If the specified service cannot be executed. This can happen if this Context is not connected to a server, the target server cannot be reached, or if the specified service cannot be located.invoke(NSName, IData)
,
invoke(String, String, IData)
,
connect(String)
,
disconnect()
public IData invoke(java.lang.String ifc, java.lang.String svc, IData data) throws ServiceException
ifc
- A String specifying the name of the folder in which the service resides.svc
- A String specifying the name of the service.data
- An IData object containing the input data for the service.
ServiceException
- If the specified service cannot be executed. This can happen if this Context is not connected to a server, the target server cannot be reached, or if the specified service cannot be located.invoke(NSName, Values)
,
invoke(NSName, IData)
,
connect(String)
public Values invoke(java.lang.String ifc, java.lang.String svc, Values data) throws ServiceException
ifc
- A String specifying the name of the folder in which the service resides.svc
- A String specifying the name of the service.data
- A Values object containing the input data for the service.
ServiceException
- If the specified service cannot be executed. This can happen if this Context is not connected to a server, the target server cannot be reached, or if the specified service cannot be located.invoke(NSName, Values)
,
connect(String)
public InvokeThread invokeThreaded(NSName svcName, Values data)
svcName
- An NSName object specifying the service that you want to execute.data
- An IData object containing the input data for the service.
InvokeThread
,
InvokeThread.getData()
,
invoke(NSName, IData)
,
invoke(NSName, Values)
,
invoke(String, String, IData)
public InvokeThread invokeThreaded(java.lang.String ifc, java.lang.String svc, Values data)
ifc
- A String specifying the name of the folder in which the service resides.svc
- A String specifying the name of the service.data
- A Values object containing the input data for the service.
InvokeThread
,
InvokeThread.getData()
,
invoke(NSName, IData)
,
invoke(NSName, Values)
,
invoke(String, String, IData)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |