axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Fiorentini <g.fiorent...@esalab.it>
Subject R: C#client & username
Date Thu, 11 Jul 2002 13:22:33 GMT
I guess that the problem is in your C# client that is unable to provide the
right
authentication schema (i.e. Basic). 
I don't know if the following can help you. Try using the CredentialCache
class instead.
I think, that can apply to your case, even if it's about WebRequest
context.....
-------------------------------
NetworkCredential myCred = new NetworkCredential("username","password");

 

CredentialCache myCache = new CredentialCache();

 

myCache.Add(new Uri("www.contoso.com"), "Basic", myCred);

myCache.Add(new Uri("app.contoso.com"), "Basic", myCred);

 

WebRequest wr = WebRequest.Create("www.contoso.com");

wr.Credentials = myCache;
-------------------------------
Hopes this can help you.
 
Regards.
 
-gf-


-----Messaggio originale-----
Da: Pop Marius [mailto:pop@regens.hu]
Inviato: giovedi 11 luglio 2002 14.07
A: axis-dev@xml.apache.org
Oggetto: C#client & username


 


hello everybody !
 
Could anyone of you help me ? I have the following problem:
 
on the server side I have :
 
public class ThrowHandler extends BasicHandler {
    public void invoke(MessageContext msgContext) throws AxisFault  {
        try {
      String user = msgContext.getUsername();
      if ("".equals(user) || (user==null))
           throw new AxisFault("aaaa","no user defined....",null,null);
 
        } catch (Exception e) {
            throw AxisFault.makeFault(e);
        }
    }
}

so I can catch the username which the java client side send it with the code
below:
     ...........................................................
     Service  service = new Service();
     Call     call    = (Call) service.createCall();
     call.setTargetEndpointAddress( new java.net.URL(m_https) );

     ...........................................................

     call.setUsername("XXX");
     call.setPassword("YYY");
 
so the question is: how could I send the username and the password from C#
client with the use of those classes
where I1ve defined a proxy class inherited from SoapHttpClientProtocol
 
I've tired with : this.Credentials = new
System.Net.NetworkCredential("XXX","YYY",""); but it didn't work.
 
point me in the right direction please, for any ideea I will be glad !
 
thanks in advance
 
Pop Marius Lucian


Mime
View raw message