• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HttpClient and Webservice

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

Hi all,

i am trying to acheive SSO where in a user logs into 1 application and when he clicks a link to other application he should be logged in automatically, without second authentication. I have been asked to use via HttpClient ?

however I have been having the following questions in my mind.. i have tried googling but not able to join all the dots...

1. difference betwwen axis and httpclient
2. An example where in httpclient can be used to access the webservice for authentication

how do i communicate between these 2 applications..

any help will be appreciated.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HttpClient is something completely different than Axis. If you read their respective home pages you'll understand why. Why don't you use a proper SSO solution? The http://faq.javaranch.com/java/SecurityFaq lists several open source Java SSO libraries.
 
Anil Karamchandan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dittmer,

thanks for the reply. I had gone through axis and have worked on that... however what i am not able to visuallise it is using httpclient and web service how are you going to provide SSO ?

COuld you please help me with tht !

thanks !
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's no connection between Axis and HttpClient; what makes you think there is (unless you were thinking of using HttpClient as a WS client for Axis, but it doesn't sound as if you are) ?

SSO is provided by using an SSO library, not through Axis or HttpClient.
 
Anil Karamchandan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks dittmer,

If i could put it in other way, can httpclient be used to invoke a webservice ?
and what is the need for having an httpclient, i could direclty call a webservice .. am i correct ?

thanks !
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

can httpclient be used to invoke a webservice ?


Yes.

what is the need for having an httpclient, i could direclty call a webservice .. am i correct ?



If by "direct" you mean from within some Java client code, then you're correct. Most (probably all) SOAP stacks have a tool that can generate Java client code to access a WS; generally it works by looking at the WSDL of the target WS. That generated client code would be much easier to work with than to use HttpClient. (The tool that ships with Axis is called "wsdl2java".)
 
Anil Karamchandan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Dittmer,

so httpclient is another way by invoking a webservice.. I was not aware of that.. thanks for clarifying...

Do you have any idea how we could use httpclient to invoke a webservice.. ie if I have to use httpclient - how my request is going to be converted to xml.. and how abt the destination ?

Is this correct ---
1. Make an httpclient request.
2. In the request I would be have a destination url
3. This request is in the xml format ( for soap to undustand)
4. At the server I read the request and process it ..

If you could please light up your thoughts on this.. it would be of great help.. truely speaking i need to have a bigger picture in mind how I would be going about using httpclient to request a webservice for authentication..

I hope you undustand my problem.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you profoundly misunderstand what HttpClient is and does. It's a library for making HTTP requests programmatically; it has no WS capabilities. If you want to use it for making WS requests (why?), then you have to create all the SOAP involved in your own code - not a trivial undertaking.

Maybe it's time to take a step back and ask WHY you want to use HttpClient. You keep talking about authentication and SSO, but you have not said why you wish to avoid implementing a proper SSO solution.

The initial question also mentions "applications", not "web services" - what's the connection between the two?
reply
    Bookmark Topic Watch Topic
  • New Topic