This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Web Services and the fly likes confused that if web service can be consumed using wsdl URL then why is endpoint needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "confused that if web service can be consumed using wsdl URL then why is endpoint needed" Watch "confused that if web service can be consumed using wsdl URL then why is endpoint needed" New topic
Author

confused that if web service can be consumed using wsdl URL then why is endpoint needed

Monica. Shiralkar
Ranch Hand

Joined: Jul 07, 2012
Posts: 652
I am confused regarding what is the significance of web service endpoint to the developer consuming it.

If a developer is given wsdl url. He will create proxy classes , set parameters and consume the web service. Now what is the role of end point here. The developer creating web service client was not now knowing the endpoint still he was able to consume it using wsdl. So what is the role of end point here?

thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42371
    
  64
The developer does know the endpoint - it's part of the WSDL. Whether it's used by a human being to create client code, or by a tool doing the same thing, is not important.


Ping & DNS - my free Android networking tools app
Monica. Shiralkar
Ranch Hand

Joined: Jul 07, 2012
Posts: 652
The developer does know the endpoint - it's part of the WSDL. Whether it's used by a human being to create client code, or by a tool doing the same thing, is not important.


My exact doubt now is that what is there for which we need to know the endpoint URL. For creating java client do we need to know endpoint url ,the answer is No we just need wsdl. So what is the significance of knowing the endpoint URL.I understood the significance of wsdl url but not the end point URL.

thanks


Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42371
    
  64
If you (or the tools you use to create client-side code) didn't know the endpoint, how could you access the WS?
Monica. Shiralkar
Ranch Hand

Joined: Jul 07, 2012
Posts: 652
Ulf Dittmer says
If you (or the tools you use to create client-side code) didn't know the endpoint, how could you access the WS?


I could do it using the below steps:




I added the wsdl URL in eclipse and created proxy classes. Then I created a client and consumed the web service.

Thanks

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42371
    
  64
And the WSDL contains the endpoint, without which the tool could not create code to access the WS.
Monica. Shiralkar
Ranch Hand

Joined: Jul 07, 2012
Posts: 652
Thanks. I got the point now. When we are accessing it using WSDL it is able to access the web service only because the wsdl has the end point in it.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42371
    
  64
Almost. You are not *accessing* it using the WSDL. You (or some tool) *creates client code* using the WSDL. After that, the information characterizing the end point is part of the code that is used to access the WS.
Monica. Shiralkar
Ranch Hand

Joined: Jul 07, 2012
Posts: 652
Almost. You are not *accessing* it using the WSDL. You (or some tool) *creates client code* using the WSDL. After that, the information characterizing the end point is part of the code that is used to access the WS.



Thanks. Is 'creating client code' to consume web services not same as 'accessing a web service'?

what i understood to be the definition of web service in my language is : Web services are application components with some functionality which are exposed over the internet which can be ACCESSED by another application or clients which can consume it by exchanging data in form of xml.

Please correct me if I am wrong with my definition of web service in my own words above.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42371
    
  64
Is 'creating client code' to consume web services not same as 'accessing a web service'?

No. To create the client code you'd access the WSDL, not the WS.

Web services are application components with some functionality which are exposed over the internet which can be ACCESSED by another application or clients which can consume it by exchanging data in form of xml.

The general definition of WS does not prescribe what the data format is. It is XML for SOAP WS, but can be something else. RESTful WS sometimes use XML, but more often use JSON (and occasionally something else entirely).
james cameron
Greenhorn

Joined: May 30, 2014
Posts: 2
Ulf Dittmer wrote:
Is 'creating client code' to consume web services not same as 'accessing a web service'?

No. To create the client code you'd access the WSDL, not the WS.

Web services are application components with some functionality which are exposed over the internet which can be ACCESSED by another application or clients which can consume it by exchanging data in form of xml.

The general definition of WS does not prescribe what the data format is. It is XML for SOAP WS, but can be something else. RESTful WS sometimes use XML, but more often use JSON (and occasionally something else entirely).


