|
Home > Archive > BizTalk Server Orchestration > January 2005 > Publish webservice allow anonymous access
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Publish webservice allow anonymous access
|
|
|
| In Biztalk WebService Publish Wizard, I checked "Allow anonymous
access" and publish success. After deploy, bind the SOAP receive port
and start the orchestration, I write a window form and add the
webservice to web-ref, and test it by form button. I can get correct
return result via the form.
But if I uncheck "Allow anonymous access", the window form produce
error-exception "request fail, HTTP 401: Access Denied."
How should I assign special account to access (or something like it)
the webservice after published?
the "Allow anonymous access" seems that not security...
Thanks for any advice, David.
| |
| Matt Milner 2005-01-11, 5:53 pm |
| YOur client needs to send credentials to the web service. The proxy class
in your client has a property for credentials. You should be able to add
new credentials to this property and then make your request securely.
//do this in the startup code for your windows application
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
//then do this on your service class
myservice.Credentials = System.Net.CredentialCache.DefaultCredentials;
//now your login credentials will be used to try and authenticate to the web
service.
Matt
"David" <calebchen@walla.com> wrote in message
news:1105432674.454839.189190@f14g2000cwb.googlegroups.com...
> In Biztalk WebService Publish Wizard, I checked "Allow anonymous
> access" and publish success. After deploy, bind the SOAP receive port
> and start the orchestration, I write a window form and add the
> webservice to web-ref, and test it by form button. I can get correct
> return result via the form.
>
> But if I uncheck "Allow anonymous access", the window form produce
> error-exception "request fail, HTTP 401: Access Denied."
>
> How should I assign special account to access (or something like it)
> the webservice after published?
> the "Allow anonymous access" seems that not security...
> Thanks for any advice, David.
>
| |
|
| It works after I set DefaultCredentials,
Thank you, Matt.
David
| |
|
| Matt, If I do not want to set "Allow anonymous access", how do I assign
a special account & password to outside application/component? Or I
just write 2 argument (account and password) in my webservice to
determine logger?
Can I do it like this stupid code:
myws(string data, string account, string password)
{
if (account == "Matt" and password =="1234" )
.....
}
Thanks, David
| |
| Matt Milner 2005-01-12, 8:46 pm |
| I'm not quite sure what you are trying to do with the account and password.
If you want to call an external component with these, you can either, hard
code or configure them, have them passed in as you show below (use ssl
though), or use basic authentication for your web service in which case you
can get the username and password from the headers (base 64 decode them and
you're good to go).
Matt
"David" <calebchen@walla.com> wrote in message
news:1105503753.076036.276440@f14g2000cwb.googlegroups.com...
> Matt, If I do not want to set "Allow anonymous access", how do I assign
> a special account & password to outside application/component? Or I
> just write 2 argument (account and password) in my webservice to
> determine logger?
>
> Can I do it like this stupid code:
> myws(string data, string account, string password)
> {
> if (account == "Matt" and password =="1234" )
> .....
> }
>
> Thanks, David
>
|
|
|
|
|