Archive for category Coldfusion

way to create webservice in coldfusion

here input is in xml format and output is also in xml format

Index.cfm

<cfinvoke
method=”methodName” //define the structure
returnvariable=”variableName” // return variable name

webservice=”webserviceName”>//define the webservice name(mapping for webservic ein coldfusion administrator) or the url like this(http://localhost/foldername/Filename.cfc?wsdl)  Filename is the file where to execute function “methodName”.

<cfinvokeargument name=”ArgumentName” value=”#ArgumentValue#”>
</cfinvoke>

Below two lines are used to show the returned data in xml format in the webbrowser.

<cfsetting enableCFoutputOnly = “yes” showDebugOutput = “no” />
<cfcontent type=”text/xml;charset=utf-8″><cfoutput>#variableName#</cfoutput>

 

to call webservice :-

http://localhost/index.cfm

 

1 Comment

Different ways to create Xml in coldfusion

1st way:-

<cfscript>

XmlData= ‘<?xml version=”1.0″ encoding=”UTF-8″?>

<FirstTag>
<FirstNestedTag>VALUE</FirstNestedTag>
<SecondNestedTag>VALUE</SecondNestedTag>
<ThirdNestedTag>VALUE</ThirdNestedTag>

</FirstTag>

<SecondTag>
<FirstNestedTag>VALUE</FirstNestedTag>
<SecondNestedTag>VALUE</SecondNestedTag>
<ThirdNestedTag>VALUE</ThirdNestedTag>
</SecondTag>

 

</script>

 

Read the rest of this entry »

No Comments