473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

webservice advice

Hi

Im using VS 2005 C#;

Is there any issues I should be aware of if I add my webservice as a static
variable to my main class?

The reason im asking is should I create an object of my webservice everytime
I wish to invoke its methods, or just use a static instance of the
webservice created when the application loads. My webservice is a "Data
Tier" to the application. In addition I use SoapHeaderAttributes so it saves
me adding these everytime I wish to make a call. But my concern is about
calling the methods asynchronously? any threading issues etc to be aware of?

Any info be much help.

Thanks

Gary
Jul 9 '06 #1
1 1141
The only issue you might get sharing the same instance among threads is if
processing more than one thread your call will queue as there is a maximum
of 2 connections by default under Windows.

Having said this, I never do what you are doing. I tend to make my code less
coupled. The client is completely unaware of the Web Service and the
business logic creates an instance of the proxy per call. The overhead here
is not that great and simplifies the code.

Regards
Simon.

"Gary Howlett" <gh@nuclide.co.ukwrote in message
news:44***********************@ptn-nntp-reader01.plus.net...
Hi

Im using VS 2005 C#;

Is there any issues I should be aware of if I add my webservice as a
static variable to my main class?

The reason im asking is should I create an object of my webservice
everytime I wish to invoke its methods, or just use a static instance of
the webservice created when the application loads. My webservice is a
"Data Tier" to the application. In addition I use SoapHeaderAttributes so
it saves me adding these everytime I wish to make a call. But my concern
is about calling the methods asynchronously? any threading issues etc to
be aware of?

Any info be much help.

Thanks

Gary

Jul 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nicolas | last post by:
Hello! I call using C# a webservice (UTF8 encoded) that return a list of product. I get the requested objets. So far so good. But, in those objects in all String attributes I get ?? instead of...
1
by: Paul NGPC | last post by:
Hi folks This is a challenging and interesting topic. Need HELP on this, would be good if some tips/techniques can be given for the topic. Using VB.NET client to connect to JavaWebserver....
3
by: Trygve Lorentzen | last post by:
Hi, I don't know if this is a stupid question, but I observe that my webservice is created for each call to a webmethod. More precisely an instance of the webservice class is created for each...
7
by: Christian Wilhelm | last post by:
Hi! I'm trying to call a Java WebService out of a .net Client. There are two Methods, one Method requires one Parameter of type Parameter, the other Method requires one Parameter of type...
2
by: Naeem Sarfraz | last post by:
Any advice for the following situation? I've deployed my webservice on a remote server, e.g. http://mywebservice.co.uk/summary.asmx. The windows clients attempts to access this webservice and...
7
by: Peter Kirk | last post by:
Hi I am trying to write a web service. This web service is a "generic webservice" for our solution - that is, it should be able to return different data depending on who calls it. For...
2
by: news.demon.nl | last post by:
Hi, I hope someone can give me some advice on which form of security i can use best in this scenario: I have a free application that everbody on the internet can download. It calls a...
3
by: =?Utf-8?B?QkM=?= | last post by:
Hello, I just created a Hello World webservice in VB2005 (this is my first webservice ever). I ran it in debug mode and the page that came up said Hello World and said to change the webservice...
11
by: John Sheppard | last post by:
Hello there, I am running a webservice on IIS6, sometimes it runs at a reasonable speed, sometimes it runs painfully slow and sometimes inbetween. The application that consumes the service is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.