简体   繁体   中英

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:

截图

But I don't get this method:

截图

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

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 .

检查WSDL以找出Web服务中公开的方法。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM