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


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

Multithreaded application consuming webservice latency

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :ADO.Net
 

I am working on troubleshooting an issue with a multithreaded application I have created.  In the application I consume a web service that while I am troubleshooting does nothing more than sleep for one second. What I have done is used the TaskFactory to handle the thread management.

var scheduler = new System.Threading.Tasks.Schedulers.QueuedTaskScheduler(NUMBEROFPROCESSES);
    var factory = new TaskFactory(cancelToken, TaskCreationOptions.LongRunning, TaskContinuationOptions.LongRunning, scheduler);
    tasks = new Task[lst.Count()];

for (int i = 0; i < tasks.Length; ++i)
    {

     tasks[i] = factory.StartNew((obj) =>
     {
      cancelToken.ThrowIfCancellationRequested();
      Worker mod = (Worker)obj;
      mod.Execute();
     }

, new Worker(parameter1, i, parameter2, lst[i].Field1, parameter3, lst[i].Field2));

    }

In the worker class I have a public void Execute() {

Service1SoapClient c = new Service1SoapClient();    
    c.HelloWorld();

}

This does


View Complete Post


More Related Resource Links

problem in consuming WCF service through Window application

  

I have a silverlight application and WCF service all made in VS 2010 , i had hosted my site to web server which contain Window 2008 and IIS 7.0


now the problem is i have another application which is a window application developed in VS2008 , when i try to add the service reference it gives me error

::::

The document at the url http://72.44.172.77/HRDev3/Service.svc was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'DISCO Document' is 'There was an error downloading 'http://dev_qa.emspa.com/HRDev3/Service.svc?disco'.'.

  - The request failed with HTTP status 400: Bad Request.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'http://72.44.172.77/HRDev3/Service.svc' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

Metadata contains a reference that cannot be resolved: 'http://72.44.172.77/HRDev3/Service.svc'.

Content Type application/soap+xml; charset

WCF client consuming oracle webservice is inconsistently works

  
Hi, In my WCF client application, I am consuming the Oracle  webservices. Strangely this wcf client functioning inconsistently. That means sometime, it does not find the service endpoint and some times it does. Where the code and environment are absolutely same in both the cases. But when I use web services, I see the code works consistently. There is no endpoint listening at the address http://<serviceurl> Does any one faced similar issue with WCF? Thanks!

Strange lockup in multithreaded application - Visual Studio debugger unable to break execution

  
Multithreaded C# application, Visual Studio 2008, Windows XP, Framework 3.5 SP1. This application is a little crawling utility to download pages from our website, extract some information and upload it into a database. It runs for a while, then somewhere between about 10 minutes and an hour in, it locks up totally, user interface and all. When I try to "break all" in the VS debugger, I get a message "cannot break execution". Now the confusing thing about this is that since the UI was locking up, I thought that some deadlock must be happening on the main UI thread. So I started stripping out any code and locks that were being acquired on that thread that might cause problems ... until there was nothing left. Even with the window simply spawning a bunch of worker threads on create, then totally forgetting about them and giving no reverse access, the lockup still happens, the UI still freezes and VS still can't break the execution.   There are 10 threads to do the crawling, and one each to do the processing and the uploading. The next thing I did was take out the uploading entirely to remove the possiblity of a deadlock in the SqlClient libraries. No difference. So now, the only things that could be really deadlocking the main thread that I can see are the centrally created HTTPWebRequest objects I'm using. WebRequest.create is supposedly thread safe

Error while consuming Webservice

  

Hi,

I'm consuming one webservice which hosted in IIS in my windows service. While consuming that web service proxy method I'm getting below error.

But its not happening regularly, randomly it s happening. Sometime its working very fine.

Error is :

The content type text/html of the response message does not match the content type of the binding (text/xml;charset=utf-8). If using a encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 163 bytes of the response were "<html><head><title>Error</title></head><body> Either a required imersonation level was not provided, or the provided impersonation level is invalid </body></html>


Thanks in advance,


how to create an image from webservice on desktop application

  

Hello Partners,

On desktop application I am uploading photos and storing physically on the webserver with the help of webservice and in DB I am storing physical path of that photo.

On the other hand, I want to download the images for later use at that time I am creating bytestream from the physical path and storing it in the dataset column whose datatype is VARBINARY(MAX)

I can return byte array which creates the images on the client side very easily.

The main problem I am facing here is, I am not able to convert the byte array into dataset's VARBINARY format.

I really will be thankful for ur help...



how to Use webservice in asp.net application

  

Dear all,

Please try to guide how to call web service in my asp.net Application. I had Web reference of  that web service.

