Answered
Web Services Insert
I am looking for example code of a web service inserting data
into a database. I have usuccessfully been taking a crack at it.
Below is the code:
page that calls the web service:
<cfinvoke webservice = " http://localhost/cf_test/StoryBuild.cfc?wsdl"
method = "insertSBdata" returnVariable = "insertSBdata">
<cfinvokeargument name="inputParam1" value="Fname">
<cfinvokeargument name="inputParam2" value="Lname">
<cfinvokeargument name="inputParam3" value="Department">
<cfinvokeargument name="inputParam4" value="Story">
</cfinvoke>
<cfdump var="#insertSBdata#">
web service:
<cfcomponent>
<cffunction name="insertSBdata" access="remote" returntype="any">
<cfquery name="qStoryBuild" datasource="EDStoryBuild">
INSERT INTO story_tb
VALUES ('#inputParam1#', '#inputParam2#', '#inputParam3#','#inputParam4#')
</cfquery>
</cffunction>
</cfcomponent>
Any help would be greatly appreciated.
page that calls the web service:
<cfinvoke webservice = " http://localhost/cf_test/StoryBuild.cfc?wsdl"
method = "insertSBdata" returnVariable = "insertSBdata">
<cfinvokeargument name="inputParam1" value="Fname">
<cfinvokeargument name="inputParam2" value="Lname">
<cfinvokeargument name="inputParam3" value="Department">
<cfinvokeargument name="inputParam4" value="Story">
</cfinvoke>
<cfdump var="#insertSBdata#">
web service:
<cfcomponent>
<cffunction name="insertSBdata" access="remote" returntype="any">
<cfquery name="qStoryBuild" datasource="EDStoryBuild">
INSERT INTO story_tb
VALUES ('#inputParam1#', '#inputParam2#', '#inputParam3#','#inputParam4#')
</cfquery>
</cffunction>
</cfcomponent>
Any help would be greatly appreciated.
