com.smartgwt.client.data
Class WSRequest

java.lang.Object
  extended by com.smartgwt.client.core.JsObject
      extended by com.smartgwt.client.core.DataClass
          extended by com.smartgwt.client.rpc.RPCRequest
              extended by com.smartgwt.client.data.WSRequest

public class WSRequest
extends RPCRequest

A WSRequest (or "web service request") is an extended RPCRequest will additional properties application to WSDL/SOAP web services.

All properties which are legal on RPCRequest are legal on a WSRequest, in addition to the properties listed here.


Field Summary
 
Fields inherited from class com.smartgwt.client.core.JsObject
jsObj
 
Constructor Summary
WSRequest()
           
WSRequest(JavaScriptObject jsObj)
           
 
Method Summary
 JavaScriptObject getData()
          Data to be serialized to XML to form the SOAP body.
 Map getDataAsMap()
           
 Map getHeaderData()
          Data to be serialized to form the SOAP headers, as a map from the header part name to the data.
static WSRequest getOrCreateRef(JavaScriptObject jsObj)
           
 Boolean getUseFlatFields()
          When useFlatFields is set for a request to be sent to a WSDL web service, when creating the input XML message to send to the web service, properties in data will be used as the values for XML elements of the same name, at any level of nesting.
 String getWsOperation()
          Name of the web service operation to invoke.
 void setData(JavaScriptObject data)
          Data to be serialized to XML to form the SOAP body.
 void setData(Map data)
          Data to be serialized to XML to form the SOAP body.
 void setHeaderData(Map headerData)
          Data to be serialized to form the SOAP headers, as a map from the header part name to the data.
 void setUseFlatFields(Boolean useFlatFields)
          When useFlatFields is set for a request to be sent to a WSDL web service, when creating the input XML message to send to the web service, properties in data will be used as the values for XML elements of the same name, at any level of nesting.
 void setWsOperation(String wsOperation)
          Name of the web service operation to invoke.
 void setXmlNamespaces(XmlNamespaces xmlNamespaces)
          Optional object declaring namespace prefixes for use in evaluating the resultType parameter of WebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback), if resultType is an XPath.
 
Methods inherited from class com.smartgwt.client.rpc.RPCRequest
create, getActionURL, getBypassCache, getCallbackParam, getContainsCredentials, getContentType, getDataAsString, getEvalResult, getHttpHeaders, getHttpMethod, getIgnoreTimeout, getOmitNullMapValuesInResponse, getPrompt, getPromptCursor, getPromptStyle, getSendNoQueue, getServerOutputAsString, getShowPrompt, getTimeout, getTransport, getUseSimpleHttp, getWillHandleError, setActionURL, setBypassCache, setCallbackParam, setContainsCredentials, setContentType, setData, setData, setEvalResult, setEvalVars, setHttpHeaders, setHttpMethod, setIgnoreTimeout, setOmitNullMapValuesInResponse, setParams, setPrompt, setPromptCursor, setPromptStyle, setSendNoQueue, setServerOutputAsString, setShowPrompt, setTimeout, setTransport, setUseSimpleHttp, setWillHandleError
 
Methods inherited from class com.smartgwt.client.core.DataClass
doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsObject, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute
 
Methods inherited from class com.smartgwt.client.core.JsObject
isCreated, setJsObj
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSRequest

public WSRequest()

WSRequest

public WSRequest(JavaScriptObject jsObj)
Method Detail

getOrCreateRef

public static WSRequest getOrCreateRef(JavaScriptObject jsObj)

setWsOperation

public void setWsOperation(String wsOperation)
Name of the web service operation to invoke.

Parameters:
wsOperation - wsOperation Default value is null

getWsOperation

public String getWsOperation()
Name of the web service operation to invoke.

Returns:
String

setUseFlatFields

public void setUseFlatFields(Boolean useFlatFields)
When useFlatFields is set for a request to be sent to a WSDL web service, when creating the input XML message to send to the web service, properties in data will be used as the values for XML elements of the same name, at any level of nesting.

useFlatFields allows you to ignore gratuitous XML message structure, such as extra levels of nested elements, and provides some insulation against changes in the required structure of the input message.

For example, given this input message:

 <FindServices>
     <searchFor>search text</searchFor>
     <Options>
         <caseSensitive>false</caseSensitive>
     </Options>
     <IncludeInSearch>
         <serviceName>true</serviceName>
         <documentation>true</documentation>
         <keywords>true</keywords>
     </IncludeInSearch>
 </FindServices>
 
If useFlatFields were not set, in order to fill out this message correctly, request.data would need to be:
{
    searchFor: "search text",
    Options : {
        caseSensitive: false,
    },
    IncludeInSearch : {
        serviceName: true,
        documentation : true,
        keywords : true
    }
 }
