Wolfram ResearchPRODUCTSPURCHASEFOR USERSCOMPANYOUR SITES
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.

Working with Messages

Sometimes it is useful to work directly with the request message that is sent to a web service. This message may be retrieved using the ToServiceRequest function. ToServiceRequest is called by providing a web service function as the first parameter and its parameters as the additional parameters. The function will not invoke the web service operation. Rather the function will return the symbolic XML representation of the request message that would generally be sent to the web service.

In[25]:=
In[26]:=
Out[26]=
In[27]:=
Out[27]=

A user may change the request message to have different values or different attributes. In fact, the user may create an entirely new message. However, the message must still follow the format specified in the SOAP specification. Using ToServiceRequest gives the user a nice starting point. The request message can then be invoked using the InvokeServiceOperation function. The first parameter of this function is the symbol representing a web service function. The web service function specifies the endpoint URI internally along with other options for invoking the service. The second argument is the symbolic XML representation of the request message.

In[28]:=
Out[28]=
In[29]:=
Out[29]=

The result of this call is the response message. Sometimes it is useful to work directly with the response message. However, web service functions by default return a deserialized version of the response message. The original response message may be retrieved using the InvokeServiceOperation function. The first parameter is the web service function and the function's parameters follow. InvokeServiceOperation invokes the service and returns the entire response message in symbolic XML. This will allow the user to customize how the data is deserialized into Mathematica representation.

In[30]:=
Out[30]=

Once a web service function is called using InvokeServiceOperation, the results come back in the form of a SOAP envelope. FromServiceResponse can be used to extract the results from the SOAP envelope. If the message uses SOAP encoding and provides types in the response message, the data will be deserialized into the proper Mathematica types. If not, the SOAP envelope wrappers will be stripped and the response will be deserialized into a rule syntax expression with string values.

In[31]:=
Out[31]=


Any questions about topics on this page? Click here to get an individual response.Buy NowFree TrialMore Information



 © 2009 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: