GetSOAPResponse

Description

Returns an XML object that contains the entire SOAP response after invoking a web service.

Returns

An XML object that contains the entire SOAP response.

Category

XML functions

History

ColdFusion MX 7: Added this function.

Function syntax

GetSOAPResponse(webservice)

Parameters

Parameter

Description

webservice

A webservice object as returned from the cfobject tag or the CreateObject function.

Usage

Invoke the web service before attempting to get the response. You can use CFML XML functions to examine the XML response.

Example

This example makes a request to execute the echo_me function of the headerservice.cfc web service. Following the request, the example calls the GetSOAPResponse function to get the SOAP response, and then calls cfdump to display its content.

for information on implementing the headerservice.cfc web service and also to see the echo_me function and the content of the web service CFC, see the example for either the AddSOAPResponseHeader function or the GetSOAPRequestHeader function.

<!--- Note that you might need to modify the URL in the CreateObject function 
to match your server and the location of the headerservice.cfc file if it is 
different than shown here. ---> 
 
<cfscript> 
    ws = CreateObject("webservice", 
"http://localhost/soapheaders/headerservice.cfc?WSDL"); 
    ws.echo_me("hello world"); 
    resp = getSOAPResponse(ws); 
</cfscript> 
<cfdump var="#resp#">