Forums Register Login

HttpClient and Webservice

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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 !
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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 !
+Pie Number of slices to send: Send
 

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".)
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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?
It's fun to be me, and still legal in 9 states! Wanna see my tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 3959 times.
Similar Threads
Integration / SSO / Authntication issues
Implementing custom Realm to inject user Principals
Help needed to call a web service after TAM authentication - (401)Unauthorized
understanding the basic MVC flow with JSF
Dilemma
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:57:03.