credentials for web service

  • Thread starter Alexandru Florea
  • Start date
A

Alexandru Florea

Hello,

Can anyone explain to me, please, how to set the credentials to acces a web
service in compact framework ?

I created a simple Window application to test this on the desktop computer.
Using CredentialCache class is working just fine in .Net framework, but the
compact framework doesnt's support that class !!!

=================< this is work >==================
phws3001WebService.PreAuthenticate = false;
NetworkCredential myCred = new NetworkCredential( LOGIN_NAME, LOGIN_PASS );
CredentialCache myCache = new CredentialCache();
Uri myUri = new Uri( phws3001WebService.Url );
myCache.Add( myUri, "basic", myCred );
phws3001WebService.Credentials = myCache;
=========================================

If I don't use the CredentialCache class, than it doesn't work at all

================< this is don't work >=================

phws3001WebService.PreAuthenticate = false;
NetworkCredential myCred = new NetworkCredential( LOGIN_NAME, LOGIN_PASS );
phws3001WebService.Credentials = myCred;
================================================

The NetworkCredential class don't even let me specify the type of
authentication !!!!
So how can I set the "basic" authentication type without using
credentialcache ?

Thanks,
Alex
 
A

Alexandru Florea

Yes, I tried. But don't want to work.
I allways got that error message:

"Client found response content type of 'text/html' but expected'text/xml'.
The request failed with the following message:
The trust relationship between this workstation and the primary domain
failed."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top