I need a tool that I give wsdl url and operation name after return me soap message construct.
There are some sites making this but I dont find any solution.
This sites http://www.soapclient.com/soapclient, and I m using Java.
Is there any solution for this problem axis2?
Have a look at SoapUI
Indeed soapUI can be used to create sample requests, when creating a new project in soapUI select the checkbox shown in the picture below, and in your navigator tree you should see "Test" which can be expanded to see sample requests.
Related
I'm starting to design a RESTful server with Java, using the Httpserver class. I have a couple of tasks to do let's start with one:
The user must be able to discover the uri with a Read (GET) call to a predefined URI: "/index"
Like this: GET /index -> {/a, /b, /c}
everything is contained in a repository (a folder), how do I link that folder to / index?
probably it's a simple thing, but I don't know where to start, I accept advice and even sources that you can consult. Thank you
I created the server and it works, I leave you the code server codeserver code
I also created an index page where I put all the call handling for the index page into it
indexPage
There are a number of ways you can do this
HATEOAS describes a way to return links as part of a response - see here https://en.wikipedia.org/wiki/HATEOAS
you could also use OpenAPI to provide documentation for your apis to describe what apis are available https://swagger.io/solutions/api-documentation/
I was searching on google but not found any helpful article on this.
I want to invoke webservice methods.I have wdsl and i have to invoke dynamically without creating any stubs as such.Any example will be more helpful.
Hope you are searching for a tool for invoking web services. Better user Soap UI
Soap UI is a tool which acts as a client to connect with your webservices.
Interesting question. After a little research i found this project on github which seems to fulfill your needs.
https://github.com/reficio/soap-ws
Here is some sample code from the github site which seems very easy and straightforward.
Consume a Web-Serivce in 60 seconds
Let's consume the CurrencyConverter Web-Service. Thanks to the fluent builders the API is straigtforward and intuitive. Does it need any explanation? Welcome to soap-ws :)
Wsdl wsdl = Wsdl.parse("http://www.webservicex.net/CurrencyConvertor.asmx?WSDL");
SoapBuilder builder = wsdl.binding()
.localPart("CurrencyConvertorSoap")
.find();
SoapOperation operation = builder.operation()
.soapAction("http://www.webserviceX.NET/ConversionRate")
.find();
Request request = builder.buildInputMessage(operation)
SoapClient client = SoapClient.builder()
.endpointUrl("http://www.webservicex.net/CurrencyConvertor.asmx")
.build();
String response = client.post(request);
Soap Ui is a application used for testing the web service generated. You only need the Wsdl for doing the same.
here is a link.
right click the generated wsdl > run as > run in server.
copy the url from the address bar of the browser.
open soap iu and click on new project.
paste the url in the wsdl column.
the project will be listed with the name of the method.
expand the method and click on request1.
enter the values in the "?" which are the parameters to the method.
click the run button.
this a method for mocking the web service created without creating a client. The soap Ui application can work as client.
Hope this helps.
I am learning to make web services with eclipse, apache and axis 2 following this tutorial. I am able to generate web services, create and upload .aar files and generate web service clients just like in the tutorial. But when I go to test the client it is not generating proper responses...
PersonalInfoServiceStub stub = new PersonalInfoServiceStub();
GetContactInfo atn = new GetContactInfo();
atn.setPersonID(1);
GetContactInfoResponse c = stub.getContactInfo(atn);
System.out.println(c.get_return()); //returns null
// The Java Class that serves as the basis for the web service works well...
PersonalInfoService s = new PersonalInfoService();
System.out.println(s.getContactInfo(1).getStreet()); //returns main street
This is all very new for me (I am still pretty dependent on following the tutorial) so I am not sure what might be causing this issue or how I might go about debugging what's wrong. What might be causing the problem and how would I go about debugging it?
If I try to call the webservice in the broswer using this url:
http://localhost:8080/axis2/services/PersonalInfoService/getContactInfo?personID=1
I get this
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<ns:getContactInfoResponse xmlns:ns="http://webservices.com">
<ns:return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
</ns:getContactInfoResponse>
It looks like your client code is okay. The response from the server just doesn't contain any data. The simplest explanation is that the server sent back a response without any data. If I were you, I'd troubleshoot the server's behavior when it receives this request, rather than focusing on the client code.
I would start with Wireshark or tcpdump, this will help you capturing Network traffic that will help you debug at application and transport level what your Java code is generating and the response from server.
i want to invoke a web service based on the url and method name,when given the input parament in xml format ,i need to invoke the web service ,but i can't generate the client stub using tools like wsdl2java because the url and method name are given dynamically so these class aren't compiled.
for example,http://localhost:9090:/hello?wsdl there have a method
string sayhello(String []names); the input param likes <arg0>john</arg0> <arg0>lucy</arg0>
it seems that i need to generate soap request in code so is there any library can help me do this?
thank you for giving any recommendation!
That's possible and yes, you will need to generate the SOAP request yourself and also parse the reply yourself.
Some links to help with this including source code etc.:
SoapUI (complete source code of a generic SOAP client including a nice UI)
http://anshu-manymoods.blogspot.com/2009/10/how-to-simple-generic-soap-test-client.html
http://www.java-tips.org/other-api-tips/httpclient/how-to-send-an-xml-document-to-a-remote-web-server-using-http-5.html
http://biomoby.open-bio.org/CVS_CONTENT/moby-live/Java/docs/soapServlet.html
http://www.soapuser.com/ngx_22jul01.html
IF JavaScript is an option you can check this out...
There's SAAJ but it's pretty verbose.
If you can use Spring, Spring-WS has a number of client options.
You can always just build up the XML by hand, too (and parse the returned XML).
My inputs consist of a WSDL file and an operation name. I need to create a SOAP request and response XML instance after parsing the WSDL. What are my options to implement this? Which parser should I use? I tried wsdl4j. I was able to retrieve the Schema Object. But how do I convert this schema object to a SOAP Request in XML? I was not able to figure that out.
Did you try to use soapUI software ? I always used it in order to validate my manualy written SOAP requests (to a WSLD webservice), but it could give you the target direction
Try membrane SOA SOAP Model library.
Example code:
http://www.membrane-soa.org/create-soap-request.htm
Note: This is not a promotion. Membrane SOA is apache 2.0 licence project and I have no relation with it, except a user. Adding URL is only for helping.