Using WSS4CF with <cfhttp>

Hi there,

We are attempting to access a remote webservice using cfhttp, requiring WS Security with username/password. I was in the middle of implementing a method here and ran into classpath issues etc, when my colleague suggested I take at WSS4CF. It seemed just what I needed to avoid needing to deal with those additional jar files etc.

There is no example provided and I noticed that the cfc seems to be configured to work with something like a dotNet SOAP service where you simply call a method with arguments. I need an example that works with cfhttp where we pass an xml envelope in a cfhttpparam, e.g. as follows:

<cfhttp
url=“https://ws.staging.training.gov.au/Deewr.Tga.WebServices/OrganisationService.svc/Organisation12
method=“post”>

        &lt;cfhttpparam type="header" name="content-type" value="application/soap+xml" /&gt;&lt;!---text/xml---&gt;
        &lt;cfhttpparam type="header" name="SOAPAction" value="http://training.gov.au/services/IOrganisationService/Search"/&gt;
        &lt;cfhttpparam type="header" name="accept-encoding" value="no-compression" /&gt;
        &lt;cfhttpparam type="xml" value="#trim(sXML)#"/&gt;

  &lt;/cfhttp&gt;

As discussed here:

http://www.bifrost.com.au/blog/index.cfm/2010/6/15/WSS4CF-Secure-Webservices-with-ColdFusion

the example in the wiki is the standard usage:

http://wss4cf.riaforge.org/wiki/

Adding the info you need to the underlying axis WS object is going to work best. If you have to do it with raw http calls, you might be able to get the headers etc from the methods in the CFC.