Will Transactionscope Work Over Multiple Calls To Different Services
Jun 18, 2010
I'm writing some merge functionality in C# asp.NET MVC2. I am also using using Linq2SQL.
I have a block of code which calls two services, MessageService and UserService. These both in term call their appropriate repositories and make the amendments to the db. Each repository declares it's own instance of the repository so I'm thinking this will escalate the following code to DTC . The code is called from the AccountService, is this going to work at this level? And also is it bad practise to declare the DataContext at the top of every repository or should I pass the object around somehow?
//Run the merge
try
{
using (TransactionScope scope = new TransactionScope()) [code]....
View 2 Replies
Similar Messages:
May 10, 2010
I have a webservice (ASP.NET) deployed on a webfarm. A client application consumes it on daily basis. The problem is that some of its calls are duplicated (with difference of milliseconds). For example I have a function Foo(string a,string b). The client app calls this webmethod as Foo('test1','test2') once but my log shows that it is being called twice or sometimes 3 or 4 times randomly. Is this anything wrong with the webfarm or the code? Note that the webmethod has simple straighfarward insert and update statements.
View 1 Replies
Sep 3, 2010
I haven't deployed behind a load balancer before. My customer has a WCF service built and tested on servers using a service model configuration that is relatively straightforward. It provides a service to return an image of a map for another application. To get the map, it calls other services.
The service was built in Visual Studio 2010 targeting the 3.5 framework. The customer is using IIS 7.5 and an F5 load balancer. When moving to the production server, the Web.config was changed to add the load balancer behavior and specify the endpoint to show the physical and logical address of the service:
[Code].....
There was a problem when the service was deployed to a server behind the load balancer. When I try to call the service from WCFStorm or WebServiceStudio I get the message "The provided URI scheme 'https' is invalid; expected 'http'.
The endpoints for the service itself look right to me. However in the development and testing versions of the config, the client section uses http instead of http, while on the production servers it uses the load balancer's https address. This seems like it should be obvious, but we're missing it.
View 1 Replies
Sep 24, 2010
I have been moving my application to be more AJAX-based. Currently I have a web service call where I use jQuery to gather some textbox (string) and checkbox (boolean) results and pass it to a web service. Everything works really well, the response time is super quick. The only downside that I can see to this is
1) you need to use jQuery, which will add to the user's download time - this doesn't really affect my application too much because I am using jQuery throughout the site
2) users can see the code and potentially try to hack the web service because they know where it is
I am most concerned with #2. I've been reading a lot about .NET web service calls, using IAsyncResult,
http://msdn.microsoft.com/en-us/library/2e08f6yc.aspx, and I am beginning to understand the 4 methods available in this article. However, is there extra bloat using this way compared to the jQuery web service call?If there isn't that much bloat or lag time using this method, I'd like to convert my application. Which one of these 4 methods is best in a scenario where I am just returning a small string value? The 4 methods in the article are to wait for EndInvoke itself, which from what I read is not recommended because this may block the first thread; and this should not be used on a service that affects the UI.Create a WaitHandle to wait for the 'OK' before EndInvoke is called Poll the IAsyncResult for .IsCompleted, using sleep() and a Do While until IAsyncResult.IsCompleted is true, then call EndInvoke Pass a delegate function to BeginInvoke to be called once the operation is complete.
View 1 Replies
Feb 20, 2010
I am confused about why I would need to wrap the DataContext's SubmitChanges within a transactionScope when modifying multiple tables. I was under the impression that the DataContext would track these changes and would therefore create its own transaction if need be.
In other words, if a change was made to update table A, B and C or if I made changes to 10 out of 20 items in a collection of rows, that the datacontext would track these changes and create its own transaction. If that is correct then why have I seen examples that wrapped these types of updates in a TransactionScope?
View 4 Replies
Mar 9, 2010
I'm working with the MicrosoftAjax.js libraries to make my webservice calls via javascript, right now all my services are returning basic types, like string, int, bool. can i also have my services return things like DataSets, DataTables, or custom Classes that I have built to my javascript side?
View 3 Replies
Mar 31, 2011
Are there any transactions around multiple webservice calls.Let me start with a commonly used example -- the travel agency. A customer intends to create a travel plan through an online travel agency. To do this, the online travel application calls the following three Web services:
-Air ticket booking
-Hotel reservation
-Taxi reservation
These three services are available from three separate vendors. If any one of these three services fails, the customer does not wish to proceed with the transaction (again, either all three services must succeed or none at all).My language programming is Asp.net c#.
View 1 Replies
Apr 4, 2011
Are there any transactions around multiple webservice calls?but in ASP.net forum I got the answer below:
http://jalpesh.blogspot.com/2010/05/using-transactions-with-linq-to-sql.html it's offering system.transaction.
View 2 Replies
Mar 18, 2011
When I am updating a record with linq to sql my DeleteLesson() method is getting called multiple times.My controller looks like this :
public ActionResult Delete(int id)
{
deleteLesson(id);[code]....
EDIT.also if I use confirm = "Do you want to delete" in ajax options I will have to click okay three times.
View 1 Replies
Nov 18, 2010
We have a page that makes a request to a 3'rd party web service. When under heavy load this response time extends significantly, however the 3'rd party reports back that there times for processing remains constant. There timings show that from the time they receive a request to the time they send it back is always around 1.5-2.0 seconds. Now we are experiencing wait times of over 20 seconds. My understanding of ASP.NET is that each request will run on a IIS thread pool thread and make the request to the 3'rd party service return and process. So I don't really understand what could be blocking on our end. Is there something I am missing?? Is there a threshold limit beyond IIS that is blocking?
If I am missing something a physical book recommendation that covers this subject would also be a very welcome addition to any answer.
View 2 Replies
Aug 31, 2014
on my page I've to check if the UserName is available and sponsor code is correct. For that I'm using ajax call for both.
Code:
Sponsor User Name <span id = "mesg"></span><asp:TextBox ID="txtSpUserName" runat="server" CssClass="DropText" onblur ="ShowAvailability()"></asp:TextBox>
Login Name <span id="Login"></span><asp:TextBox ID="txtLoginName" runat="server" CssClass="DropText" onblur ="ShowLoginName()"></asp:TextBox>
[code]....
Why they are not giving separate results?
View 2 Replies
Apr 30, 2010
I have an existing asp.net web application I am redesigning to use a service architecture. I have the beginnings of an WCF service which I am able to call and perform functions with no problems. As far as updating data, it all makes sense. For example, I have a button that says Submit Order, it sends the data to the service, which does the processing.
Here's my concern: If I have an ASP.NET page that shows me a list of orders (View Orders page), and at the top I have a bunch of drop down lists for order types, and other search criteria which is populated by querying different tables from the database (lookup tables, etc). I am hoping to eventually completely decouple the web application from the DB, and use data contracts to pass information between the BLL, the SOA, and the web app. With that said, how can I reduce the # of WCF calls needed to load my "View Orders" page? I would need to make 1 call get the list of orders, and 1 call for each drop down list, etc because those are populated by individual functions in my BLL.
Is it good architecture to create a web service method that returns back a specialized data contract that consists of everything you would need to display a View Orders page, in 1 shot? Something like this pseudocode:
public class ViewOrderPageDTO
{
public OrderDTO[] Orders { get; set; }[code].....
Or is it better practice in the page_load event to make 5 or 6 or even 15 individual calls to the SOA to get the data needed to load the page? Therefore, bypassing the need for specialized wcf methods or DTO's that conglomerate other DTO?
View 2 Replies
Feb 10, 2011
I have an ASP.NET page with two instances of the same Web User Control (a simple WYSIWYG editor). On submit, the WUCs do a little JavaScript magic and then proceed with a normal postback.
The first instance seems to be working, but the second fails to post changes back to the server (it reverts to the original, and posts that). I believe the problem is that the JS only fires for the first WUC. I've traced that to the following code, from the generated client-side source:
function WebForm_OnSubmit() {
prepHtml('AddEditPopup1_ctlEditorQuestion_txtEdit','AddEditPopup1_ctlEditorQuestion_divEdit', 'AddEditPopup1_ctlEditorQuestion_divHT' );
//snip...
}
The problem seems to be that there should be two calls to prepHtml: one for the ctlEditorQuestion instance of the WUC, and one for the ctlEditorAnswer instance.
Instead, there's only the one for ctlEditorQuestion. Both controls are registering the OnSubmit event, but one of them overwrites the other.The prepHtml call is registered from the WUCs' C# code at runtime:
//Page_Load
_onSubmit = String.Format("prepHtml('{0}','{1}', '{2}' );",
txtEdit.ClientID, divEdit.ClientID, divHT.ClientID);
//OnPreRender
Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), "get-html", _onSubmit);
I should point out that I didn't write this control myself, and I've never seen this kind of runtime registration of OnSubmit JS code before. Page.ClientScript.RegisterOnSubmitStatement is totally new to me. I need to register both prepHtml calls so they run sequentially. Is this possible? I'm open to alternatives to Page.ClientScript.RegisterOnSubmitStatement, so long as the code still gets fired on submit.
View 1 Replies
Nov 19, 2010
I am trying to make 2 separate AJAX calls using buttons. What I want to happen is: when Button1 is clicked ProductsTable shows data from the webservice; when Button2 is clicked OthersTable shows its own data from the webservice. But right now, when either button is clicked, nothing shows up. I know the code works if there's only one of them and it's not wrapped around a .click function.
No error messages. ASP.NET 4.0, JQuery 1.4.4. Not using ScriptManager. Not using UpdatePanels.
Code below:
[Code]....
View 3 Replies
May 7, 2015
$.ajax({
type: "POST",
url: "./InActiveMerchantList.aspx/LoadStakchart",
[Code]....
View 1 Replies
Sep 14, 2010
I need to gather information (via GET) from several other websites (not under my control), do some processing (specific to each source) on the data returned, and then print all the info out to the user.
Right now I'm making the GET request to website A, waiting for it to return, processing it, then calling website B, and so on... Obviously this is too damn slow. I'd like to make async requests to A, B, and C, then process each response as it comes back, and once I have all the responses, print it all out to the user.
I'm allowed to use classic asp or vb.net. I'm more familiar with classic asp but I'm willing to learn...
View 2 Replies
Apr 27, 2010
I have the asp.net project which will access the web services (C#, mainly connection to database) in another computer which is running load balancing.
But the project always return "Underlying connection is closed!!".
View 6 Replies
Jul 19, 2010
If I declare a public variable in my module then publish it out on the server...then have multiple users using the app will the variable get overwritten each time a user calls it?
View 1 Replies
Apr 24, 2010
I know how to call a simple old fashion asmx webservice webthod that returns a single value as a function return result. But what if I want to return multiple output params? My current approach is to separate the params by a dividing character and parse them on teh client. Is there a better way.
Here's how I return a single function result. How do I return multiple output values?
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="WebService.asmx" />
[code]....
View 2 Replies
Feb 17, 2010
I have the following Page_Load function...
protected void Page_Load(object sender, EventArgs e)
{
XmlDataSource1.Data = GetXmlFromFile(Request.QueryString["file"]);
XmlDataSource1.DataBind();
Repeater1.DataBind();
}
The page in which this Page_Load resides is called by a parent page. Each time this Page_Load gets called the value of "file" in the query string will be different. So each time I will be receiving the XML contents from a different file which are inserted into the XmlDataSource and then bound against by the Repeater. Getting the XML data from the file works great but when I bind against the repeater that only works the first time through Page_Load. Each time after that when this code is executed the same results from the first XML file are displayed in the repeater.
What am I missing here. How can I get the XML data to be bound against the repeater on each page load instead of just the first one?
View 3 Replies
Sep 28, 2010
I have old school web service and it is configured to impersonate the caller. Works with no problem. Now I am thinking about adding another more higher level ASP.NET (non-wcf) web service which would be calling the original web service.The question is - will the client identity flow across two hops as in client (1)-> new web service (2)-> old web service) or there will be issues?
View 2 Replies
Jul 13, 2010
I make an asynchronous call from one web service to another web service deployed on different server? The scenario is that an ASP.NET webforms page will call a web service in an async manner. This particular web service will then make another async call to a second web service deployed on different web server. This this possible to achieve, and what additional steps or code would be necessary to make this happen?
View 1 Replies
Feb 5, 2011
I have a quick question about best practices and especially expected performance for the following scenario:
If I want to query data from multiple servers that contain schematically identital sql databases, would having each server provide a web method that a single client application can consume be an appropriate (and relatively fast) solution?
The data just needs to be consolidated on the client end, where several web methods would have to be consumed serially (or in parallel?) to provide the data to the client. Each server would also be implementing Entity Framework as an ORM.
Performance is my main concern here, would it turn out excessively slow as we start to scale up to more and more servers?
View 2 Replies
Feb 23, 2011
My requirement is i need to display some quotes from some vendors in my User Interface. Some of the quote details will be fetched from database where as some vendors are giving web services to get the quote results. I need to combine the quotes from database as well as the various web service response and display in the grid.
View 1 Replies
Aug 31, 2010
I'm currently developing a program using ASP.NET 2.0 (C#) and i am using Reporting Services 2005. One of the report requirements is to export a data to an excel with multiple excel sheet.
Is there other way to generate multiple excel sheet using the reporting services? if yes, i would like to ask a sample code..
View 6 Replies