<cffunction name="init" access="public" output="false" returntype="any">
<cfargument name="username" type="string" required="true" />
<cfargument name="password" type="string" required="true" />
<cfset var my = structnew() />
<cfset variables.ws = createobject("webservice", variables.wsdlurl) />
<cfset variables.ws.setMaintainSession(true) />
<cfset my.ret = ws.Login(username, password) >
<cfset variables.cookie = variables.ws._getCall().getMessageContext().getProperty("Cookie") />
<cfset variables.cookie = listToarray(arrayToList(variables.cookie)) />
<cfset variables.ws._setProperty("Cookie", variables.cookie) />
<cfreturn this />
</cffunction>
<cffunction name="call" access="private" output="false" returntype="any">
<cfargument name="method" />
<cfargument name="args" />
<cfset var my = structnew() />
<cflock name="#variables.id#-call_lock">
<cfinvoke webservice="#variables.ws#" method="#method#" returnvariable="my.ret">
<cfloop collection="#args#" item="my.i">
<cfinvokeargument name="#my.i#" value="#args[my.i]#" />
</cfloop>
</cfinvoke>
<cfset my.ret = variables.ws._getCall().getMessageContext().getResponseMessage().getSOAPPartAsString() />
</cflock>
<cfreturn parseXml(my.ret) />
</cffunction>