开发者

How can I call a ColdFusion cfc web service from classic ASP?

开发者 https://www.devze.com 2023-03-23 03:31 出处:网络
I have created a cfc which contains different functions. All these function have remote access. I want to call these functions from my external class开发者_运维知识库ic ASP page.

I have created a cfc which contains different functions. All these function have remote access.

I want to call these functions from my external class开发者_运维知识库ic ASP page.

In ColdFusion, we create an object and call the methods. How can I do this in classic ASP?


CF provides a SOAP interface. I'm not familiar with ASP but I imagine it is capable of SOAP calls. The address for the CFC for SOAP is the CFC's URL plus "?wsdl", where you will see the interface information in an XML format (example). You can use a WSDL viewer to look at the information as well.

Depending on what you are trying to accomplish and the complexity of the API it may be easier to use HTTP to call the CFC which ColdFusion provides. If the CFC is at http://mydomain.com/api.cfc you could use HTTP to simply hit the CFC with a method argument http://mydomain.cfm/api.cfc?method=testfunction. This will return a WDDX response for which there is likely a libarary available for ASP. If you include returnformat=json then you can get a JSON response. Any simple arguments such as numbers and strings can be sent to the CFC through a GET or POST but I'm not sure if more complex arguments can be passed in this way.

0

精彩评论

暂无评论...
验证码 换一张
取 消