Title: RE: .Net Client for Axis Service

Hi all,

I have got the servlet solution to work :-).  I made a servlet that checks if there is any auth information in the request.  If there is not it responds with a 401 and the WWW-Authenticate header.  If there is auth information, it forwards the response to the axis servlet.  I made this servlet the service endpoint for the MS clients and it works great.

I tried this solution yesterday and it didn't work, but when I checked it I had WWW_Authenticate instead of WWW-Authenticate as the header (oops).

As was discussed before the MS client sends the auth information only after it gets the WWW-Authenticate header.

Also it seems that you do not have to use the Credential cache it works for me simply with this code:

                ResourceServices service = new ResourceServices();
               
                NetworkCredential myCred = new NetworkCredential("user","pass");
                               
                service.Credentials = myCred;  
               
                Result.Text = service.getUserResources(email,period);

Hope this helps...

Thanks,

RJ

>List:     axis-user
>Subject:  RE: .Net Client for Axis Service
>From:     Drew Haller <[EMAIL PROTECTED]>
>Date:     2002-06-12 0:26:04
>
>
>In .net when you set the credentials of your proxy, the client first sends
>the request with out the auth header and will retry if challenged.  The
>server needs to respond with a 401.  I believe you can do that by throwing
>an AxisFault.
>
>
>-----Original Message-----
>From: Jones, Rhys [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, June 11, 2002 1:40 PM
>To: '[EMAIL PROTECTED]'
>Subject: RE: .Net Client for Axis Service
>
>
>
>Thanks Vidyanand,
>
>I can't get the method of sending the WWW-Authenticate header back to the
>client to work.  I am curious of how you changed the GetWebRequest() method
>to send the correct headers.  It does seem like the hard way to do it, but
>it sounds like the only way that works so far.
>
>I posted a message to an MS forum to see if they had any answers as to why
>the .Net client won't send the auth headers.  I'll let you know if anything
>comes out of it.
>
>Thanks for your help,
>
>RJ
>
>List:     axis-user
>Subject:  RE: .Net Client for Axis Service
>From:     "Vidyanand Murunikkara" <[EMAIL PROTECTED]>
>Date:     2002-06-11 19:40:11
>
>Hi Rhys
>
>check this out http://marc.theaimsgroup.com/?l=axis-user
<http://marc.theaimsgroup.com/?l=axis-user
><http://marc.theaimsgroup.com/?l=axis-user
<http://marc.theaimsgroup.com/?l=axis-user&m=102224516027914&w=2>
&m=102224516027914&w=2>
>&m=102224516027914&w=2  . Similar problem But there is no good solution
>to it.
>
>But there is one way you can make it send the required headers. But it
>involves changing the Client code quite a bit. Let me know if you want
>such a solution. And I am not sure whether it will break other stuff in
>.net.
>
>Vidyanand
>
>-----Original Message-----
>From: Jones, Rhys [mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ]
>Sent: Tuesday, June 11, 2002 9:35 AM
>To: '[EMAIL PROTECTED]'
>Subject: .Net Client for Axis Service
>
>
>
>Hi,
>
>I'm sorry if this is off topic, but here I go.....
>
>I am trying to get a .Net client to talk to an existing Axis service
>which works with java clients.  Right now access to the service is
>controlled using a handler that checks basic authentication.  At first I
>used the following C# client code to access the service:
>
>               ResourceServices service = new ResourceServices();
>               service.PreAuthenticate = true;
>
>               NetworkCredential myCred = new
>NetworkCredential("user","pass");
>                CredentialCache myCache = new CredentialCache();

>                myCache.Add(new Uri(service.Url), "Basic", myCred);
>                       
>                service.Credentials = myCache;
>                Result.Text = service.getUserResources(email,period);
>
>With this code the handler throws an AxisFault since it is not getting
>any auth information in the header.  The "PreAuthenticate" seems to do
>nothing.  I read some earlier posts which indicated that if I got the
>handler to return a "401" that the .net client would then send the auth
>header.
>
>I then made a servlet that checks if there is any auth info in the
>header and which forwards the request to the Axis servlet if there was
>or returned a 401 response if there wasn't.  Again no luck.  The .net
>client just threw an error that a 401 was returned.
>
>If anyone could help me out with this it would be much appreciated!
>
>Again, sorry if it is off topic.
>
>Thanks!
>
>RJ

Reply via email to