yeah m facing the same problem too. Seems like xfire tries to connect before
it actually sets the username and password attributes!! Could somebody
please help????
EricMacau wrote:
>
> Hi Timek,
>
> I read the document from XFire, but it seems not work or I made some
> mistake. The following is my simple code but it just raised HTTP 401
> Uauthorized error.
>
>
>
> Client client = new Client(new
> URL("http://localhost:8080/xfire/services/HelloService?wsdl"));
> client.setProperty(Channel.USERNAME, "user");
> client.setProperty(Channel.PASSWORD, "user");
>
>
>
> And the following is the exception:
>
> java.io.IOException: Server returned HTTP response code: 401 for URL:
> http://localhost:8080/xfire/services/HelloService?wsdl
> at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1174)
> at java.net.URL.openStream(URL.java:1007)
> at org.codehaus.xfire.client.Client.<init>(Client.java:246)
> at demo.TestClient.main(TestClient.java:19)
>
>
>
>
>
> Tomek Sztelak wrote:
>>
>> Hi
>>
>> On 6/10/07, EricMacau <[EMAIL PROTECTED]> wrote:
>>>
>>> Hello,
>>>
>>> I am a beginner in xfile. How can I usee Client API to pass a
>>> username/password for HTTP Basic Authentication?
>>
>> Take a look at http://xfire.codehaus.org/HTTP+Transport
>> and
>> http://xfire.codehaus.org/Client+API
>>
>>> Or how can I pass the username/password for authentication in the client
>>> codes thatgenerated by the xfire client code generator?
>>
>> You can send your user/pass as SOAP header . If you check book sample
>> (examples folder in XFire distribution) you will find full example how
>> to add soap header elements using outhandler and how to retrieve such
>> info on server side.
>> Here
>> http://xfire.codehaus.org/Client+and+Server+Stub+Generation+from+WSDL
>> you will find info about how to add handlers to generated client.
>>
>>> Any XFire expert can teach me, please?
>>
>> Sorry, all XFire exeperts are currently busy so i'll try ;)
>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/HTTP-Basic-Authentication-tf3896553.html#a11046372
>>> Sent from the XFire - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list please visit:
>>>
>>> http://xircles.codehaus.org/manage_email
>>>
>>>
>>
>>
>> --
>> -----
>> When one of our products stops working, we'll blame another vendor
>> within 24 hours.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>>
>> http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/HTTP-Basic-Authentication-tf3896553.html#a12459834
Sent from the XFire - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email