However if useFlatFields were set, request.data could be just:
{
    searchFor: "search text",
    caseSensitive: false,
    serviceName: true,
    documentation : true,
    keywords : true
 }
useFlatFields is often set when the input data comes from a DynamicForm to avoid the cumbersome and fragile process of mapping input fields to an XML structure.

useFlatFields can also be set to cause all dsRequests of a particular type to useFlatFields automatically.

For DataBoundComponent, useFlatFields can be set use "flattened" binding to fields of a WSDL message or XML Schema.

Note that useFlatFields is not generally recommended for use with XML input messages where multiple simple type fields exist with the same name, however if used in this way, the first field to use a given name wins. "first" means the first field encountered in a depth first search. "wins" means only the first field will be populated in the generated XML message.

Parameters:
useFlatFields - useFlatFields Default value is null

getUseFlatFields

public Boolean getUseFlatFields()
When useFlatFields is set for a request to be sent to a WSDL web service, when creating the input XML message to send to the web service, properties in data will be used as the values for XML elements of the same name, at any level of nesting.

useFlatFields allows you to ignore gratuitous XML message structure, such as extra levels of nested elements, and provides some insulation against changes in the required structure of the input message.

For example, given this input message:

 <FindServices>
     <searchFor>search text</searchFor>
     <Options>
         <caseSensitive>false</caseSensitive>
     </Options>
     <IncludeInSearch>
         <serviceName>true</serviceName>
         <documentation>true</documentation>
         <keywords>true</keywords>
     </IncludeInSearch>
 </FindServices>
 
If useFlatFields were not set, in order to fill out this message correctly, request.data would need to be:
{
    searchFor: "search text",
    Options : {
        caseSensitive: false,
    },
    IncludeInSearch : {
        serviceName: true,
        documentation : true,
        keywords : true
    }
 }
However if useFlatFields were set, request.data could be just:
{
    searchFor: "search text",
    caseSensitive: false,
    serviceName: true,
    documentation : true,
    keywords : true
 }
useFlatFields is often set when the input data comes from a DynamicForm to avoid the cumbersome and fragile process of mapping input fields to an XML structure.

useFlatFields can also be set to cause all dsRequests of a particular type to useFlatFields automatically.

For DataBoundComponent, useFlatFields can be set use "flattened" binding to fields of a WSDL message or XML Schema.

Note that useFlatFields is not generally recommended for use with XML input messages where multiple simple type fields exist with the same name, however if used in this way, the first field to use a given name wins. "first" means the first field encountered in a depth first search. "wins" means only the first field will be populated in the generated XML message.

Returns:
Boolean

setHeaderData

public void setHeaderData(Map headerData)
Data to be serialized to form the SOAP headers, as a map from the header part name to the data. For example, given WSDL like this:
     <soap:header part="SessionHeader" message="tns:HeaderMessage"/>
     <soap:header part="CallOptions" message="tns:HeaderMessage/>
 
headerData like this might be provided:
     dsRequest.headerData = 
         { SessionHeader : data
           CallOptions : data };
 
The provided data will be serialized to XML by the com.smartgwt.client.data.WebService#getInputHeaderSchema via DataSource.xmlSerialize(com.google.gwt.core.client.JavaScriptObject)

Parameters:
headerData - headerData Default value is null

getHeaderData

public Map getHeaderData()
Data to be serialized to form the SOAP headers, as a map from the header part name to the data. For example, given WSDL like this:
     <soap:header part="SessionHeader" message="tns:HeaderMessage"/>
     <soap:header part="CallOptions" message="tns:HeaderMessage/>
 
headerData like this might be provided:
     dsRequest.headerData = 
         { SessionHeader : data
           CallOptions : data };
 
The provided data will be serialized to XML by the com.smartgwt.client.data.WebService#getInputHeaderSchema via DataSource.xmlSerialize(com.google.gwt.core.client.JavaScriptObject)

Returns:
headerData Default value is null

setData

public void setData(JavaScriptObject data)
Data to be serialized to XML to form the SOAP body.

Overrides:
setData in class RPCRequest
Parameters:
data - data Default value is null

setData

public void setData(Map data)
Data to be serialized to XML to form the SOAP body.

Overrides:
setData in class RPCRequest
Parameters:
data - data Default value is null

getData

public JavaScriptObject getData()
Data to be serialized to XML to form the SOAP body.

Overrides:
getData in class RPCRequest
Returns:
the data

getDataAsMap

public Map getDataAsMap()

setXmlNamespaces

public void setXmlNamespaces(XmlNamespaces xmlNamespaces)
Optional object declaring namespace prefixes for use in evaluating the resultType parameter of WebService.callOperation(java.lang.String, java.util.Map, java.lang.String, com.smartgwt.client.data.WebServiceCallback), if resultType is an XPath.

Format is identical to xmlNamespaces, and default namespaces bindings are also identical.

Parameters:
xmlNamespaces - xmlNamespaces Default value is null