4-12 Getting Started With JAX-RPC Web Services for Oracle WebLogic Server
4.4.2 Using the Stub Interface to Access Run-Time Information
Thejavax.xml.rpc.Stub interface enables you to dynamically configure the Stub instance in your Web service client file. For more information, see
http:java.sun.comjavaee5docsapijavaxxmlrpcStub.html .
For example, you can set the target service endpoint dynamically for the port Stub instance, as follows:
ComplexService service = new ComplexService_Impl args[0] + ?WSDL ; ComplexPortType port = service.getComplexServicePort;
Stubport._setPropertyStub.ENDPOINT_ADDRESS_PROPERTY, http:localhost:8010MyContextMyService;
getMaxIdleTime long
Returns the number of seconds that the conversation is allowed to remain idle before WebLogic Server
finishes it due to client inactivity. Use this method only in conversational Web services,
or those that have been annotated with the Conversation
or Conversational annotation. getCurrentIdleTime
long Gets the number of seconds since the last client
request, or since the conversations maximum idle time was reset.
Use this method only in conversational Web services, or those that have been annotated with the
Conversation or Conversational annotation.
getCallerPrincipal java.security
.Principal Returns the security principal associated with the
operation that was just invoked, assuming that basic authentication was performed.
isCallerInRoleStr ing
boolean Returns true if the authenticated principal is within
the specified security role. getService
weblogic.wsee .jws.ServiceH
andle Returns an instance of ServiceHandle, a WebLogic
Web service API, which you can query to gather additional information about the Web service, such as
the conversation ID if the Web service is conversational, the URL of the Web service, and so
on.
getLoggerString weblogic.wsee
.jws.util.Log ger
Gets an instance of the Logger class, which you can use to send messages from the Web service to a log
file. getInputHeaders
org.w3c.dom.E lement[]
Returns an array of the SOAP headers associated with the SOAP request message of the current operation
invoke. setUnderstoodInput
Headersboolean void
Indicates whether input headers should be understood.
getUnderstoodInput Headers
boolean Returns the value that was most recently set by a call
to setUnderstoodInputHeader. setOutputHeadersE
lement[] void
Specifies an array of SOAP headers that should be associated with the outgoing SOAP response message
sent back to the client application that initially invoked the current operation.
getProtocol weblogic.wsee
.jws.Protocol Returns the protocol such as HTTPS or JMS used to
invoke the current operation.
Table 4–3 Cont. Methods of JwsContext
Method Returns
Description
Programming the JWS File 4-13
For more information about developing Web service clients, see Chapter 6, Invoking
Web Services. The following table summarizes the methods of the Stub interface that you can use in
your JWS file to access run-time information about the Web service.
The following table defined the javax.xml.rpc.Stub property values that you can access from the Stub instance.
4.5 Should You Implement a Stateless Session EJB?