I added the Service to my application.i created name space  and I try to use methods inside the web service it showing unable to connect server machine. I want to Use jangomail services from asp.net application. my application need to send mass mailing using jangomail service.when i try to access that  web service( http://api.jangomail.com/api.asmx) it giving Some Error like Connection failed to Server..

Could  you Please  try to resolve the Issue  appreciates. 

Thanking you,

rgs,

Santhu

santhoshsalugu@hotmail.com


Problem in consuming WCF duplex service 4.0 in web application developed in 4.0

  

I am facing an issue in consuming WCF duplex service (WCF service library) 4.0 in c#.net web application project developed in 4.0 framework.

I have defined a callback contract with one callback function in WCF. When this callback function is called from my service implementation, the client application crashes and closes abruptly.
If i remove the callback implementation from WCF, everything works fine.

I tried changing the framework for client to 3.5 from 4.0 and to my surprise the callback works perfectly. I am not able to get why callbacks are not working in 4.0 framework.

Would appreciate help on this issue! 

Source Code:

 

Interface:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WCFDuplexServ
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract(CallbackContract = typeof(IClientCallback))]
    public interface ITemperature
    {
        [OperationContract(IsOneWay = true)]
 

Problem in consuming WCF duplex service 4.0 in web application developed in 4.0

  

I am facing an issue in consuming WCF duplex service (WCF service library) 4.0 in c#.net web application project developed in 4.0 framework.

I have defined a callback contract with one callback function in WCF. When this callback function is called from my service implementation, the client application crashes and closes abruptly.
If i remove the callback implementation from WCF, everything works fine.

I tried changing the framework for client to 3.5 from 4.0 and to my surprise the callback works perfectly. I am not able to get why callbacks are not working in 4.0 framework.

Would appreciate help on this issue!

 

Source Code:

 

Interface:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WCFDuplexServ
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract(CallbackContract = typeof(IClientCallback))]
    public interface ITemperature
    {
        [OperationContract(IsOneWay = true)]

Repository for consuming webservice

  

Hi

Can anyone suggest a design / implementation of a repository class for consuming webservice? So far i've seen repository examples that take a DAO class. Is this a good pattern?


Deploy custom webservice to web application

  

Hello,

I'm writing custom webservices for SharePoint 2010. Now generally it involves deploying .svc files to the ISAPI directory, which makes them available in http://server/_layouts/_vti_bin.

Works great, but this deploys the webservice to all web applications at once. In a shared environment this isn't preferable. So how can I deploy the webservice to a single webapp? I guess that means the .svc should be somewhere in the database instead of the filesystem. Is this doable and a good solution? Or are there other ways to acheive the same.

I'd like to have a solution which deploys to the web application scope. Updon deployment, I can select the web application(s) to deploy it to which makes the webservice avaiable in those and only those web apps.


MCTS Web Application Development, SharePoint enthousiast.

Microsoft's Collaborative Application Markup Language (CAML) Loop

  
discovered an interesting error recently while working with Microsoft's Collaborative Application Markup Language (CAML) that, surprisingly, had received no ink. Partly what surprises me about this is that the error may require you to rewrite large sections of your code if you haven't previously considered this SharePoint limitation. I'll start with some context, but first of all the error is:

Integrating a Legacy Web Application in SharePoint

  
This month we will continue with the theme of deploying Microsoft's SharePoint as a company intranet by describing a method for integrating a legacy Web application inside a SharePoint site.

In many companies the intranet site is not just a home page with announcements. It houses Web applications used by many different departments. In last month's article, I built a page to search the employee table in Northwind (the sample database included in Microsoft's SQL Server). This month, I will move the Web pages used to add/remove records from the table into the SharePoint intranet.

MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

  
The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

High-Performance .NET Application Development & Architecture

  
It has always been a goal of project architects to plan an effective strategy from the ground up in regards to an new application. All relevant factors are taken into consideration with respect to the application, from its design and layout to a functional website infrastructure. Pre-.NET strategies and design guidelines still effective now were developed with Microsoft's DNA (Distributed interNet Application) platform. This model successfully served the purpose of architecting N(any number of)-Tier (levels) applications. In its basic sense, as in most robust, distributed applications, you'll architect 3 main layers or Tiers: presentation, business rules and data access.

Application architecture in asp .net

  
Application Architecture is the most important process of developing a good application. Some people tends to jump into coding without any architecture laid. Later we see those people changing the architecture and finally the application had to be developed from the scratch with the correct architecture.

In this article I will describe some details about how you can improve the architecture of you application. This article is targeted to the beginner's audience.

Improving Application Performance in .Net

  
Application performance has always been a concern for Web Application developers. This article contains guidelines and tips for maximizing application performance in ASP.NET.

Logic behind N -Tier Application Development

  
In the arena of application development, developers all over the world use various programming languages, technical processes, and technical tools. While using number of technical & non technical elements the processes or methods become complex, for simplification of the application development process, developers use various techniques such as dividing the application architecture into layers or parts. In the professional & technical language this separation or division process is called N-Tier Application Development process, where "N" stands for number and "tire" stands for layers or parts.
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