wood burning stoves*
The moose likes Web Services and the fly likes After getting WSDL ? SOAP Confusion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "After getting WSDL ? SOAP Confusion" Watch "After getting WSDL ? SOAP Confusion" New topic
Author

After getting WSDL ? SOAP Confusion

Mike Thomson
Ranch Hand

Joined: Nov 07, 2007
Posts: 115
I am in process of learning web service. I have bought the book Monson Haefel book. I have some doubts in web services.

Before that I will tell my skill sets, so that it will be easy for you to judge how far your explanation will help me.I have 2 years of experience in Java and J2EE Technologies like (JSP, Servlets, and EJB) and done certifications in SCJP 1.4, SCWCD and SCBCD 2.0.

For example: I have a java program which adds two numbers and i want to expose this as service.

For this, What are the things I have to do?

First, I will have a Java interface for this and an implementation:

Then, I have to register this in UDDI/I can generate the WSDL which will be the web service interface so that the non-java client will also understand that he has to send two arguments for addition which will return the expected result.WSDL also tells where the service runs and other details.
Upto this i am clear. Now where comes the soap in this process? We will place the wsdl in common place or send the wsdl to the client thru email and he will understand everything. After client got the WSDL, what will the next step. Here only i am very much confused. I am not able to understand what is the use of SOAP and how it works? please throw some light on it. Can I get some links which will explain the complete end-end architecture diagram of initial request for the service and final response from the service to the client?



I have got a good chance of looking into a flash presentation for "What is SOAP" in wikipedia while googling and it's very simple. below is the url and it will be useful for many users in this forum:
http://searchwebservices.techtarget.com/searchWebServices/downloads/what_is_soap.swf

After seeing this documentation, I have understood that SOAP is used for sending the XML format file to the server since it won't be blocked by firewall as it sends over HTTP. After the client gots the WSDL, he knows what are the parameters to be send for adding two numbers, so he will send that details by writing SOAP message and send it to the server.
Whether my understanding is corect? please correct me if I am wrong..

If my above understanding is right, i have another doubt?
Now he server will get the SOAP request message thru HTTP. That is my java program will be in the server and I got the SOAP request message, how the SOAP message know the Java program. In between SOAP request and actual java program anything is there? Becuase the required parameters for addition is in SOAP request, but how the java (AddImpl program) will get it.?
[ November 07, 2007: Message edited by: Mike Thomson ]
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Have a look at this topic:
Basic doubts in Web services

Did any of the information help?
Mike Thomson
Ranch Hand

Joined: Nov 07, 2007
Posts: 115
usually i will look into all the threads to get some idea. And the link given by you is good and very helpful to me. Can you tell me whether my understanding in my above post is correct?
I have a cofusion in this part:

After seeing this documentation, I have understood that SOAP is used for sending the XML format file to the server since it won't be blocked by firewall as it sends over HTTP. After the client gots the WSDL, he knows what are the parameters to be send for adding two numbers, so he will send that details by writing SOAP message and send it to the server.
Whether my understanding is corect? please correct me if I am wrong..

If my above understanding is right, i have another doubt?
Now he server will get the SOAP request message thru HTTP. That is my java program will be in the server and I got the SOAP request message, how the SOAP message know the Java program. In between SOAP request and actual java program anything is there? Becuase the required parameters for addition is in SOAP request, but how the java (AddImpl program) will get it.?
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Originally posted by Mike Thomson:
In between SOAP request and actual java program anything is there? Becuase the required parameters for addition is in SOAP request, but how the java (AddImpl program) will get it.?


The tool used, something like WSDL2Java or Java2WSDL, will generate code, that when deployed on the web server will take the SOAP request, unmarshall the XML to Java parameters and then call your AddImpl class to perform the actual work. When your method returns its result the generated code will marshall the result to the XML payload, create a new SOAP response and place the XML payload into the body of the SOAP envelope. The completed SOAP response is sent back in an HTTP response.

If you haven't done so already, download tomcat and Axis 1.4 and then work through Creating Web Services with Apache Axis. That may give you a better feel for what is going on.
Mike Thomson
Ranch Hand

Joined: Nov 07, 2007
Posts: 115
Thanks for your quick reply. I am going to work on Axis 1.4 and tomcat as you suggest and come back if I hve any doubts in it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: After getting WSDL ? SOAP Confusion