WSO2-ESB: SOAP Mediator from wsdl - wso2

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..

Related

WSDL for WSO2 ESB proxy service

I have done a few use cases on WSO2-ESB including protocol mediation with transformation and service-chaining.
In all of them I had to manually write the wsdl for the proxy service. Having experienced other vendor products including Oracle and Tibco where wsdl generation is done by the tool.
Would it be right to assume in WSO2 ESB one needs to manually write the wsdl file to expose a proxy service on any protocol, do not see any documents calling that out.
Considering the usage of wsdl in practical use cases.
I have seen posts stating "you can give the WSDL available at your Axis2 service" but most of real time use cases would not be pass through and have custom request and response.
Thanks,
Wajid
I'm also confused with manual wsdl creation. As far as I can see there are gaps in wsdl proxy description. When I do wsdl proxy with WSO2 I have to indicate wsdl to expose
its either as:
"none" and I have only mediate function exposed
"same contract" and this breaks the whole idea of proxy because after that clients read original wsdl and go straight to original server access point.
or and I have several options to make my own wsdl.
With rich SOAP API (hundreds of methods) none of above work well, considering that manual support of exposed WSDL is rather cumbersome.
I wonder if there is more adequate way for proxying WSDL?
You can use java2wsdl generator tool to achieve the WSDL generation.
For the proxies, if you try to restrict access for some operations in your backend service, you can attach customized wsdl to the proxy.
The customization has to be done by yourself and it is simple..
If you want to generate a wsdl fro your service, jsut deploy the service in wso2as, and check the service dashboard, wsdl option to view the wsdls.

Client Generation in web service(jax)

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.

Send/Receive a SOAP request using SPRING JAVA

I am new to Spring web services. I am going to create an xml request, and send it as a SOAP request to a web service and receive the response.I read different documents but still confused as I could not find a working sample yet.
I know that I should use WebServiceTemplate and WebServiceMessageSender, SaajSoapmessageFactory (please let me know if I am wrong) but not sure how to use them.
Do I need WSDL? if yes why?
If you have any sample code please send me to get clear on it.
Thanks
If you want to send SOAP requests, you would like to be a SOAP client. Seems like you want to use spring-ws project. Check out their great documentation on the client side. The same documentation will guide you through the process of creating a server. There are plenty of examples and ready-made configuration snippets waiting for you.
Spring-WS is built on top of XML Schema description of your message, so you will need WSDL to generate e.g. JAXB models of your requests and responses.
AFAIK, for "web services" , the WSDL file is the machine blueprint of the "ports" as they are called However! ports in WSDL "means" java language(or any other programming language used with a routine or sub or procedure or function) method and has a specific naming scheme associate the .wsdl xml file(template of the service). Each WSDL port(language method) has specifications of return value and data specifications for how to feed it arguments and their type values.

Consuming SOAP web services without the add reference approach

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.

Send XML file to Web Service using Java

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.