.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Handling Threads in WCF Service

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :WCF
 
Hi All, I have a WCF serivce which will be called by many clients at the same time. So i set concurrency mode as multiple. So its working fine. In my database i have set time limit for processing each request. So if a particular request is not executing with in that time limit i need to kill(abort) that thread and that request should be given to a new thread. Can any one give me an idea on this that how can i do this? Thanks Lijo.


View Complete Post


More Related Resource Links

Exception handling in web service

  

I've written a web service and implented some exception handling withing my code. When I debug the services the exception handling works as planned, the catch clause handles the exception. The problem is that when I deploy to a production IIS 7 web server the exception handling in my code does not appear to be trapping any errors. It appears that IIS is trapping the errors and returns back a 500 error.

Is there a setting in web.config to prevent this from happening or is there some configuration change in II7 that need to happen to prevent my error handling from being overridden?

TIA


Call to WCF service and threads running at client & service end

  

I'm sending custom header from Silverlight application to the WCF service over HTTPS.  Through the custom header, I'm sending client's CultureInfo to the WCF service and expecting the response from service in the language of the culture I have sent. I have applied custom behaviors to both client and service ends correctly by implementing IEndpointBehavior, IClientMessageInspector and IDispatchMessageInspector.

I'm assuming that the the thread on which the call to service is made would be the same running at service end. i.e. the thread running the AfterReceiveRequest would be the same as the thread running the actual server code. Is it correct? If I set the CultureInfo of the thread to what I want, will I get the response from the service using the same culture?

