473,830 Members | 2,191 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling a webservice from my ASP.NET application

J-T
I 'm calling a web service using this code:

MyService service = new MyService();
service.Credent ials = System.Net.Cred entialCache.Def aultCredentials ;

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

MyService service = new MyService();
service.Credent ials = new
NetworkCredenti al("myLogin","m yPassword","myD omaine");

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

Thanks
Nov 19 '05 #1
4 1945
Hi J-T :

Impersonation generally does not work in this scenario, because the
user's credentials will have to make 2 hops, which isn't allowed
without some special configuration:

http://odetocode.com/Blogs/scott/arc...2/24/1053.aspx

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 25 May 2005 17:38:05 -0700, "J-T" <J-*@microsft.com> wrote:
I 'm calling a web service using this code:

MyService service = new MyService();
service.Creden tials = System.Net.Cred entialCache.Def aultCredentials ;

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

MyService service = new MyService();
service.Creden tials = new
NetworkCredent ial("myLogin"," myPassword","my Domaine");

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

Thanks


Nov 19 '05 #2
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

"Scott Allen" <sc***@nospam.o detocode.com> wrote in message
news:ku******** *************** *********@4ax.c om...
Hi J-T :

Impersonation generally does not work in this scenario, because the
user's credentials will have to make 2 hops, which isn't allowed
without some special configuration:

http://odetocode.com/Blogs/scott/arc...2/24/1053.aspx

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 25 May 2005 17:38:05 -0700, "J-T" <J-*@microsft.com> wrote:
I 'm calling a web service using this code:

MyService service = new MyService();
service.Crede ntials = System.Net.Cred entialCache.Def aultCredentials ;

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

MyService service = new MyService();
service.Crede ntials = new
NetworkCreden tial("myLogin", "myPassword","m yDomaine");

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

Thanks

Nov 19 '05 #3
Hey J-T:

On Thu, 26 May 2005 09:56:34 -0700, "J-T" <J-*@microsft.com> wrote:
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).

--
Scott
http://www.OdeToCode.com/blogs/scott/

--
Scott
http://www.OdeToCode.com/blogs/scott/
Nov 19 '05 #4
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
"Scott Allen" <sc***@nospam.o detocode.com> wrote in message
news:lc******** *************** *********@4ax.c om... Hey J-T:

On Thu, 26 May 2005 09:56:34 -0700, "J-T" <J-*@microsft.com> wrote:
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).

--
Scott
http://www.OdeToCode.com/blogs/scott/

--
Scott
http://www.OdeToCode.com/blogs/scott/

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1734
by: Rob Kellow | last post by:
Hello, I'm working on an application for use within my company on our intranet that will be used to gather some information and store some of the info in a SQL Server database and the rest of the information will be used to initiate either a MS Word or MS Excel document. The applications (Word & Excel) reside on the users local system but the database is on the server. Since it is for internal company use I'm not too concerned about...
3
9109
by: Mike | last post by:
Timeout Calling Web Service I am calling a .NET 1.1 web service from an aspx page. The web service can take several minutes to complete its tasks before returning a message to the aspx page. If the web service is taking a long time to complete, the aspx page returns a ‘The operation has timed-out.’ Message to the web browser after 100 seconds. I’ve added: <httpRuntime executionTimeout="300" /> to the web.config files
7
2073
by: WhiskRomeo | last post by:
I have a WIN .NET application that calls a web service to retrieve data. I deployed the application to a server and configured the webservice. The webservice and SQL Server 2000 database are on the same server. I installed the application on the server and everything runs fine. It simply opens a form and populates it with data via the webservice. The connection string is: packet size=4096;integrated security=SSPI;data...
5
1039
by: unwantedspam | last post by:
Hi, I am trying to write my first web service. I have the following code: Imports System.Web.Services Public Class Service1 Inherits System.Web.Services.WebService Private _ErrorText As String
4
21415
by: luckyabhishek | last post by:
Hi I am using a java webservice in a .NET application. The xml type of a field in this webservice is xsd:datetime. When i call the webservice from the application i get a deserialization error on the java webservice side. It says "Can not create instance of from string with schema type http://www.w3.org/2001/XMLSchema]". Can anyone let me know what could be the problem. I am just sending a DateTime object which i get from a VB...
5
2602
by: joeblast | last post by:
I have a Web service that gets the financial periods and hold a reference to a disconnected dataset built at initialization. Web methods work on the dataset inside the web service. Everything is fine so far. My problem is that when I call a web method to modify the dataset inside the Web service it is never updated and I get no errors. currentPeriods method will always give me 1 even if I call ChangeDataset and call currentPeriods...
7
10878
by: GD | last post by:
Hi, I am trying to call a webservice from a windows service application. It works only if I launch the windows service app from VS.Net 2005 (Worked around from Main()) or from a winform test application. However, it generates a kind of security error after I install and start the service in my Window Server machine. I believe that it is related to authentication. The following is the sample code: HttpWebRequest obj =...
0
1753
by: =?Utf-8?B?QWRhbUM=?= | last post by:
Hi, I'm wondering if you can help. We have a classic asp application that creates and posts some XML using the SOAP format to a .NET WebService. The WebService and the asp are on the same IIS server , which is IIS6.0. On first calling the WebService the asp page either hangs or returns Active Server Pages error 'ASP 0113' Script timed out /adminw/logon/DeleteUser.asp
4
3876
by: gengyue | last post by:
Hi, I need to call .Net webservice from my JSP page. My application is Struts application. It is deployed on Oracle application server. Here is the whole process. I have a login form. When user hit login button, my Action class will validate the user information and send his information to the other site by calling .Net web service, so the other site can extract these information. So, in my jsp, I am using Javascript and webservice.htc to...
4
4136
by: gengyue | last post by:
Hi, I need to call .Net webservice from my JSP page. My application is Struts application. It is deployed on Oracle application server. Here is the whole process. I have a login form. When user hit login button, my Action class will validate the user information and send his information to the other site by calling .Net web service, so the other site can extract these information. So, in my jsp, I am using Javascript and webservice.htc to...
0
9793
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10774
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10202
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9314
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7746
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6950
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5780
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3076
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.