Calling a webservice from my ASP.NET application

J

J-T

I 'm calling a web service using this code:

MyService service = new MyService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

I was getting an "Access Denied" everytime, but it works when I use this
code :

MyService service = new MyService();
service.Credentials = new
NetworkCredential("myLogin","myPassword","myDomaine");



I have enabled impersonation by adding <identity impersonate="true" /> to my
web config and we are using windows authentication.What else should I add in
order to get it up and workin?



Thanks
 
J

J-T

Scott,I've seen all your articles (I sent my questions to you,but apparently
your comment part dosen't work;-).

The problem is that They have installed reporting services and our asp.net
application in the **same box** (which I know is not a good idea,but why I
don't know).Therefore that problem should not exist because as you mentioned
that's for the time you have reporting services and your app in two
different places.

I think I found the problem ,the person who has this problem is opening
another thread(than the asp.net thread) to call the webservice and the
reason he get the second logon page is that the token is not transfered from
the main thread to his newly-opened thread.

Can you guide me to something which shows the advantagesa dn disadvantages
of having RS and the main application in the same box?

Thanks alot Scott
 
S

Scott Allen

Hey J-T:

Scott,I've seen all your articles (I sent my questions to you,but apparently
your comment part dosen't work;-).

Oh - is this in the OdeToCode.com/articles area?
The problem is that They have installed reporting services and our asp.net
application in the **same box** (which I know is not a good idea,but why I
don't know).Therefore that problem should not exist because as you mentioned
that's for the time you have reporting services and your app in two
different places.

Yes - having them on the same machine should make it easier....
I think I found the problem ,the person who has this problem is opening
another thread(than the asp.net thread) to call the webservice and the
reason he get the second logon page is that the token is not transfered from
the main thread to his newly-opened thread.

Ah - that would be the problem. Only the original thread of the
request gets the impersonation token. I've heard in 2.0 they actually
propogate the impersonation token but I have not verified it this ...
Can you guide me to something which shows the advantagesa dn disadvantages
of having RS and the main application in the same box?

I sincerely apologize that the comments did not get through.

Off hand I don't know of any official documentation on the advantages
/ disadvantages. My personal opinion would be:

Advantages:

Easier authentication scenarios (impersonation works)
Faster response


Disadvantages:

Performance (SSRS can be a resource hog under load - if your user base
expands you may need to move RS to another machine anyway)

Licensing (You have to pay for a SQL License too).
 
J

J-T

Oh - is this in the OdeToCode.com/articles area?
Yes,couple days ago,I submitted a comment but never got appears(I'm an
every-day reader of yours;-))
I sincerely apologize that the comments did not get through.
I think I've leanrt enough from your weblog and OdeToCode.com in a way that
you **do not** need to apologize for my comment not going through.Such a
wonderful weblog.I love it

Thanks for the vaulable information.

Reza
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top