(I have hosted wcf service on my local IIS. For testing purpose, I set CultureInfo on the thread to Swedish culture but the response is always in American English (which is my computer's culture language.)


EL Exception Handling block and WCF custom Service Fault Exception

  

I am currently working on a project to integrate WCF custom fault along with enterprise library exception block. 

I was following Guy Burstein's blog for doing this :

http://blogs.microsoft.co.il/blogs/bursteg/archive/2007/04/07/Shielding-WCF-Services-with-Exception-Handling-Application-Block-_2D00_-Part-1.aspx

This example only shows mapping for message and id. The message is of string data type and id is Guid data type.

But what if I have some other custom fields in my custom Fault object in which I have a CategoryID of type string to which I need to map the id of type Guid ?

When I try to do the mapping and propogate it, I get the value as null. Is there some way I could convert the Guid to string type while doing the mapping in EL?

[DataContract]

public class ServiceFault

{

    private

Exception Handling in WCF REST Service Template 4.0

  

Hi,

I'm using WCF REST Service Template 4.0 and so far, I'm able to create RESTful Services with the said template successfully. Now, what I need is a nice way to handle exceptions in a RESTful Service. As far as I know, when an exception is thrown from a service method, the returned http status code to the client is 400 (Bad Request). My problem with this one is that I can't pass along a detailed information about the error(s) that occurred in my domain or business logic layer.

Examples of errors that I need to pass:

new ValidationResult { FieldName = "ProductName", Message = "Product Name is mandatory" };
new ValidationResult { FieldName = "ProductName", Message = "Product Name is too long" };
new ValidationResult { FieldName = "Price", Message = "Price should be greater than zero." };

So, my plan is to make all my services always return a successful request (with http status code 200) even if a domain layer error occurred.

When the service call is successful, it will return something like this:

<OperationResult>
    <StatusCode>200</StatusCode>
    <StatusDescription>Successful</StatusDescription>
    <Data>
        <Product>
            <Name>Sample Product</Name>
            <Price>1.00</Price>
            <Culture>en-

Exception Handling in WCF REST Service Template 4.0

  

Hi,

I'm using WCF REST Service Template 4.0 and so far, I'm able to create RESTful Services with the said template successfully. Now, what I need is a nice way to handle exceptions in a RESTful Service. As far as I know, when an exception is thrown from a service method, the returned http status code to the client is 400 (Bad Request). My problem with this one is that I can't pass along a detailed information about the error(s) that occurred in my domain or business logic layer.

Examples of errors that I need to pass:

new ValidationResult { FieldName = "ProductName", Message = "Product Name is mandatory" };
new ValidationResult { FieldName = "ProductName", Message = "Product Name is too long" };
new ValidationResult { FieldName = "Price", Message = "Price should be greater than zero." };

So, my plan is to make all my services always return a successful request (with http status code 200) even if a do

Error Handling in WCF RESTful Service

  
WCF possesses the capability to handle errors for RESTful services and return appropriate HTTP status code as well as error details using standard formats like JSON or XML. So, WebFaultException is the class used to return:
1. HTTP status code only, or
2. HTTP status code and user-defined type.

Windows Service Applications Tutorials

  
You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

WCF Tip: Using Properties in Service Contracts

  
you'll notice all of the Service Contracts are implemented with interfaces containing only methods. For the longest time I thought that's all that was supported, until I thought about it a little more. In C# land, properties are simply wrappers around a get method and set method, so why wouldn't we be able to use properties in a service contract? Well the answer is we can.

EXCEPTION HANDLING IN C#

  
Every self-respected programmer should include exception handling techniques. Sometimes your application will generate an error. Regardless of who was responsible for this error, the programmer or the user, it is up to the first to include the necessary exception handling techniques to keep his/her program from crashing. The .Net environment provides useful techniques for avoiding disastrous errors such as try-catch statements and user-defined exceptions.

Global Exception Handling with ASP.NET

  
After your global exception handler has done its work, you'll want to redirect the users of your website to a friendly page that tells them that something has gone wrong, and then provide them with customer support information as well as a link back to your web application's home page.

Realizing a Service-Oriented Architecture with .NET

  
This article is meant to be a practical discussion guide to building a .NET application in a service-oriented architecture. We will consider real-world goals, real-world obstacles, and experience-based solutions. I quickly concede the approaches discussed here are not exhaustive or infallible. This paper is focused on application development, not application integration. We will specifically consider architectural issues and component design issues.

The Potential of Web Services

This sharpoint 2010 problem solving threads

  
Hi friend,

you can use this thread to solving problem and solutions.

Web Service for uploading documents into SharePoint

  
WS UploadService is a web service written for Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0 and is meant for uploading documents into SharePoint. I have just uploaded the zip file to GotDotNet.com so it will take some time before the zip file appears in the list of downloads. For the time being, you can download the zip file from the following location

SQL Server 2005 Try and Catch Exception Handling

  
I'm pretty excited to see that there is some real error handling for T-SQL code in SQL Server 2005. It's pretty painful to have your wonderfully architected .NET solution tainted by less-than-VBScript error handling for stored procedures in the database. The big difference being the addition of TRY..CATCH blocks. Let's take a look:

Creating and Using an ASP.NET Web Service in Visual Web Developer

  
In addition to letting you create Web pages, Microsoft Visual Studio also lets you create Web services that use ASP.NET XML. Creating a Web service in Visual Studio is similar to creating a Web page. You can also use the Microsoft Visual Web Developer Web development tool to reference and use Web services that are in a Visual Web Developer solution, on your local computer or in a local or external UDDI directory. In this walkthrough, you will create the Web service in one solution and use it in another.

Tasks illustrated in this walkthrough include:

Creating a simple XML Web service in Visual Web Developer.

Creating a separate Web site that uses the Web service.

Handling 404 page not found with Error page

  

Hi,

      How do i handle 404 page not found?


AutoGenerateSelectButton="False" ignored when using Domain Service

  

Crosspost from RIA Services forum: http://forums.silverlight.net/forums/t/196466.aspx

I'm creating a Dynamic Data application in VS2010 and have recently switched to using a Domain Service to give greater control over the data presented to the client. I've noticed that the AutoGenerate<Action>Button attributes on my GridView are being ignored. The presence of the Edit and Delete buttons appear to be contingent on the existence of Update and Delete methods on the partial classes autogenerated in the Domain Service, but i'm not seeing how to control the generation of the Select button. Is there a way to control this from within the Domain Service class?


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend