Skip to main content
Participant
March 6, 2017
Question

Moving from CF9 to CF11, webservices and POST bodies

  • March 6, 2017
  • 1 reply
  • 208 views

Most CF coders are familiar with passing parameters to web services via the URL such as:

http://mydomain.com/service.cfc?method=login&username=test&password=pw1

Concerned about security of using a GET request and unknown to me, one of our third party implementrs managed to get our service working by making a POST to the url:

http://mydomain.com/service.cfc?wsdl

With the header:

Content-Type: application/x-www-form-urlencoded

and inside the POST body this:

method=login&username=test&password=pw1

To my surprise, the above actually worked fine in CF9.  We are now upgrading to CF11 and the vendor tells us that their code is all failing in our integration environment.  I tested it and it in fact doesn't work anymore in CF11 via that type of post.  I tried using both axis 1 and 2.

What can I do to make CF11 act the same as CF9 with this way of passing parameters?

This topic has been closed for replies.

1 reply

BKBK
Community Expert
Community Expert
March 7, 2017

The URL points to the WSDL, so it's a webservice. As such, the caller should use the proper syntax. In ColdFusion the calling code is something like:

<cfset wsObject = createObject("webservice", "http://mydomain.com/service.cfc?wsdl")>

<cfset returnValue = wsObject.login("test","pw1")>

Recall: http://mydomain.com/service.cfc?method=login&username=test&password=pw1 should work for CF9 as well as CF11, but it is not a webservice call.