Skip to main content
ilssac
Inspiring
January 7, 2010
Question

Aren't web services supposed to be easy?

  • January 7, 2010
  • 1 reply
  • 11659 views

my web service.

<cfcomponent>
    <cfproperty name="id" default="10" type="numeric">
 
  <cfset variables.id = 10>
 
    <cffunction name="setId" access="remote" returntype="void">
        <cfargument name="id" type="numeric" required="yes">
        <cfset variables.id = arguments.id>
    </cffunction>
 
  <cffunction name="getId" access="remote" returntype="numeric">
      <cfreturn variables.id>
  </cffunction>
</cfcomponent>

my test page.

  <p>Call component as web service</p>
  <cfset myWS = createObject("webservice","http://10.104.106.39:8080/ian.cfc?wsdl")>
  <cfoutput>#myWS.getId()#</cfoutput>
  <cfset myWS.setId(888)>
  <cfoutput>#myWS.getId()#</cfoutput>
  <cfdump var="#myWS#">

Both outputs are outputing the same value of 10.  The web service does not seem to be maintaining state from one method call to another.

This topic has been closed for replies.

1 reply

Inspiring
January 7, 2010

My approach would be to use the this scope instead of the variables scope if I wanted to be able to change the value from the calling page.

ilssac
ilssacAuthor
Inspiring
January 7, 2010

Unfortunatly using the this scope made no differenece.

January 7, 2010

unsubscribe

--

GSN Global Signature Net AG

Bucheggstr. 107

CH-8057 Zürich

http://www.signaturenet.org

+41 (0)44 364 02 75

roland.frick@signaturenet.org