I have created a cfc which contains different functions. All these function have remote access.
I want to call these functions from my external classic 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.
Related
We would like to know which IP called our CF8 SOAP webservice (powered by Axis 1) and which method are being invoked. IIS log only shows POST from local IP. How can I enable logging for published SOAP webservices?
Thanks
There is a function, isSoapRequest, that determines if a CFC is being called as a web service. You could use that and if true, then log.
Sadly, Henry, There is no such logging, built-into CF.
I thought by your subject you were referring to outgoing web service calls (from within CFML), which since 9.0.1 are indeed logged (whether you do a CFINVOKE or CFOBJECT call), including the URL (but not the method) in the webservice.log.
But you want to log incoming calls to CFCs serving as web services, and there is no built-in logging for those. Not even in good ol' FusionReactor (which logs many things CF does not).
This would be a good thing, so I'd suggest you file a feature request. Until then, it would be incumbent upon you to do your own logging within your CFCs, using CFLOG to capture that useful info you seek.
You may even want to write it up as a method that others could reuse (and who knows, if you look around, maybe you'll find someone else having already done it).
I have seen some of the SOAP- Example- Mediators. I have not found a transformation based on the endpoint-WSDL.
I want to send some nested named array in json or POX and that data should go into a complete namespaced headered (username, password) SOAP-Request based on the names.
All the examples I have found had either a very simple wsdl or the namespaces were static in the XSL-Transformation.
It should be possible to do that, as I see in for example php-NuSOAP. You feed it with a wsdl-endpoint, the operation you want to execute and the parameter-array, and it calls the Webservice.
I am looking for a solution which is not too much hardcoded for every single service, so the proxy still works when the wsdl changes and Server Clients get changed.
As far as I understand the payload factory mediator in (https://stackoverflow.com/a/12969814/2277620) you would have to hardcode the soap-format in the mediator.
If WSO2 is the wrong tool for that I'd like to have a hint which tool could help.
Thanks in advance!
Marco.
For my understanding, you want to have a proxy, but it's backend service/wsdl may vary..
What , you can do is, you can save the wsdl (dynamic wsdl)in registry and point that in your proxy. whenever you edit the wsdl, proxy will automatically adopt to that..But the request, which you send to your backend should follow the wsdl definitions..It is totally client side responsibility..
I am new to web services. I have a requirement in my project. They gave me a wsdl file and a web service link and document about the description of methods.
In the documentation there is method called retriveDocuments with request parameters request, loginUser, loginPassword, systemId, maxResults, searchCriteria.
They want me call webservice and get the required documents and show them in app.
My question is how do I call web service and how do I pass all these parameters and get the result?
Most likely this a SOAP service. Your programming language (such as Java) should have tools allowing you to generate a SOAP client for the service, using the WSDL. Once you have the cient code, it should be easy to pass your parameters, make the call, and get the result. There are lots of tutorials on the Web, but you can start researching from there.
I am looking to make a service agent in C# from scratch. If the contracts/XSD are shareable via WSDL or dll. How do I go about writing a light weight service agent that can be configured to make calls to the SOAP webservice. When you do an add reference I feel too much code is generated behind my back.
You can post data to a webservice using the following url structure:
http://mydomain.com/mywebservicedirectory/mywebservice.asmx/mywebservicemethod
Simply use an HTTP POST to pass data(typically xml/json) to the service and process the response.
I use a bassic soap template and XSLT to render it out for what I want. It isn't that fun if you need to call multiple methods. I'm simply calling the same method over and over so it's no big deal. Simple HTTP POST will do it, that's all WCF/ASMX does.
You can get the WSDL and use XSD.exe to generate the object classes for you.
I want to send an XML file to a Web Service.
The Web Service is a java application.
I know the endpoint of the Web Service.
Typically I know I have to create the request and send it as an http/https request.
What I want to know is what would I have to make to send the request - as in what development tool could I use e.g. Visual Web Developer (preffered as I am familiar with this) or Visual Studio? And what sends the request - e.g. another Web Service, a Website etc?
Where do I even begin with this?
Any comments are much appreciated.
Where do I even begin with this?
One purpose of a Webservice is loose coupling. So it depends on what you want to do. You can write a simple program in what ever language which constructs a request and sends it. You can write a Webservice on its own which uses the other Webservice to handle it's own requests.
You can handle this in a very simple or complex way. You only need to be able to generate a request (per xml) and send it.