org.wso2.mashup.hostobjects.wsrequest
Class WSRequestHostImpl

java.lang.Object
  extended by org.mozilla.javascript.ScriptableObject
      extended by org.wso2.mashup.hostobjects.wsrequest.WSRequestHostImpl
All Implemented Interfaces:
java.io.Serializable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.Scriptable

public class WSRequestHostImpl
extends org.mozilla.javascript.ScriptableObject
Mozilla Rhino host Object Implementation of the WSRequest Specification. See the WSRequest Host Object reference guide for more information.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
WSRequestHostImpl()
          Constructor for the use by Rhino
 
Method Summary
 java.lang.String getClassName()
          Returns the name to be used for this JavaScript Object.
static org.mozilla.javascript.Scriptable jsConstructor(org.mozilla.javascript.Context cx, java.lang.Object[] args, org.mozilla.javascript.Function ctorObj, boolean inNewExpr)
          Constructor the user will be using inside javaScript
static void jsFunction_open(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] arguments, org.mozilla.javascript.Function funObj)
          This method prepares the WSRequest object to invoke a Web service.
static void jsFunction_openWSDL(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] arguments, org.mozilla.javascript.Function funObj)
          This function enables you to give a WSDL and get WSRequest configured.
static void jsFunction_send(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] arguments, org.mozilla.javascript.Function funObj)
          This method invokes the Web service with the requested payload.
 org.mozilla.javascript.Scriptable jsGet_error()
          Getter for the WebServiceError object The WebServiceError object encapsulates information about the cause of a failed Web service invocation.
 org.mozilla.javascript.Scriptable jsGet_onreadystatechange()
          Getter for the 'onreadystatechange' javascript function.
 int jsGet_readyState()
          Getter for the readyState property readyState property represents current state of the object, which can be one of the following values: 0: The object has not been initialized by calling the open() method.
 org.mozilla.javascript.Scriptable jsGet_responseE4X()
          Getter for the responseE4X property.
 java.lang.String jsGet_responseText()
          Getter for the responseText property.
 org.mozilla.javascript.Scriptable jsGet_responseXML()
          Getter for the responseXML property.
 void jsSet_onreadystatechange(org.mozilla.javascript.Function function)
          Setter for the 'onreadystatechange' javascript function.
 
Methods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, get, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSRequestHostImpl

public WSRequestHostImpl()
Constructor for the use by Rhino
Method Detail

jsConstructor

public static org.mozilla.javascript.Scriptable jsConstructor(org.mozilla.javascript.Context cx,
                                                              java.lang.Object[] args,
                                                              org.mozilla.javascript.Function ctorObj,
                                                              boolean inNewExpr)
Constructor the user will be using inside javaScript

getClassName

public java.lang.String getClassName()
Returns the name to be used for this JavaScript Object.
Specified by:
getClassName in interface org.mozilla.javascript.Scriptable
Specified by:
getClassName in class org.mozilla.javascript.ScriptableObject

jsFunction_open

public static void jsFunction_open(org.mozilla.javascript.Context cx,
                                   org.mozilla.javascript.Scriptable thisObj,
                                   java.lang.Object[] arguments,
                                   org.mozilla.javascript.Function funObj)
                            throws org.wso2.mashup.MashupFault
This method prepares the WSRequest object to invoke a Web service. This method corresponds to the following function of the WSRequest java script object.
   void open ( in object options | in String method, in String url [, in boolean async [, in String user [, in String password]]]);
 
See WSRequest host object reference & WSRequest specification for more details.
Throws:
org.wso2.mashup.MashupFault

jsFunction_openWSDL

public static void jsFunction_openWSDL(org.mozilla.javascript.Context cx,
                                       org.mozilla.javascript.Scriptable thisObj,
                                       java.lang.Object[] arguments,
                                       org.mozilla.javascript.Function funObj)
                                throws org.wso2.mashup.MashupFault
This function enables you to give a WSDL and get WSRequest configured. You dont have to configure it your self using an options object.
Throws:
org.wso2.mashup.MashupFault

jsFunction_send

public static void jsFunction_send(org.mozilla.javascript.Context cx,
                                   org.mozilla.javascript.Scriptable thisObj,
                                   java.lang.Object[] arguments,
                                   org.mozilla.javascript.Function funObj)
                            throws org.wso2.mashup.MashupFault
This method invokes the Web service with the requested payload.
   void send ( [in Document payload | in XMLString payload | in XMLString payload ]);
 
See WSRequest host object reference & WSRequest specification for more details.
Throws:
org.wso2.mashup.MashupFault

jsGet_responseText

public java.lang.String jsGet_responseText()
Getter for the responseText property. The raw text representing the XML (or non-XML) response. If the responseXML property is empty, you can check the responseText property to see if a non-XML response was received.

jsGet_responseE4X

public org.mozilla.javascript.Scriptable jsGet_responseE4X()
                                                    throws org.wso2.mashup.MashupFault
Getter for the responseE4X property. The parsed E4X XML message representing the response from the service.
Throws:
org.wso2.mashup.MashupFault

jsGet_responseXML

public org.mozilla.javascript.Scriptable jsGet_responseXML()
                                                    throws org.wso2.mashup.MashupFault
Getter for the responseXML property. The parsed XML message representing the response from the service. Currently we return an E4X object. But ideally this needs to be a DOM.
Throws:
org.wso2.mashup.MashupFault

jsGet_onreadystatechange

public org.mozilla.javascript.Scriptable jsGet_onreadystatechange()
Getter for the 'onreadystatechange' javascript function. This property can be set to a javascript function object, which is invoked when the state of an asynchronous request changes (e.g. the request completes).

jsSet_onreadystatechange

public void jsSet_onreadystatechange(org.mozilla.javascript.Function function)
Setter for the 'onreadystatechange' javascript function. This property can be set to a javascript function object, which is invoked when the state of an asynchronous request changes (e.g. the request completes).

jsGet_readyState

public int jsGet_readyState()
Getter for the readyState property readyState property represents current state of the object, which can be one of the following values: