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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Slow performance calling an Web Service in a Visual Web Part

Posted By:      Posted Date: October 26, 2010    Points: 0   Category :SharePoint


I'm developing a report from data being served from a web service in SAP (through PI). I used the wsdl.exe to create a c# class and a wrapper and everything is working fine.

The problem is the performance... it takes about 3x the performance of an console application just to move the code inside a Visual Web Part.

I isolated the code to just this... 

DateTime timeReq = DateTime.Now;
response[] t = werbService.method(req);
double timeTaken = DateTime.Now.Subtract(timeReq).TotalMilliseconds;

It takes 60 seconds in a Visual Web Part and the same call in a console application takes 20s.

Since i dont have a packet sniffer i'm not sure why is taking so much time to execute the same code in sharepoint, am i missing some configuration? Anyone have face this kind of behaviour before?


View Complete Post

More Related Resource Links

Slow performance of WCF service calling singleton (which calls COM+!)


WCF Service call routing to COM+ application.
netTCPBinding, throttling set pretty high.

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode=ConcurrencyMode.Multiple)] 

Service has two methods, one simply returns the string was input, the other calls the COM+ component and FOR TESTING returns the string "success" for every call. Therefore, both methods return a simple string.

Client starts 20 threads, each calling the WCF Service twice. (NOTE: A "first call" is made to prime the singleton service and also the COM+ component)

Using log4net and a Stopwatch to log the timings of the clien

Using Web Service in SharePoint 2010 Standard Web part using Visual Studio 2010

