tags:

views:

8036

answers:

15

Any JAVA opensource api for generating a SOAP request from a WSDL file? Thanks

+5  A: 

Yes, pretty much any WS stack you care to name. JAX-WS-RI, Axis, XFire, CXF... take your pick, they all do what you want, just read the docs.

If you want a more specific answer, you'll need to ask a more specific question.

skaffman
As a side note, JAX-WS is included in the JavaEE 5 download. It is also present in JavaSE 6 and newer.
R. Bemrose
A: 

I used xmlspy tool to get this, but wanted to programmatically generate soap requests readin in WSDL files. This gets complicated when it comes down to generate the right soap elements if the WSDL includes other nested XSD files

Also your pointers are too generic. Can you point me to a piece of code that does that?

We can't do the work for you. Download JAX-WS RI or XFire, for example, and read the docs around how to generate client stubs from WSDL.
skaffman
+1  A: 

JAX-WS 2.0 is included with Java Standard Edition starting with Java 6. It's a good place to start. JAX-WS 2.0 is also present in Java Enterprise Edition 5.

R. Bemrose
A: 

I always google before posting, Have not been able to find anyone to do this. I know with some work I can put this in place - was wondering is there is something I can use off the shelves, instead of starting my own implementation. GUI wise - I know tools out there, but i am not looking for those. So I will start digging into jax-ws then. Thanks

+3  A: 

Apache Axis has a very useful tool called wsdl2java. Basically, you pass this program a WSDL file and it generates a bunch of .java files, which (after compilation) can be used to submit a request and read the response for any operation defined in the WSDL.

NB: I'm referring to version 1.x of Apache Axis. I've no idea if this tool exists in Axis2.

Don
Yeah it is in Axis2, there is also a tool called wsimport in all java EE servers that does much the same thing.
James McMahon
+1  A: 
anjanb
A: 

BR, I looked at Metro - not good for what I am trying to do - don't want to get into this path.

This is what I want to do: simple as it sounds: I have a bunch of WSDL/Schemas and want to write a java program that would parse each WSDL and gen an equivalent xml SOAP request for each wsdl operation. Don't want to get into code gens and all that paths.

A: 

BR, don't want to underestimate your answer but is so easy to throw some lines with 'read help' , etc. Like I know all this java stuff, and not aware of anything that I can use to do this simple task. I thought it maybe some opensource alike what xmlspy gui does: you point the tool to the wsdl file, and it can gen a SOAP request out of that wsdl. I may use an xslt over wsdl to produce these SOAP requests which may be easier.

A: 

BR, also what I want to do(something that xmlspy does) is writing the thing in java and kind of like a parser which takes in a wsdl and outputs serveral xml SOAP request files each one for each wsdl operation.

+4  A: 

hi gogo,

I know of an open source utility, called SoapUI that does EXACTLY what you're asking for. SoapUI -- http://downloads.sourceforge.net/soapui/soapui-2.5-beta1-src.tar.gz?modtime=1222462819&big_mirror=0 . you can download the source code for this tool. See what the tool does.

I use this tool for generating the XML request for my Webservice projects. A lot of people use this tool for their webservices testing. So, if you want, you can look into the source code from this tool since it does exactly what you wish. But there might be a good amount of code for you to traverse BUT if you have the patience you will get well-tested code.

Good Luck

anjanb
A: 

Thank you Sir

A: 

Hi

I've come across the same question as you, I too started working with web service recently the first time and all these things on google confuse me ....

I'm just trying to make calls to other web service and I'm not providing any web service to others. I'm given a wsdl and xsd files for different message format. all I need also is a piece of code to take wsdl and create soap message to the wsdl end point.

So have you found any code that does what you/we want ?

Thank you.

A: 

hi, i am exactly doing the same thing, have WSDL file as an input. i need to parse that WSDl file( also XSD) and generate the SOAP message. please help me how to do all this programmatically. i am trying using JAX-WS API.

thanks in advance

A: 

If your WSDL is reachable on the internet you can use a generic SOAP client with Web UI.

baranco
A: 

So, did anybody got a way to parse through a given WSDL url and get a blank SOAP Envelope (XML) ?

Can JAX-WS do that? I saw that it can be used to generate Java artifacts and JAXB classes that can then be used to create the filled SOAP envelope and invoke the service.

But, I just need a plain SOAP Envelope as an XML. I do not need Java and JAXB classes.

Any help would be really useful and greatly appreciated.

Thanks Bhaskar

Musical-Poet