Showing posts with label guess. Show all posts
Showing posts with label guess. Show all posts

Wednesday, March 28, 2012

web service 401 unauthorized

I am using Avanade ACA web services which I guess uses .net web
services under the wraps. My requirement is use windows authentication
and allow user identity to pass thru to the web service and then to a
database.
I have two websites in the same box - one is the UI and other is the
webservices. It works when I have anonymous clicked on in the
webservices but it does not work when I switch this off and windows
authentication on. It throws the exception - system.net.webexception
401 Unathorrized.
I have tried using
<system.net>
<defaultProxy useDefaultCredentials="true">
<system.net>
in the web services but with no success. I have also given all
permissions to the Network Service (default app pool identity) for the
file system for the web site.
Now this looks like a common problem with .net web services and I am
not sure what else I can try.
Anyone done this before or have some idea?
Thanks in advance
Kishana Webservice method call simply transmits a SOAP envelope; no windows
credentials are included. So using Windows authentication in the IIS without
some sort of mechanism to transmit credentials as one would get with a norma
l
browser request that knows how to reply to the www-authenticate challenge is
not going to work.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
"kishan.bisht@.gmail.com" wrote:

> I am using Avanade ACA web services which I guess uses .net web
> services under the wraps. My requirement is use windows authentication
> and allow user identity to pass thru to the web service and then to a
> database.
> I have two websites in the same box - one is the UI and other is the
> webservices. It works when I have anonymous clicked on in the
> webservices but it does not work when I switch this off and windows
> authentication on. It throws the exception - system.net.webexception
> 401 Unathorrized.
> I have tried using
> <system.net>
> <defaultProxy useDefaultCredentials="true">
> <system.net>
> in the web services but with no success. I have also given all
> permissions to the Network Service (default app pool identity) for the
> file system for the web site.
> Now this looks like a common problem with .net web services and I am
> not sure what else I can try.
> Anyone done this before or have some idea?
> Thanks in advance
> Kishan
>
On Mar 20, 12:46=A0am, Peter Bromberg [C# MVP]
<pbromb...@.yahoo.NoSpamMaam.com> wrote:
> a Webservice method call simply transmits a SOAP envelope; no windows
> credentials are included. So using Windows authentication in the IIS witho=[/color
]
ut
> some sort of mechanism to transmit credentials as one would get with a nor=[/color
]
mal
> browser request that knows how to reply to the www-authenticate challenge =[/color
]
is
> not going to work.
> -- Peter
> Site:http://www.eggheadcafe.com
> UnBlog:http://petesbloggerama.blogspot.com
> Short Urls & more:http://ittyurl.net
>
> "kishan.bi...@.gmail.com" wrote:
>
>
>
>
>
>
>
> - Show quoted text -
Thanks Peter.
So that means if I need to invoke web services programmatically from
the asp.net I will have to explicitly set user credentials on the SOAP
header.
Is there something built into the framework to do that?
Kishan

Monday, March 26, 2012

web service example

can anyone give me a real world example of a pretty basic webservice?
not asking for code.. I want a description. I guess I don't understand the point of them...
They are just a way to transmit data to apps from the web right?OK, say you have some code that gave you weather predictions, maybe the UK's MET Office has one.
Then companies like BBC, can use this in weather.bbc.co.uk to display the weather.
Maybe a uni exposes a web service with some very complex cool maths functions. This means developers can connect and use the functionality.

OK, here's a good one. MSN Messenger 7. Instead of using winsock I believe it uses a web service. Much better way of connecting, and much easier.

Also, say you have a web app, and a windows app, that use the same functions...both can connect to the web service, or the win32 app can use the web service to expose functions from a DLL on the web server.

There are loads of wb services out there. Most are free, some you have to pay for. There is a web site that is like a phonebook for free web services. Trying to think what it is. Nope it's gone. Will look for you.

Woof
well im thinking more along the lines of what I would use one for. (although those were still good examples)

for instance right now my one app checks for updates via an HTTP stream (you know sort of like the autoupdate app you worked on in vb6) and sends a querystring or form post to the url and the url figures out if an update is needed an outputs the appropriate text, like a yes/no, files to dl etc...

so i was thinking it might be better to use a webserver it connect and see if an update is needed. might be cleaner and less likely to error than just requesting an aspx page from my windows app to determine an update.
Yup. Very good example of a web service.
In fact, that gives me an idea ;)

Be wary though, there are some speed implications with web services. Not sure how they compare to LiveUpdate or your method :(

Woof
its very little data being passed so it wouldnt be an issue.. i was thinking of using a webservice just to poll my webserver to see if an update is available, the actual downloading and applying is done using conventional coding methods..
Personally I'd go with remoting for upades, but maybe it's just cos I know remoting... :)
what exactly is envolved in that?
A class that inplements marshalbyref and a couple of config files. It'll work straight from IIS, and you can binary format the communication (which is faster).
here's a full description:
http://www.codeproject.com/vb/net/RemotingTech.asp

If your interested let me know any I'll try and dig up some of my own examples.
well my issue is that my webserver is hosted by a 3rd party webhosting service. I have FTP access only. I can't customize or configure anything, only upload my pages/dlls. Also the app that has the autoupdating ability is a retail app, that people buy and use, so its not like an internal app being used by a company or something.
All you'd need to do is upload the dll and config file.

Monday, March 12, 2012

Web Services - Remoting and Asynchronous in Webmatrix?

Hi, I need to build an E-Commerce shopping cart which will be Asynchronous ... so I guess I will need Remoting and Asynchronous methods from web services ... my question is ... is that a MUST that I have to use Visual Studio.NET? Can I just use webmatrix?You can use Notepad if you like, as long as you do it right. If you need to create Assemblies, all the command line tools you need are free, and comes with the .Net SDK.

But then again, VS.Net will save you hours (days) of unnecessary work. You may find it expensive, but it's worth every penny.
Hi, I do have a copy of VS.NET CDs from my friend ... but, I can't even get through step 1 ... it said I dun have several software or something ... it's Enterprise version ... but I only need to use my IP address as a server ... so I selected Remote server and follow the lnk to how to setup a remote server ... but doesn't work ... still not allowed me to go on to steps 2, 3, etc. What should I do???
VS.Net consists of several CDs. The first you are required to run is Component Update. If you don't have this or any of the other CDs of, you cannot install VS.Net.

"Hi, I do have a copy of VS.NET CDs from my friend"

Do you own a license for this copy of VS.Net?
hello .. I have the original CD with me ... but its' my friend's ... does it make it diff that I can't get through step 1?
Having the original, as opposed to a copy I shouldn't imagine will make a difference, but you'll still need to license it. If you've already got a license, then I beleive you can get new media from MS, for a small fee (That way you're garaunteed to get a complete set of disks).

Alternatively, you could trySharpDevelop. It's a bit simpler than VS, but still very similar in look and feel, still does everything you're likely to need to do, and more importantly, it's free.