| java.lang.Object org.directwebremoting.proxy.io.Context jsx3.lang.Object jsx3.net.Service
Service | public class Service extends jsx3.lang.Object (Code) | | This class is used in conjunction with the XML Mapping Utility to provide transactional support for those services using XML-based messaging.
Support includes those services defined via Schema, XML, XHTML, and WSDL (SOAP). In practice a developer would open General InterfaceŞ Builder
to access the XML Mapping Utility. They would then point the utility at a "pattern master" (i.e., WSDL, Schema, XML, etc) and begin using its
visual tools to bind application objects to nodes in the XML messages to be sent and received.
The output from the Mapping Utility is referred to as a mapping rule set. This rule set is an XML document based upon the Common Exchange Format (CXF)
and defines the information necessary to support transactional data mapping. Many of the APIs available to the Service class allow the devloper to
dynamically update various static values that were set using the XML Mapping Utility.
author: Joe Walker [joe at getahead dot org] author: DRAPGEN - Dwr Reverse Ajax Proxy GENerator |
Field Summary | |
final public static String | ON_ERROR | final public static String | ON_INVALID Event type published each time a rule with one or more restrictions fails during message generation. | final public static String | ON_PROCESS_RULE Event type published each time a mapping rule is used to create a node, locate a node, or map to a node.
target this jsx3.net.Service instance
rule the rule node being processed
action the action being performed by the rule. | final public static String | ON_SUCCESS | final public static String | ON_TIMEOUT Event type published when the response is still not ready after the specified timeout period. |
Constructor Summary | |
public | Service(Context context, String extension, ScriptProxy scriptProxy) | public | Service(String strRulesURL, String strOperationName, String strOutboundURL, String strInboundURL) instance initializer
Parameters: strRulesURL - The resolved URI for the rules document (a CXF document).Note: since this class is lazily loaded as of v3.2, the preferred method of instantiating this class is by calling the loadResource method on the context server (jsx3.app.Server ) instance. |
Method Summary | |
public jsx3.xml.CdfDocument | compile() Compiles the CXF rules for this service instance to an equivalent XSLT document. | public T | compile(Class<T> returnType) Compiles the CXF rules for this service instance to an equivalent XSLT document. | public void | doCall(boolean bCancelIfInvalid, org.directwebremoting.proxy.Callback<Boolean> callback) Generates the request message (if applicable) and sends to the remote service. | public void | doInboundMap() Applies all inbound mappings, using the server response document as the source for the operation. | public void | getEndpointURL(org.directwebremoting.proxy.Callback<String> callback) | public jsx3.xml.CdfDocument | getInboundDocument() | public T | getInboundDocument(Class<T> returnType) | public void | getInboundURL(org.directwebremoting.proxy.Callback<String> callback) Gets the URL for a "typical", XML-formatted server resonse document. | public void | getMethod(org.directwebremoting.proxy.Callback<String> callback) Gets the method for the request. | public void | getMode(org.directwebremoting.proxy.Callback<Boolean> callback) Gets the mode (static jsx3.Boolean.FALSE or live jsx3.Boolean.TRUE). | public void | getNamespace(org.directwebremoting.proxy.Callback<String> callback) Gets the namespace for the server/project to run the service instance within. | public void | getOperationName(org.directwebremoting.proxy.Callback<String> callback) Gets the name of the operation to use within a multi-operation rules file. | public jsx3.xml.CdfDocument | getOutboundDocument() | public T | getOutboundDocument(Class<T> returnType) | public void | getOutboundStubPath(org.directwebremoting.proxy.Callback<String> callback) Gets XPath address for the node in the outbound stub document to which to append the generated message. | public void | getOutboundStubURL(org.directwebremoting.proxy.Callback<String> callback) | public void | getOutboundURL(org.directwebremoting.proxy.Callback<String> callback) Gets URL for a 'typical' XML-formatted request document to send to the server; when this is set, the mapper does not even attempt to generate a document. | public jsx3.net.Request | getRequest() Gets the jsx3.net.HttpRequest instance that performs the transaction with the remote service (the transport object for the message). | public void | getRulesURL(org.directwebremoting.proxy.Callback<String> callback) Gets the URL for the rules file to use (a CXF document). | public jsx3.xml.CdfDocument | getRulesXML() | public T | getRulesXML(Class<T> returnType) | public jsx3.app.Server | getServer() Returns the server that this service runs in, as set by the setNamespace() method. | public jsx3.xml.CdfDocument | getServiceMessage(String MESSAGETYPE, String strShellURL) Gets the request message specific to the MESSAGETYPE (input, output, fault). | public T | getServiceMessage(String MESSAGETYPE, String strShellURL, Class<T> returnType) Gets the request message specific to the MESSAGETYPE (input, output, fault). | public void | getStatus(org.directwebremoting.proxy.Callback<Integer> callback) Gets the HTTP response code (i.e., 200, 404, 500, etc). | public void | getSupportedNamespaces(org.directwebremoting.proxy.Callback<String> callback) Returns a CR-LF delimited list of supported namespaces and thei related prefix (as defined by the Object, jsx3.net.Service.ns). | public void | getUserName(org.directwebremoting.proxy.Callback<String> callback) | public void | getUserPass(org.directwebremoting.proxy.Callback<String> callback) | public void | publish(jsx3.lang.Object objEvent, org.directwebremoting.proxy.Callback<Integer> callback) Publishes an event to all subscribed objects. | public jsx3.net.Service | resetRules() | public jsx3.net.Service | resetRulesTree() | public jsx3.net.Service | setEndpointURL(String strAlternateURL) Sets the URL for the service endpoint where the request will be sent. | public void | setInboundDocument(jsx3.xml.CdfDocument objXML) | public jsx3.net.Service | setInboundURL(String strInboundURL) Sets the URL for a "typical", XML-formatted server resonse document. | public void | setMethod(String METHOD) Sets the method for the request different than the one described in the rules file. | public void | setMode(Boolean MODE) Sets the mode (static jsx3.Boolean.FALSE or live jsx3.Boolean.TRUE). | public jsx3.net.Service | setNamespace(jsx3.app.Server namespace) Sets the namespace for the server/project to run the service instance within.
Parameters: namespace - the server (preferred) or the namespace of the server. | public jsx3.net.Service | setNamespace(String namespace) Sets the namespace for the server/project to run the service instance within.
Parameters: namespace - the server (preferred) or the namespace of the server. | public jsx3.net.Service | setOperationName(String strOperationName) Sets the name of the operation to use within a multi-operation rules file. | public jsx3.net.Service | setOutboundStubDocument(jsx3.xml.CdfDocument objDocument) Sets the document that will serve as the container for the message generated by doCall and/or getServiceMessage.
This is a useful way to dynamically assemble documents by chaining multiple service instances, using the output from one service as the input to another.
For example, when a SOAP Envelope requires both a SOAP Header as well as a SOAP Body, this method allows the Envelope to be assembled via a
two-step process of first adding mapped content to the Body, followed by a call to add mapped content to the Header.
Note that this method takes precedence over the static stub document url referenced in the rules file as well as
any call to setOutboundStubURL. | public jsx3.net.Service | setOutboundStubPath(String strPath) Sets XPath address for the node in the outbound stub document to which to append the generated message.
Overrides the static setting in the rules file.
Parameters: strPath - Valid XSL path. | public jsx3.net.Service | setOutboundStubURL(String strURL) Sets the URL to the document that will serve as the container for the message generated by doCall and/or getServiceMessage.
Overrides the static setting stored in the rules file. | public jsx3.net.Service | setOutboundURL(String strOutboundURL) Sets the URL for a static XML-formatted request document to send to the Service. | public void | setRequestHeader(String strName, String strValue) Sets an HTTP Request header on the request. | public jsx3.net.Service | setRulesURL(String strRulesURL) Sets the URL for the rules file to use (a CXF document). | public void | setStatus(int intStatus) Sets the HTTP response code (i.e., 200, 404, 500, etc). | public jsx3.net.Service | setTimeout(int intTimeout, jsx3.lang.Object objHandler, String objFunction) Specifies how long to wait for the service to respond before cancelling the call. | public jsx3.net.Service | setTimeout(int intTimeout, org.directwebremoting.proxy.CodeBlock objHandler, org.directwebremoting.proxy.CodeBlock objFunction) Specifies how long to wait for the service to respond before cancelling the call. | public jsx3.net.Service | setTimeout(int intTimeout, String objHandler, org.directwebremoting.proxy.CodeBlock objFunction) Specifies how long to wait for the service to respond before cancelling the call. | public jsx3.net.Service | setTimeout(int intTimeout, org.directwebremoting.proxy.CodeBlock objHandler, String objFunction) Specifies how long to wait for the service to respond before cancelling the call. | public jsx3.net.Service | setTimeout(int intTimeout, jsx3.lang.Object objHandler, org.directwebremoting.proxy.CodeBlock objFunction) Specifies how long to wait for the service to respond before cancelling the call. | public jsx3.net.Service | setTimeout(int intTimeout, String objHandler, String objFunction) Specifies how long to wait for the service to respond before cancelling the call. | public jsx3.net.Service | setUserName(String strName) | public jsx3.net.Service | setUserPass(String strPass) | public void | subscribe(Object[] strEventId, jsx3.lang.Object objHandler, org.directwebremoting.proxy.CodeBlock objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(String strEventId, String objHandler, String objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(String strEventId, String objHandler, org.directwebremoting.proxy.CodeBlock objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(Object[] strEventId, String objHandler, String objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(Object[] strEventId, jsx3.lang.Object objHandler, String objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(Object[] strEventId, org.directwebremoting.proxy.CodeBlock objHandler, org.directwebremoting.proxy.CodeBlock objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(String strEventId, jsx3.lang.Object objHandler, String objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(Object[] strEventId, org.directwebremoting.proxy.CodeBlock objHandler, String objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(Object[] strEventId, String objHandler, org.directwebremoting.proxy.CodeBlock objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(String strEventId, jsx3.lang.Object objHandler, org.directwebremoting.proxy.CodeBlock objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(String strEventId, org.directwebremoting.proxy.CodeBlock objHandler, String objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | subscribe(String strEventId, org.directwebremoting.proxy.CodeBlock objHandler, org.directwebremoting.proxy.CodeBlock objFunction) Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. | public void | unsubscribe(String strEventId, jsx3.lang.Object objHandler) Unsubscribe an object or function from an event published by this object. | public void | unsubscribe(Object[] strEventId, jsx3.lang.Object objHandler) Unsubscribe an object or function from an event published by this object. | public void | unsubscribe(String strEventId, org.directwebremoting.proxy.CodeBlock objHandler) Unsubscribe an object or function from an event published by this object. | public void | unsubscribe(String strEventId, String objHandler) Unsubscribe an object or function from an event published by this object. | public void | unsubscribe(Object[] strEventId, String objHandler) Unsubscribe an object or function from an event published by this object. | public void | unsubscribe(Object[] strEventId, org.directwebremoting.proxy.CodeBlock objHandler) Unsubscribe an object or function from an event published by this object. | public void | unsubscribeAll(String strEventId) Unsubscribes all subscribed objects to a type of event published by this object. |
ON_ERROR | final public static String ON_ERROR(Code) | | event type for unsuccessful response
|
ON_INVALID | final public static String ON_INVALID(Code) | | Event type published each time a rule with one or more restrictions fails during message generation. The following named properties are available on the event object:
rule the rule node
message the message node
target this jsx3.net.Service instance
type the type of restriction that caused the invalidation event to be publsihed. For example, pattern.
value the value for the type. For example if type is pattern, then [A-Z]*
|
ON_PROCESS_RULE | final public static String ON_PROCESS_RULE(Code) | | Event type published each time a mapping rule is used to create a node, locate a node, or map to a node.
target this jsx3.net.Service instance
rule the rule node being processed
action the action being performed by the rule. For example, Create Node, Map to Cache, Invalidate Node, etc.
description a description of the 'action'. For example, this.eval(setValue(2));
level the log level (e.g., 'severity' level) for the message. For example, 6 would signify a 'Trace' level event.
|
ON_SUCCESS | final public static String ON_SUCCESS(Code) | | event type for successful response
|
ON_TIMEOUT | final public static String ON_TIMEOUT(Code) | | Event type published when the response is still not ready after the specified timeout period.
|
Service | public Service(Context context, String extension, ScriptProxy scriptProxy)(Code) | | All reverse ajax proxies need context to work from
Parameters: scriptProxy - The place we are writing scripts to Parameters: context - The script that got us to where we are now |
Service | public Service(String strRulesURL, String strOperationName, String strOutboundURL, String strInboundURL)(Code) | | instance initializer
Parameters: strRulesURL - The resolved URI for the rules document (a CXF document).Note: since this class is lazily loaded as of v3.2, the preferred method of instantiating this class is by calling the loadResource method on the context server (jsx3.app.Server ) instance. This ensures proper URL resolution while also establishing theappropriate server context. Parameters: strOperationName - name of operation to call. This is only required if the rules file was generated via a WSDL. Parameters: strOutboundURL - address of a sample outbound message to use as opposed to the one generated by the tool Parameters: strInboundURL - when the project is run in static mode (as defined by the 'project deployment options' dialog),this document is used to simulate a typical server response |
compile | public jsx3.xml.CdfDocument compile()(Code) | | Compiles the CXF rules for this service instance to an equivalent XSLT document. This enables
much faster performance than using the DOM-based iterator (default) to convert the XML response
document into a CDF Document type. Note that this process only supports the map types
CDF Document, CDF Record, and CDF Attribute. Only one CDF Document
can be declared per Operation. Otherwise the compilation will fail.
All other mapping types will be ignored and will not be converted into an XSLT equivalent. Also note
that the order of a set of sibling mapping rules does not proscribe proper processing by way of
sequence. This means that any order of sibling mapping rules will result in appropriate processing, regardless of the
sibling node order returned from the given service. This facilitates nested record structures in that
attributes can first be applied to a given record before child elements (e.g., a 'record') are added.
Stated otherwise, any rule that has a descendant rule that would created a nested 'record' node should follow
all sibling mapping rules that would create an 'attribute' entity. Call this method immediately before/after doCall
for best performance.
XSLT document |
compile | public T compile(Class<T> returnType)(Code) | | Compiles the CXF rules for this service instance to an equivalent XSLT document. This enables
much faster performance than using the DOM-based iterator (default) to convert the XML response
document into a CDF Document type. Note that this process only supports the map types
CDF Document, CDF Record, and CDF Attribute. Only one CDF Document
can be declared per Operation. Otherwise the compilation will fail.
All other mapping types will be ignored and will not be converted into an XSLT equivalent. Also note
that the order of a set of sibling mapping rules does not proscribe proper processing by way of
sequence. This means that any order of sibling mapping rules will result in appropriate processing, regardless of the
sibling node order returned from the given service. This facilitates nested record structures in that
attributes can first be applied to a given record before child elements (e.g., a 'record') are added.
Stated otherwise, any rule that has a descendant rule that would created a nested 'record' node should follow
all sibling mapping rules that would create an 'attribute' entity. Call this method immediately before/after doCall
for best performance.
Parameters: returnType - The expected return type XSLT document |
doCall | public void doCall(boolean bCancelIfInvalid, org.directwebremoting.proxy.Callback<Boolean> callback)(Code) | | Generates the request message (if applicable) and sends to the remote service.
Parameters: bCancelIfInvalid - If true, the remote service will not be called if the message does not pass validation while being generated. Parameters: callback - true if the message passed all validation rules while being generated. |
doInboundMap | public void doInboundMap()(Code) | | Applies all inbound mappings, using the server response document as the source for the operation. Although this method is called once automatically, it can be called at any time to reapply the mapping rules.
Example usage:
var oService = new jsx3.net.Service();
oService.setInboundDocument(objSomeDocumentIManuallyWantToLoad);
oService.doInboundMap();
|
getInboundDocument | public jsx3.xml.CdfDocument getInboundDocument()(Code) | | Call this method after the service has responded to get a parsed instance of the server's XML response
|
getInboundDocument | public T getInboundDocument(Class<T> returnType)(Code) | | Call this method after the service has responded to get a parsed instance of the server's XML response
Parameters: returnType - The expected return type |
getInboundURL | public void getInboundURL(org.directwebremoting.proxy.Callback<String> callback)(Code) | | Gets the URL for a "typical", XML-formatted server resonse document. This document is then used when the project is
run in static mode (as defined by the Project Deployment Options).
|
getNamespace | public void getNamespace(org.directwebremoting.proxy.Callback<String> callback)(Code) | | Gets the namespace for the server/project to run the service instance within. If a namespace isn't provided, the system will look for the first
application and use its namespace. If no applications exist, the namespace will be completely ignored.
|
getOperationName | public void getOperationName(org.directwebremoting.proxy.Callback<String> callback)(Code) | | Gets the name of the operation to use within a multi-operation rules file. Note: Rules created via a WSDL often have multiple named operations. Rules files generated without a WSDL contain no named operations, and instead use a single transaction.
|
getOutboundDocument | public jsx3.xml.CdfDocument getOutboundDocument()(Code) | | Call this method after 'doCall' has been called to get a parsed instance of the request document--what was actually sent to the remote service
|
getOutboundDocument | public T getOutboundDocument(Class<T> returnType)(Code) | | Call this method after 'doCall' has been called to get a parsed instance of the request document--what was actually sent to the remote service
Parameters: returnType - The expected return type |
getOutboundStubPath | public void getOutboundStubPath(org.directwebremoting.proxy.Callback<String> callback)(Code) | | Gets XPath address for the node in the outbound stub document to which to append the generated message.
Parameters: callback - Valid XSL path |
getOutboundURL | public void getOutboundURL(org.directwebremoting.proxy.Callback<String> callback)(Code) | | Gets URL for a 'typical' XML-formatted request document to send to the server; when this is set, the mapper does not even attempt to generate a document. Instead, this document is sent directly to the server without any processing. Useful for testing requests that never change
|
getRequest | public jsx3.net.Request getRequest()(Code) | | Gets the jsx3.net.HttpRequest instance that performs the transaction with the remote service (the transport object for the message).
|
getRulesURL | public void getRulesURL(org.directwebremoting.proxy.Callback<String> callback)(Code) | | Gets the URL for the rules file to use (a CXF document). This rules file will be used by the Service instance to generate, send, receive and process XML messages
|
getRulesXML | public jsx3.xml.CdfDocument getRulesXML()(Code) | | Returns the rules document used by the Service instance (a CXF document)
|
getRulesXML | public T getRulesXML(Class<T> returnType)(Code) | | Returns the rules document used by the Service instance (a CXF document)
Parameters: returnType - The expected return type |
getServer | public jsx3.app.Server getServer()(Code) | | Returns the server that this service runs in, as set by the setNamespace() method.
|
getServiceMessage | public jsx3.xml.CdfDocument getServiceMessage(String MESSAGETYPE, String strShellURL)(Code) | | Gets the request message specific to the MESSAGETYPE (input, output, fault). Typically only used for input (outbound) messages, but can be used for simulating a server response for output and fault (in the case of a SOAP transaction, fault) messages
Parameters: MESSAGETYPE - one of: input, output, or fault. If this value is provided, the server will generate test data for all nodes lacking a mapped or scripted value Parameters: strShellURL - relative URL to message shell to use as the starting container to put content into. Note that calling setOutboundStubURL or setOutboundStubDocument in conjunction with setOutboundStubPath are preferred to passing this parameter, since they provide much greater control. Also note that this value is stored statically in the rules document when the rules document is first created via the XML Mapping Utility. |
getServiceMessage | public T getServiceMessage(String MESSAGETYPE, String strShellURL, Class<T> returnType)(Code) | | Gets the request message specific to the MESSAGETYPE (input, output, fault). Typically only used for input (outbound) messages, but can be used for simulating a server response for output and fault (in the case of a SOAP transaction, fault) messages
Parameters: MESSAGETYPE - one of: input, output, or fault. If this value is provided, the server will generate test data for all nodes lacking a mapped or scripted value Parameters: strShellURL - relative URL to message shell to use as the starting container to put content into. Note that calling setOutboundStubURL or setOutboundStubDocument in conjunction with setOutboundStubPath are preferred to passing this parameter, since they provide much greater control. Also note that this value is stored statically in the rules document when the rules document is first created via the XML Mapping Utility. Parameters: returnType - The expected return type |
getStatus | public void getStatus(org.directwebremoting.proxy.Callback<Integer> callback)(Code) | | Gets the HTTP response code (i.e., 200, 404, 500, etc). This will be the response code provided by the bound jsx3.net.Request instance
used for the transport. However, if setStatus has been called on the Service instance, the value supplied by the developer will be used instead.
|
getSupportedNamespaces | public void getSupportedNamespaces(org.directwebremoting.proxy.Callback<String> callback)(Code) | | Returns a CR-LF delimited list of supported namespaces and thei related prefix (as defined by the Object, jsx3.net.Service.ns). Any nodes in a rules document (CXF) that implements one of the namespaces listed by this function, should implement the corresponding namespace prefix as also detailed here.
|
publish | public void publish(jsx3.lang.Object objEvent, org.directwebremoting.proxy.Callback<Integer> callback)(Code) | | Publishes an event to all subscribed objects.
Parameters: objEvent - the event, should have at least a field 'subject' that is the event id, another common field is 'target' (target will default to this instance) Parameters: callback - the number of listeners to which the event was broadcast |
resetRules | public jsx3.net.Service resetRules()(Code) | | Resets the rules tree to default state (with all 'skip' flags removed) from those rules that were skipped during the previous transaction
reference to self |
resetRulesTree | public jsx3.net.Service resetRulesTree()(Code) | | Dereferences the parsed rules tree (a jsx3.xml.Document instance) managed by this Service instance, forcing a reload of the document from disk the next time the rules document is requested
reference to self |
setEndpointURL | public jsx3.net.Service setEndpointURL(String strAlternateURL)(Code) | | Sets the URL for the service endpoint where the request will be sent. Overrides the endpoint specified in the rules file.
Parameters: strAlternateURL - reference to self |
setInboundDocument | public void setInboundDocument(jsx3.xml.CdfDocument objXML)(Code) | | Sets a parsed instance of the response document as soon as it returns from the server returned from the service; otherwise null
Parameters: objXML - |
setInboundURL | public jsx3.net.Service setInboundURL(String strInboundURL)(Code) | | Sets the URL for a "typical", XML-formatted server resonse document. This document is then used when the project is
run in static mode (as defined by the Project Settings dialog). Overrides the static setting in the rules file.
Parameters: strInboundURL - Alternate URL for the "typical" Service response. Note that this URL will be resolvedrelative to the context server. For example, if the project directory for the context server is 'test',then the following inputs (all of which are valid) are equivalent: jsxapp://test/xml/typical.xml ,and xml/typical.xml , and JSXAPPS/test/xml/typical.xml reference to self |
setMethod | public void setMethod(String METHOD)(Code) | | Sets the method for the request different than the one described in the rules file.
Parameters: METHOD - one of: GET or POST |
setMode | public void setMode(Boolean MODE)(Code) | | Sets the mode (static jsx3.Boolean.FALSE or live jsx3.Boolean.TRUE). Overrides the default setting for the context Server
instance within which this Service instnace is running. (NOTE: This setting is accessible at the server level via the Project Settings dialog.)
Setting this value to jsx3.Boolean.FALSE, forces a test document
to be used to simulate a "typical" server response, instead of actually sending a request to a remote service. This is useful when setting up
test environments as well as providing "live" interactions when the remote server may not be available.
Parameters: MODE - |
setNamespace | public jsx3.net.Service setNamespace(jsx3.app.Server namespace)(Code) | | Sets the namespace for the server/project to run the service instance within.
Parameters: namespace - the server (preferred) or the namespace of the server. this object |
setNamespace | public jsx3.net.Service setNamespace(String namespace)(Code) | | Sets the namespace for the server/project to run the service instance within.
Parameters: namespace - the server (preferred) or the namespace of the server. this object |
setOperationName | public jsx3.net.Service setOperationName(String strOperationName)(Code) | | Sets the name of the operation to use within a multi-operation rules file. Note: Rules created via a WSDL often have multiple operations
Parameters: strOperationName - operation name reference to self |
setOutboundStubDocument | public jsx3.net.Service setOutboundStubDocument(jsx3.xml.CdfDocument objDocument)(Code) | | Sets the document that will serve as the container for the message generated by doCall and/or getServiceMessage.
This is a useful way to dynamically assemble documents by chaining multiple service instances, using the output from one service as the input to another.
For example, when a SOAP Envelope requires both a SOAP Header as well as a SOAP Body, this method allows the Envelope to be assembled via a
two-step process of first adding mapped content to the Body, followed by a call to add mapped content to the Header.
Note that this method takes precedence over the static stub document url referenced in the rules file as well as
any call to setOutboundStubURL. Use this method in conjunction with setOutboundStubPath to
point to the specific location in the document where the generated message should be appended.
Parameters: objDocument - reference to self |
setOutboundStubPath | public jsx3.net.Service setOutboundStubPath(String strPath)(Code) | | Sets XPath address for the node in the outbound stub document to which to append the generated message.
Overrides the static setting in the rules file.
Parameters: strPath - Valid XSL path. For example, /SOAP-ENV:Envelope/SOAP-ENV:Body reference to self |
setOutboundStubURL | public jsx3.net.Service setOutboundStubURL(String strURL)(Code) | | Sets the URL to the document that will serve as the container for the message generated by doCall and/or getServiceMessage.
Overrides the static setting stored in the rules file. Use this method in conjunction with setOutboundStubPath to
point to the specific location in the document where the generated message should be appended.
Parameters: strURL - URL for the document. Note that this URL will be resolved relative to the context server.For example, if the project directory for the context server is 'test', then the following inputs (all of which are valid) areequivalent: jsxapp://test/xml/typical.xml , and xml/typical.xml , and JSXAPPS/test/xml/typical.xml reference to self |
setOutboundURL | public jsx3.net.Service setOutboundURL(String strOutboundURL)(Code) | | Sets the URL for a static XML-formatted request document to send to the Service. Note that when this is set, the mapper does not even
attempt to generate a request document via the rules file. Instead, the static request document is sent directly to the remote Service
without any processing. This is useful for requests that never change or as a means to test whether a Service is working, using a known, valid input.
Parameters: strOutboundURL - Alternate URL for the static request to send. Note that this URL will be resolved relativeto the context server. For example, if the project directory for the context server is 'test', then the following inputs(all of which are valid) are equivalent: jsxapp://test/xml/typical.xml , and xml/typical.xml ,and JSXAPPS/test/xml/typical.xml reference to self |
setRequestHeader | public void setRequestHeader(String strName, String strValue)(Code) | | Sets an HTTP Request header on the request. Set before calling, doCall()
Parameters: strName - name for header parameter Parameters: strValue - value for the header parameter |
setRulesURL | public jsx3.net.Service setRulesURL(String strRulesURL)(Code) | | Sets the URL for the rules file to use (a CXF document). This rules file will be used by the Service instance to generate, send, receive and process XML messages
Parameters: strRulesURL - reference to self |
setStatus | public void setStatus(int intStatus)(Code) | | Sets the HTTP response code (i.e., 200, 404, 500, etc). Typically, the Service instance determines this value by querying the bound request instance
(jsx3.net.Request) returned by the method, [service_instance].getRequest(). However, calling this method will override
normal operation by forcing a valid/invalid state that affects methdods relying on the HTTP status
such as doInboundMap. This is particularly useful for SOAP services that provide alternate processing
instructions and mappings when a Fault occurs as well as when running tests in Static mode.
Parameters: intStatus - |
setTimeout | public jsx3.net.Service setTimeout(int intTimeout, jsx3.lang.Object objHandler, String objFunction)(Code) | | Specifies how long to wait for the service to respond before cancelling the call. Subscribes to the ON_TIMEOUT event
Parameters: intTimeout - number of milliseconds to wait befor publishing the ON_TIMEOUT event. Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance reference to self |
setTimeout | public jsx3.net.Service setTimeout(int intTimeout, org.directwebremoting.proxy.CodeBlock objHandler, org.directwebremoting.proxy.CodeBlock objFunction)(Code) | | Specifies how long to wait for the service to respond before cancelling the call. Subscribes to the ON_TIMEOUT event
Parameters: intTimeout - number of milliseconds to wait befor publishing the ON_TIMEOUT event. Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance reference to self |
setTimeout | public jsx3.net.Service setTimeout(int intTimeout, String objHandler, org.directwebremoting.proxy.CodeBlock objFunction)(Code) | | Specifies how long to wait for the service to respond before cancelling the call. Subscribes to the ON_TIMEOUT event
Parameters: intTimeout - number of milliseconds to wait befor publishing the ON_TIMEOUT event. Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance reference to self |
setTimeout | public jsx3.net.Service setTimeout(int intTimeout, org.directwebremoting.proxy.CodeBlock objHandler, String objFunction)(Code) | | Specifies how long to wait for the service to respond before cancelling the call. Subscribes to the ON_TIMEOUT event
Parameters: intTimeout - number of milliseconds to wait befor publishing the ON_TIMEOUT event. Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance reference to self |
setTimeout | public jsx3.net.Service setTimeout(int intTimeout, jsx3.lang.Object objHandler, org.directwebremoting.proxy.CodeBlock objFunction)(Code) | | Specifies how long to wait for the service to respond before cancelling the call. Subscribes to the ON_TIMEOUT event
Parameters: intTimeout - number of milliseconds to wait befor publishing the ON_TIMEOUT event. Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance reference to self |
setTimeout | public jsx3.net.Service setTimeout(int intTimeout, String objHandler, String objFunction)(Code) | | Specifies how long to wait for the service to respond before cancelling the call. Subscribes to the ON_TIMEOUT event
Parameters: intTimeout - number of milliseconds to wait befor publishing the ON_TIMEOUT event. Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance reference to self |
setUserName | public jsx3.net.Service setUserName(String strName)(Code) | | Sets the user name to send with the posting (for those sites requiring http authentication)
Parameters: strName - user name reference to self |
setUserPass | public jsx3.net.Service setUserPass(String strPass)(Code) | | Sets the password to send with the posting (for those sites requiring http authentication)
Parameters: strPass - password for user reference to self |
subscribe | public void subscribe(Object[] strEventId, jsx3.lang.Object objHandler, org.directwebremoting.proxy.CodeBlock objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(String strEventId, String objHandler, String objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(String strEventId, String objHandler, org.directwebremoting.proxy.CodeBlock objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(Object[] strEventId, String objHandler, String objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(Object[] strEventId, jsx3.lang.Object objHandler, String objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(Object[] strEventId, org.directwebremoting.proxy.CodeBlock objHandler, org.directwebremoting.proxy.CodeBlock objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(String strEventId, jsx3.lang.Object objHandler, String objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(Object[] strEventId, org.directwebremoting.proxy.CodeBlock objHandler, String objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(Object[] strEventId, String objHandler, org.directwebremoting.proxy.CodeBlock objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(String strEventId, jsx3.lang.Object objHandler, org.directwebremoting.proxy.CodeBlock objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(String strEventId, org.directwebremoting.proxy.CodeBlock objHandler, String objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
subscribe | public void subscribe(String strEventId, org.directwebremoting.proxy.CodeBlock objHandler, org.directwebremoting.proxy.CodeBlock objFunction)(Code) | | Subscribes an object or function to a type of event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - if an object, the instance to notify of events (objFunction is required); if a string, the JSX id of the instance to notify of events (objFunction is required), must exist in the same Server; if a function, the function to call to notify of events (objFunction ignored) Parameters: objFunction - if objHandler is a string or object then the function to call on that instance. either a function or a string that is the name of a method of the instance |
unsubscribe | public void unsubscribe(String strEventId, jsx3.lang.Object objHandler)(Code) | | Unsubscribe an object or function from an event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - the value of objHandler passed to subscribe |
unsubscribe | public void unsubscribe(Object[] strEventId, jsx3.lang.Object objHandler)(Code) | | Unsubscribe an object or function from an event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - the value of objHandler passed to subscribe |
unsubscribe | public void unsubscribe(String strEventId, org.directwebremoting.proxy.CodeBlock objHandler)(Code) | | Unsubscribe an object or function from an event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - the value of objHandler passed to subscribe |
unsubscribe | public void unsubscribe(String strEventId, String objHandler)(Code) | | Unsubscribe an object or function from an event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - the value of objHandler passed to subscribe |
unsubscribe | public void unsubscribe(Object[] strEventId, String objHandler)(Code) | | Unsubscribe an object or function from an event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - the value of objHandler passed to subscribe |
unsubscribe | public void unsubscribe(Object[] strEventId, org.directwebremoting.proxy.CodeBlock objHandler)(Code) | | Unsubscribe an object or function from an event published by this object.
As of version 3.4 a string value for objHandler is deprecated.
Parameters: strEventId - the event type(s). Parameters: objHandler - the value of objHandler passed to subscribe |
unsubscribeAll | public void unsubscribeAll(String strEventId)(Code) | | Unsubscribes all subscribed objects to a type of event published by this object.
Parameters: strEventId - the event type |
Methods inherited from jsx3.lang.Object | public void ignoreReturn()(Code)(Java Doc)
|
|
|