Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I consume a ColdFusion webservice from C#?

I'm trying to use a webservice with the endpoint https://services.example.com/ASP_SecureWebServices.cfc?wsdl.

In the documentation I have this:

Request

<authorise>
  <site>xxx</site>
  <login>xxx</login>
  <password>xxx</password>
  <partnerid>xxx</partnerid>
  <wstype>xpt_exhibitors</wstype>
</authorise>

Authenticated Response

<authorisation>
  <service>getAuthToken</service>
  <authorised>OK</authorised>
  <authtoken>255461</authtoken>
</authorisation>

I’ve never used ColdFusion before, so I don’t understand how to make the request. Can anyone assist?

I’ve added a service reference like this:

Screenshot

But I don’t get this method:

Screenshot

like image 473
Ateik Avatar asked Aug 20 '12 17:08

Ateik


People also ask

How do I call a Web service in ColdFusion?

To call web services from a Flash client, you can use Flash Remoting to call a ColdFusion component that calls the web service. The Flash client can pass input parameters to the component, and the component can return to the Flash client any data returned by the web service.

What is ColdFusion Web services?

The ColdFusion Web Services Engine performs the underlying functionality to support web services, including generating WSDL files for web services that you create. In ColdFusion, to consume or publish web services does not require you to be familiar with SOAP or to perform any SOAP operations.


2 Answers

You're actually hitting the CFC directly, but you add ?wsdl on the end to actually have it return the WSDL.

Also, all of your methods in that CFC that you want accessible will need access="remote".

So your actual endpoint would be closer to this:

https://services.example.com/ASP_SecureWebServices.cfc?wsdl
like image 51
Shawn Grigson Avatar answered Sep 28 '22 17:09

Shawn Grigson


Going to go out on a limb, but my guess from the documentation is that the method you need to access is called authorise. With that in mind, you would call the web service as follows:

https://services.example.com/ASP_SecureWebServices.cfc?method=authorise&site=xxx&login=xxx&password=xxx&partnerid=xxx&wstype=xpt_exhibitors

By default, ColdFusion will return a WDDX packet; if you want JSON instead, add &returnformat=json.

like image 22
David Faber Avatar answered Sep 28 '22 16:09

David Faber