Call A WCF Service Outside Of The Impersonation Context?
Jul 30, 2010
I'm having problems with impersonation in WCF. Namely, I'm calling a named pipe service from within ASP.NET with impersonation turned on. This fails (due to permissions on the pipe blocking anyone from the network). So, is there any way I can make the call outside of the impersonation context? I don't need to be impersonating to make this call, but can't see any way of doing this.
PS. I need to do this declaratively, through config...
View 1 Replies
Similar Messages:
Nov 3, 2010
I have a web page that calls a WCF service that makes a sql database call using Integrated Security. I get an error saying, "Login failed for user 'CorpDomainServerName01$'". I want it so that it all layers will execute under the user's AD credetials (working in an intranet), ie: "CorpDomainAlbert". On the server (Win 2008/IIS 7), I have Windows Authentication turned on and everything else off (including Anonymous) under Authentication for both the web client and the WCF service. Here's my client web.config:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<authentication mode="Windows"/>
<identity impersonate="true"/>
<customErrors mode="Off"/>
</system.web>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IMyService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<!--<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />...........................
View 1 Replies
Feb 10, 2011
I'm currently trying to work out the best way to build this web application, which will then be intergrated on other systems, such as WinForms, Intranets etc.
We hope to include the usual layers i.e. DAL, BLL, BOL and UI but I have been experimenting with Entity Framework 4 and WCF Data Services and managed to get something in place where I was using WCF as a gateway to EF4.
i.e. Adding a Service Reference to my project and then using the EF4 context and writing LINQ queries against the DB
e.g.[Code]....
Now with the current setup I would still need to write a DAL Class Library, that interacts with the Data Service, because as I said WCF Data Services only seems to be a gateway, I can't see where to put the code (above) in the Data Service and then how I could these methods.
My questions are: 1. How do I develop a WCF Data Service in such a way to allow this behaviour - I know how I could do it using ASMX web service, something like [Code]....
2. If I am to use WCF Data Services, how is serialization handled (if at all) - again I know how to do something in ASMX web services
3. Again, If I am to use WCF, how do I add Security and only allow my applications to access the web service - for obvious reasons
4. Would it be possible / logical to also include the Business Logic Layer into the web service?
View 4 Replies
Apr 9, 2010
I have a service account SvcAcc to manage contacts (add/update/delete contacts) for all the exchange users. I Impersonate using the below cmdlet to manage contacts but it also allows SvcAcc to perform other functions (such as send email etc) on behalf of the user.
cmdlet
New-ManagementRoleAssignment -Name:impersonationAssignmentName -Role:ApplicationImpersonation -User:serviceAccount
//impersonation code
service.Credentials = new NetworkCredential(ServiceAccountUserName, ServiceAccountPassword, domain);
service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, userEmail);
View 3 Replies
Mar 29, 2010
How to call Synchronous service call for combo boxes? As I know Synchronous calls do not create a good user experience because the application is hung waiting for the Web service call to return. Then it is my requirement.
View 1 Replies
May 18, 2010
whether its possible to call an web service on a private corporate network from a web service located in a dmz?
View 2 Replies
Aug 4, 2010
i have created a normal web service and i want to host it outside IIS. one idea i got is to use window service as hosting environment. i have created a web service and hosted it window service and its window service is running now.would anybody please let me know that how can i call web service hosted in window service binded over soap.tcp. here is my sample code.
[Code]....
[Code]....
View 1 Replies
Sep 3, 2010
I have an ASP.NET 2.0 web app which calls a one way web method on a web service. This web method contacts remote servers and pulls back config information to confirm the state of new server builds (settings etc) and inserts the collected data into a SQL database. The web app is supposed to pass through the callers kerberos ticket to the web service and then again to the newly built server which is being checked, all via impersonation and delegation using the calling users administrator privileges.
The trouble is, I just can't get the web service to run under the callers context. I have the SPN's set up, delegation turned on in the active directory objects for the computer running the web app and service and the worker process domain user service account. I have windows authentication on and impersonation set to true in both the web app and service's web.config, integrated authentication in IIS, and IE settings are all ok. All has been checked out and passes the tests in DelegConfig, but it still won't work.
It appears that any data that's is written to the database is written under the context of the web pool service account, and not the calling users, plus along with the fact that I get access denied messages when trying to collect data from the server says impersonation isn't working. Also, is it possible to run the checks under the calling users context, but write to the database with the web pool identity service account without specifying the user details in the web config?? I am working in a secure environment and we must user windows based accounts only, no SQL accounts.
View 1 Replies
Feb 8, 2010
I need to call a Rest service but would like to do so without having to redirect. Here is my dilemma. The Rest service we are trying to integrate offers the option to sign up for a subscription but does not allow us to upgrade an existing subscription. So if a user wants to upgrade an existing subscription we have to first cancel and then have the user sign up for a brand new subscription. I don't know how I can make this so it flows nicely in my code. I ideally I would like to do something like this
User decides to upgrade
Click upgrade button
Existing account is being cancelled, if cancellation was successful
New account is being created
How can I do this with a Rest service? Here is a sample URI/URL
https://someservice.com?
Action=CancelSubscriptionAndRefund
&AWSAccessKeyId=AKIAIIFXJCFIHITREP4Q
&CallerReference=CallerReference07
&CancelReason=MyWish
&RefundAmount.CurrencyCode=USD
&RefundAmount.Value=1
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Signature=1uFUSSFvau1zadnSzKRS5ZchuLMn9p5M3ifaHGHie7M%3D
&SubscriptionId=17d62772-c53e-4bdb-9667-65d7b7841cfc
&Timestamp=2009-10-06T08%3A05%3A13.296Z
&Version=2008-09-
Could anybody give me some ideas how to make this work in an elegant manner. We thought we could keep the old subscription and then just sign the user up for a new subscription for the difference of the money. For example the first subscription would be 2.95 and the second one would be 2.00 which would amount to a subscription of 4.95. I think it is not elegant and the user would see 2 charges on the credit card, weird, I think. Since I don't know much about Rest maybe there is a way that this can be solved.
View 1 Replies
Feb 11, 2010
What does the using statement do? Is it actually needed?
using (MyWebservice x = new MyWebservice())
{
//random code
}
View 4 Replies
Aug 27, 2010
I need to asychronously call a web service from an ASP.NET application. The aspx does not need the answer from the web service. It's just a simple notification.
I'm using the ...Async() method from web service stub and <%@Page Async="True" %>.
ws.HelloWorldAsync();
My problem: the web page request is waiting for the web service response.
How to solve this problem? How to avoid any resource leak when the web service is down or when there is an overload?
View 5 Replies
Jan 12, 2011
I need to download a file from a website to my specified folder and use in my asp.net application.The file is update everyday and i need to pull the latest file.
View 5 Replies
Oct 18, 2010
I was wondering why you would still use ASP over Silverlight, since with silverlight there is a lot you can do already. And you dont have to use css, jquery, js, html, etc.
Also with silverlight you can do a call to the database via ria service.
I can only think of 1 reason which is, that not every one has the plugin installed. But thats just a matter of time.
View 5 Replies
Dec 14, 2010
I got .wsdl file from my client. by using this webservice i need validate customer information. So how to achieve this one .if customer is there or not
xml :
<xs:element name="FetchClubMembershipRequest">
<xs:annotation>
<xs:documentation>Request to fetch customers' membership information.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Customer_ID" type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="Customer_Code" type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="Last_Name" type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="First_Name" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
this is from wsdl.file
View 3 Replies
Jun 17, 2010
I have an asp.net MVC2 application that needs to call a web service from the controller. How do I do this? It is a RESTful service that returns Json data.
View 4 Replies
Oct 4, 2010
I am expecting results from a jsonp web service call. The expected result is, for example "This is a test".
The result returned is correct when I checked at debug mode.
However the actual result taken from fiddler is "This is );jsonp1286206213419( a test"
Why is a ");jsonp1286206213419(" inserted into the result? How do I troubleshoot this?
View 2 Replies
May 11, 2010
I built a web-application which calls a web-service twice in the application's log-in page - first, on Page_Load, and the second time is after a button click. When debugging, everything goes well, but after publishing the web-application and trying it - I cannot make the two calls for the web-service (each call is invoking a different function in the same web-service).
If I call it once (say, in the Page_Load) its OK, but once I get to the button click event, the page just seems to be loading but actually doing nothing (loading to infinity).
When I disabled the web-service call in Page_Load, the web-service call after the button click worked well, and if I switched between them (disabled the call in button click and enabled the call in Page_Load) the enabled one worked OK.
How come this is happening? What did I do wrong? Could it be related to the fact that the location where I published my web-application has some URL-rewriting rules?
View 3 Replies
Jan 6, 2010
How to Call A ASPNET web Service from javascript?
View 2 Replies
Apr 3, 2010
I have a C# library. From within it, I want to call a static method that exists within the same library but through Javascript. Can I use WebResource to call a C# method?
View 1 Replies
Nov 5, 2010
As the title states, I'm trying to call a web service written in ASP.Net (Same solution, but different project in visual studio) from javascript. Since I added the web reference for the service prior to this for calling it in VB.Net, I tried to use this reference by directly calling it.In the body of the Default.aspx page, I have this code:
<asp:ScriptManager id="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/App_WebReferences/localhost/ServiceName.discomap" InlineScript="true" />
</Services>
</asp:ScriptManager>
but in javascript, I can't call my service at all. Could anyone explain me how? I'd want to do something like this:
<script type="text/javascript">
alert(ServiceName.HelloWorld())
</script>
View 2 Replies
Apr 26, 2010
I'm going on my 3rd day trying to get my Ajax AutoComplete textbox to call my web method. Based on my google searches, I'm not alone. I suspect the problem has something to do with the ServicePath property on the extender, although I'm not sure. My web service is at the same level, on the same server as my test web page. I'm not sure exactly what should go into the ServicePath property, although I think I've tried every possibility. Below is my web service followed by my script.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Configuration;
using System.Web;
using System.Web.Services;
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using AjaxControlToolkit;
using System.Text;
using System.Xml;
using System.Xml.XPath;
using System.IO;
using System.Collections.Specialized;
using System.Web.Services.Protocols;
[WebService(Namespace = [URL])]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class Service : System.Web.Services.WebService
{
public Service()
{
}
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public string[] AutoCompleteNames(string prefixText, int count)
{
System.Data.SqlClient.SqlConnection cxn = new System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings["HumanResourcesConnectionString"].ConnectionString);
cxn.Open();.....................
View 11 Replies
Apr 8, 2010
I have a web page (.aspx) that calls a third party web service to get some data. It usually takes couple of seconds to get the response back, and then the rest of the page will load. Occasionally the call gets stuck either due to the web service is down, or internet connection, etc., the page just hang there and will not load.
My questions is:
1) Is there a way to abort/cancel the web service call after a set amount of time?
2) Is it even possible to verify the status of the web service before calling it?
View 2 Replies
Dec 12, 2010
I have created an WCF data service in a new asp.net web application and i want to call this web service from another web application using jquery, but it always returns null.
My jquery call looks like this:
[code]....
Note that [URL] works in the browser but since the jquery call is from localhost:3410 i assume its a problem with cross domain.
I have been reading that i should use jsonp for this, but i have a hard time figuring it out.
View 2 Replies
Mar 10, 2011
I am trying to call WCF 4 Http Web Services which are hosted within an ASP.NET application. The Service is protected behind SiteMinder.
I was wondering how I could programmatically call the web service, and more specifically what information will I need to pass to be authorized within SiteMinder to access my resources.
I am making the request from the ASP.NET application running on the same server, so I have access to the authentication cookie.
View 1 Replies
Feb 28, 2011
n my A.aspx, I will call web method GetName in B.asmx
Is it possible, before my A.aspx call GetName in B.asmx, I inject or put some codes so when A.aspx try to call the method, it needs to go through my injected code without even changing the code in A.aspx and B.asmx?
Is custom HttpModule able to handle this scenario? If yes, how? Which HttpModule's event that occurred before the page actually called the web service?
View 2 Replies