You know the word caveat, right? Well, today I learned that there are a few caveats when setting up ColdSpring remote proxy beans.
<cfscript>
billGroupService = createObject("webservice", "http://localhost/webapps/charm/remote/BillingGroup.cfc?wsdl");
</cfscript>
<cfinvoke method="getGroups" webservice="#billGroupService#">
<cfinvokeargument name="BILLING_RULE_GRP_CD" value="1">
<cfinvokeargument name="DESCR" omit="yes">
<cfinvokeargument name="ACTIVE_IND" omit="yes">
<cfinvokeargument name="DEFAULT_FLAG" omit="yes">
</cfinvoke>
<cffunction name="getGroups" access="public" output="false" returntype="array">
<cfargument name="BILLING_RULE_GRP_CD" default="" type="string" required="false" />
<cfargument name="DESCR" default="" type="string" required="false" />
<cfargument name="ACTIVE_IND" default="" type="string" required="false" />
<cfargument name="DEFAULT_FLAG" default="" type="string" required="false" />
<cfreturn variables.GroupGateway.getByAttributes(argumentCollection=arguments) />
</cffunction>
<bean id="RemoteBillingRuleGroup" class="coldspring.aop.framework.RemoteFactoryBean">
<property name="interceptorNames">
<list>
<value>exceptionLoggingAdvisor</value>
<value>metricsAdvisor</value>
</list>
</property>
<property name="target">
<ref bean="BillingRuleGroupTarget" />
</property>
<property name="serviceName">
<value>BillingGroup</value>
</property>
<property name="relativePath">
<value>/webapps/charm/remote/</value>
</property>
<property name="beanFactoryName">
<value>charm.framework</value>
</property>
<property name="remoteMethodNames">
<value>*</value>
</property>
</bean>
3 Responses for "ColdSpring Remote Proxies as WebServices… Whew!"
Steve,
Does your BillingGroup.cfc reside within same the application as the code that calls it as a webservice (listing 1.1)? I saw this pattern in the feedviewer-remote example app that comes with ColdSpring and am trying to understand the remote proxy thing. If the cfc is local, can you please explain the benefits of using an expensive remote call to code that is in the same app? If you have any more code you could post or email, that would be great.
Thanks,
Brandon
No, I’m running the services in a separate application than my client code. The beans created as remote proxies reside on a different machine as well. You’re right that there is no benefit to calling web services that reside in the same application scope as the client code.
wat up
Leave a reply