I have created a web service interface with Axis2, and it's working well. However, I want to pass arguments with the url pattern from the client side, so that I can make use of them in the service side (like "..//ADDRESS:PORT/service/ServiceName?ARGUMENT=123").
Can any one help me to achieve this?
Thanks
Rob
You could add a dispatcher class and implement in its 'invoke' method a
functionality which parses the URL, and then pass the arguments to your
service.
Related
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 made a web service endpoint and exposed a method now i wanna add more parameter to my method
so each time i change in my method i have to regenerate my client. Is there any way so that i
dont have to generate my client again and again.
No, there is no way. If you change the method then the WSDL file is changed also. Web services communicates through SOAP between client and server. When you deploy your web service application and it has been changed, so how then client supposed to know if there is a new method or a new parameters added if the classes was generated from the old WSDL file. Client will send a SOAP request according to the old WSDL and the server won't be able to understand the SOAP message received from the client if there was any changes made to WSDL part related to the received message.
You could design a better webservice/endpoint that accepts a standalone xml document as argument so that the operation signature stays the same, even when you add more parameters.
More generally, it's bad form for a web service to expose it operations as literal method signatures.
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.
I would like to do something like this with Camel:
from(Web_Service_1_URI).to(Web_Service_2_URI).to(Web_Service_3_URI).
So basically Web-Service1 acts as a facade for Web-Service2 and Web-Service3 (first Web-Service2 is called, than the result serves as input for Web-Service3). The result is finally returned to Web-Service1.
How would I do this using Camel?
regards,
F.
You will use the pipes and filters EIP
http://camel.apache.org/pipes-and-filters.html
And you can use camel-cxf component. Something like
from("cxf:bean:ws1").to("cxf:bean:ws2").to("cxf:bean:ws3");
But the WSDL of the 3 web services have to "fit". Otherwise you will need to translate the message between the calls
http://camel.apache.org/message-translator.html
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.