[coldbox-3.8.0] How do you configure a coldbox app to work as a web service.

In a none Coldbox Coldfusion application, you can add “access=“REMOTE”” to a CFC and then get the WSDL like this.
www.abcsite123.com/test.cfc?WSDL

In my coldbox application that does not work when adding “access=“remote”” to a handler.cfc.

So how do I generate my WSDL in a coldbox application?

I was looking at the Coldbox proxy documention but wasn’t sure if that was the solution and would allow for WSDL generation.

Handlers aren’t directly invoked, they are run as part of the framework. If you need WSDL, then use proxies. A proxy can directly interact with your services or they can run Coldbox events via process(). Just remember a proxy runs outside the normal Coldbox request lifecycle so it doesn’t trigger interception points like preProcess() so make sure you secure them appropriately if you’re not executing events.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

This is still now working for me. I created a proxy but it is not being recognized. Do the Proxies work with SES navigation enabled?

it will prob not work with the SES because its outside of the framework.

i make a direct call to the proxy cfc (www.app.com/proxy.cfc). from there, i have access to the framework.

here is a sample proxy:

component accessors=true extends=“coldbox.system.remote.ColdboxProxy”{

// dependency properties

// public functions

remote any function process() returnformat=“plain” hint=“process non-remote function”{
var results = “”;

try{
results = super.process(argumentCollection=arguments);
}catch(any debug){
return;
}
}
}

Yep, the docs are here:
http://wiki.coldbox.org/wiki/ColdboxProxy.cfm

SES (or any other framework setting) has no bearing on Proxys. They just just stand alone CFCs laying around your web root that you hit with Ajax or Flash remoting just like you would if you weren’t using a framework. The just have the ability to conjure up the ColdBox controller and “proxy” requests along if you wish.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Yeah I tried all of that and have read that link. I think the problem may be the SES URL re-writer that we are using to make SES work with tomcat.
My proxy is under the remote folder, going to see if I can put in a filter to the URL re-write rules to exclude proxys.

Can I ask are you using Flex or some other application to call the RPC?

One thing that many people tend to forget, is that an RPC is just an entry point. WSDL is just Adobe’s way of doing RPC’s… If you are using Flex and need WSDL, I would maybe switch to RESTful instead and get access to the entire framework.

At this point I’m just trying to access through the URL of a web browser. I should be able to do www.abc.com/remote/myProxy.cfc?wsdl and get a response. But that is not working. The WSDL is a global file that lets other systems know what functions are available to it. So system like .net need the WSDL to build the reference object.

We are not using Flex. Eventually we will be calling it from different applications including SSIS and other coldbox applications.

Yes I know what a WSDL is, I haven’t used them in 3 years. Basically WSDL is Adobe’s version of SOAP and that is not even worth talking about. There is nothing better than a well documented API that can be called via RESTful.

+1 for rest over soap.

either way, as long as you know the return format and whats being returned, it doesnt matter. its just a http call.

Not sure why you refer to WSDL as Adobes version of SOAP. It was developed by IBM, Microsoft and Ariba in 2000. http://en.wikipedia.org/wiki/Web_Services_Description_Language

Any way I was able to figure out the problem.

The Issue was because of the URL re-writing happing on the tomcat side. I was able to add a condition to the re-write filter to exclude any request containing our proxy folder from being re-written.

I can now access my proxy file as an web service. I am looking at the idea of using REST though since it does work better with SES.

Glad to hear it’s working. If you do look into REST, you can start here with this recording from ColdBox Developers Week 2013:

http://www.coldbox.org/media/cbdw2013#3_2

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Oooh, thanks Brad, just what I needed too.

Great! There is a wealth of recordings from our last two years of CBDW here http://www.coldbox.org/media/cbdw2013 and here http://www.coldbox.org/media/cbdw2012

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

and dont forget Relax!

hmmm… That link states that it was the World Wide Web Consortium and not IBM, either way it wasn’t Adobe as I thought.