1

Most web service provide a WSDL Link. When you pass this WSDL link to Eclipse it generates the JAVA coded Client. When you Pass the WSDL Link to SOAPUI It generates the SOAP envelope.

the question is:

is there an API in java that will allow me to generate the SOAP XML programatically?

Something like this :

WSDLReader re = new WSDLReader("WSDLURL");
String s = re.getWSDL();

ADDITIONAL INFO: I found an API that does something similar, Its called SOAP-WS. but the example given in the document is maven based. I want it in normal JAVA, i.e. non-maven base.

2 Answers 2

1

I have solved this problem with the following link :
http://www.membrane-soa.org/create-soap-request.htm
This IS the answer to my question. just download the required JARs, include them in your project and use the attached example. after that , if you pass a WSDL file the program will generate the required SOAP request. This is for anyone that happens to have the same problem as i did. :)

Sign up to request clarification or add additional context in comments.

1 Comment

Hi Anas, you are right, its working. we are able to generate SOAP request, but I have a problem facing here. When we have more namespaces available in WSDL file, we are not getting the required namespace references generated in SOAP request. Because of this, we are facing issue with elements which have wrong namespace reference. Could you help me regarding.
0

I am against of messing the philosphy with coding but.

You should know that WSDL use XML for its own purpose. So on this fact, you can dwonload a XML file from given web adres. Then XML file do not differ from any other text file. So on this fact we can say thay problem is reduced do downloading and reading a text file.

To allow that you can use Java NIO, (example) to download the file.

1 Comment

The reading part is not the problem. but after reading it, how would i generate the SOAP ? the WSDL file looks nothing like the SAOP file. And every WSDL is different.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.