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.

Static methods in ServiceContract(WCF)

How can i declare a static method in servicecontract?Ýs there any
sample? i couldn't find any.

Best Regards,

Hakan Fatih YILDIRIM
MCP
Dec 31 '07 #1
2 5520
No; WCF contracts are interface based, and static methods don't relate
to interfaces.

Marc
Dec 31 '07 #2
Not only that, but depending on the instantiation method for the service
at the address with the particular binding, even though you are working with
an object proxy, you might effectively be making static calls (as there will
be no state stored between calls).

Remember, static (in the way you, the OP, are thinking) is a distinctly
OO concept, something which does not translate directly to services in
distributed systems.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Marc Gravell" <ma**********@gmail.comwrote in message
news:99**********************************@i29g2000 prf.googlegroups.com...
No; WCF contracts are interface based, and static methods don't relate
to interfaces.

Marc

Dec 31 '07 #3

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

Similar topics

1
by: Jim | last post by:
I am trying to figure out how to implement WCF under C++/CLI. Most examples involve C# code. For instance, an interface is defined like this: interface IMyContractCallback { void...
4
by: =?Utf-8?B?R3JlZw==?= | last post by:
I am a newbie to WCF so please forgive if this is an obvious question. I have the following. (Service contract) IEmployee public interface IEmployee { List<EmployeeGetEmployeeByID(string...
2
by: =?Utf-8?B?QnJhdmVzQ2hhcm0=?= | last post by:
I am not sure if this is the right form because I didn't see any WCF forms. Anyway, I made a very simple WCF object and hosted it in IIS. Now I have a client that builds 20 threads, and have each...
3
by: Burton Roberts | last post by:
I am "Walking Through" the VB Team's walkthrough of WCF support in VS2008. In the IService interface the <ServiceContract()indicates an error "Type 'ServiceContract' is not defined" and both...
1
by: =?Utf-8?B?Sm9zw6kgSm95ZQ==?= | last post by:
--------------------- This question has already been posted. I got a tip to use and also get rid of svcutil.exe. However, I still want to understand why it does not work the "official" way....
4
by: matthew-andrews | last post by:
Hi, I'm new to this WCF world, and have attempted to create a WCF service which takes a typed dataset as its data contract. I know this isn't always put forward for interopability, but I'm...
1
by: sailor | last post by:
In my project, I define many sevices. In these services , some method may return object and these object may be parameter as other method. But in client, these services are in different namespace,...
16
by: =?Utf-8?B?U3RldmUgQmFya2Vy?= | last post by:
WCF Question Hi guys, I’m pretty new to WCF, and have a basic question about how it works. I’m trying to use WCF to write an “SOA-system”, and am having a few problems. The...
1
by: alsammud | last post by:
Hy, I have a Wcf service tat receives files from clients. The contract: #region ServiceContract public interface IWcfService { IAsyncResult...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.