Hi Ul Dittmer,
This is quite an old thread but if you can please help me clear my doubt on end point URLs.
I am newbie hence asking this doubt.

We are having a SSL enabled SOAP web service in production which manages orders.
This web service has a single WSDL.


For each function of the web service it has a different end-point URL, a particular xml request format & response.
ie for fetching details order detail of the user it would have a single end point URL & particular request.
where as for fetching shipment detail it would have a separate end point URL & request xml fromat.

I have already obtained a java code which works perfectly for a http web service.
What it does is its sends a request to a webservice in MIME format and displays the response.

My doubt is that should the request be sent to the wsdl/Web service url or to the particular endpoint URL for each function of the web service.

I am able to perform the request response using SOAP UI. After creating the SOAP UI project with the WSDL, before sending the particular request, the end-point URL is changed accordingly.

Is both wsdl/webservice URL & end point URL is needed to obtain response for the request via java code?
james cameron
Greenhorn

Joined: May 30, 2014
Posts: 2
Let me try to be a little more blunt here. I am quite new to webservices.

Currently what I do in SOAP UI is as follows.
assume we the web service URL is https://omswebsvc.mycompany.com/webservices

I add "?wsdl" to it and start a project in SOAP UI.

Now for particular action or function I change the endpoint URL in SOAP UI as to https://wimp.mycompany.com:5000/com/Integration/WS/GetGuestOrderDetails.

now I send a request from SOAP UI in an xml format, after entering the username and password and authentication type to preemptive. The response is got back in an XML format.

Could some one explain what actually is happening here ? Am i actually senting the request response to the web service URL or the end-point URL ?? I am confused about this point.

Also could some one give me the basic steps to do the same in java - ie sending and receiving request and response as told above.( Code is not needed)

Thanks in advance !!!
Sujeeth Pakala
Ranch Hand

Joined: Mar 24, 2009
Posts: 94
Web service is extension of web application. I will try to explain web service with comparison to web application.

In web application, the web application descriptor where your web application is described (think of contract between your web application classes and container, although strictly it is not)is used by container to initiate your web components and enable web application listening on URL at a given path (URL / end point URL). The only user(consumer) for your web application classes is container and it is wrapping your classes and exposing as web application.

A web service application is used by consumers out side container. So for them, the application is described in a file (something like deployment descriptor) called web service description language (WSDL). Like a web application, WSDL file contains the URL path where application is listening is called "End point URL".

Like the classes of web application are used by container, WSDL file is used by the web service client (programs or container). Hence WSDL is used by the software programs which communicate with the service and not human beings ;-).

Is both wsdl/webservice URL & end point URL is needed to obtain response for the request via java code?


So, to develop service client, definitely WSDL (deployment descriptor) is needed and this contains end point URL (servlet path).

For your question in second post :

It is nature of web services that it returns the WSDL file when you enter this URL in this format <web service end point>?wsdl in browser. So, this is how soapUI reads the WSDL file and create sample request...

I think the term web service URL is incorrect instead end point URL is right word.

Follow this for java web service tutorials.

Hope this helps.

Regards, Sujeeth Pakala
SCJP, SCWCD, SCBCD, ICAD, XML Master Basic, Certified SOA Professional
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42371
    
  64
Is both wsdl/webservice URL & end point URL is needed to obtain response for the request via java code?

No, the WSDL is not needed to access a WS.

to develop service client, definitely WSDL (deployment descriptor) is needed and this contains end point URL (servlet path).

No, it's perfectly possible to develop a WS client without a WSDL. It's just a lot harder, and one would have to obtain the endpoint URL in some other way.

It is nature of web services that it returns the WSDL file when you enter this URL in this format <web service end point>?wsdl in browser.

No, that is just a convention used by some SOAP stacks. Not all work hat way, and it's not standardized.
Sujeeth Pakala
Ranch Hand

Joined: Mar 24, 2009
Posts: 94
Yes, I agree with you.

I am still thinking like beginner
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: confused that if web service can be consumed using wsdl URL then why is endpoint needed