Hi All,               Have an issue with  Web service in calling  by SharePoint 2010 Standard Web part using Visual Studio 2010. If you can tell where I went wrong or tips to solve this would be great for me. What I have done is like this.. 1) Created new 'Empty SharePoint' project : as Farm solution 2) Added Web parts 3) Trying to add Web Service : There was no option for adding Web Service , so added as 'Add new Service' , this created entries in app.config file 4) ServiceName : shown as name space  (what  I'm  expecting is as Global  object with all methods ) 5) Created Object of namespace.ServiceName.ServiceSoapClient and tried to call one of it's method 6) Build and deployed 7) While viewing that web part it is showing an error as [InvalidOperationException: Could not find default endpoint element that references contract 'SerialKeyService.ServiceSoap' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.]         Error in detail : [TargetInvocationException: Exception has been thrown by the target of an invocation.]   at System.RuntimeTypeHandle.CreateInstance(RuntimeType t

Slow performance when searching in "any part of field" of a SQL Server database using a Microsoft Ac

We have just migrated our back end database from Access to MS SQL Server 2008 R2. We have noticed better performance on our searches - unless we select to search in "any part of field" in Access (with Access' built-in search function - we use a mix of Access 2003 and 2007). This takes nearly 20 seconds to find the result, whereas before the migration it was taking 5-7 seconds (compared to instant results we now experience when searching for whole fields). The main fields we search are not large - usually just two words. Obviously it is better to search for a whole or start of a field, but this is not always possible. The contractor that assisted us in this project has told us that this "is just the way SQL works with Access". Is this really true? I find it hard to believe two MS products would have such a big issue between them. I presumed using SQL with an Access front end would be a common setup, which is why I thought this must be a problem with our setup. Is there any way to fix this speed issue?

Why do I get a 401 error when calling a WCF service from a web part?

I have a SharePoint 2010 web part and WCF service deployed to a web application using Kerberos authentication. The service was developed based on the walkthrough from MSDN with the only difference that ClientCredentialType = HttpClientCredentialType.Windows so that Kerberos is used. The web application is being reverse-published through ISA. However we've never had an issue with this before. We've also disabled the loopback check on the server. When the web part calls the service, a 401 error occurs with the following exception message: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'NTLM'. I configured Fiddler on the web application running the web part and found that both Kerberos and NTLM authentication headers are being returned: HTTP/1.1 401 Unauthorized Server: Microsoft-IIS/7.5 SPRequestGuid: 541e724c-85a7-47a0-b045-827e1c50793c WWW-Authenticate: Negotiate oXsweaADCgEBoQsGCSqGSIL3EgECAqJlBGNgYQYJKoZIhvcSAQICAwB+UjBQoAMCAQWhAwIBHqQRGA8yMDEwMDkxNDA1MjY1NlqlBQIDDgespgMCASmpDBsKREVDUy5MT0NBTKoXMBWgAwIBAaEOMAwbCnNwX3dlYmFwcDE= WWW-Authenticate: NTLM X-Powered-By: ASP.NET MicrosoftSharePointTeamServices: Date: Tue, 14 Sep 2010 05:26:56 GMT Content-Length: 0 Proxy-Support: Session-Based-Authentication Why then is the Kerberos authentication not a

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.

Smart Client: Building Distributed Apps with NHibernate and Rhino Service Bus, Part 2


Smart client applications are responsive and promote interactivity with the user. In this article, we continue building a smart client application using NHibernate for data access and Rhino Service Bus for reliable communication with the server.

Oren Eini

MSDN Magazine August 2010

Thread Performance: Resource Contention Concurrency Profiling in Visual Studio 2010


Visual Studio 2010 includes new resource contention profiling features that help detect concurrency contention among threads. We walk through a profiling investigation to demonstrate how you can pinpoint and fix resource contention problems in your code.

Maxim Goldin

MSDN Magazine June 2010

Thread Diagnostics: Performance Tuning with The Concurrency Visualizer in Visual Studio 2010


Understanding performance bottlenecks in multithreaded apps used to require significant instrumentation and analysis by expert developers. The Concurrency Visualizer in Visual Studio 2010 significantly reduces the burden of parallel performance analysis.

Hazim Shafi

MSDN Magazine March 2010

Service Station: Building a WCF Router, Part 2.


Here we present a deep look into the workings of Windows Communication Foundation routers, exploring the details of pass-through router implementations.

Michele Leroux Bustamante

MSDN Magazine June 2008

CLR Inside Out: Measure Early and Often for Performance, Part 2


In the second of a two-part series, Vance Morrison delves into the meaning of performance measurements, explaining what the numbers mean to you.

Vance Morrison

MSDN Magazine May 2008

CLR Inside Out: Measure Early and Often for Performance, Part 1


In this month's column, get the inside scoop on how to build performance into your apps from the start, rather than dealing with the fallout after you deploy them.

Vance Morrison

MSDN Magazine April 2008

Service Station: Building a WCF Router, Part 1


Here we take a look at WCF clients and services, and explain how to tweak the addressing and message filtering behaviors so you can route services between them.

Michele Leroux Bustamante

MSDN Magazine April 2008

Performance: Find Application Bottlenecks with Visual Studio Profiler


We will introduce you to the Visual Studio Profiler by walking through a sample performance investigation, pinpointing code inefficiencies in some sample applications.

Hari Pulapaka and Boris Vidolov

MSDN Magazine March 2008

Service Station: An XML Guru's Guide to BizTalk, Part 2


In my last column, I provided a brief introduction to BizTalk® Server 2004 for XML developers (see Service Station: An XML Guru's Guide to BizTalk Server 2004, Part I). I covered the product evolution, core architecture, and several aspects of the underlying messaging layer, all of which have helped make BizTalk Server 2004 the powerful integration technology it is today.

Aaron Skonnard

MSDN Magazine December 2005

Service Station: An XML Guru's Guide to BizTalk Server 2004, Part I


Who would have believed that XML, such a seemingly trivial technology, could revolutionize an industry? It may have seemed like a long shot in the beginning, but the XML aficionados saw something special and pragmatic right away-a sort of duct tape for the world's information systems.

Aaron Skonnard

MSDN Magazine November 2005

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