wcf

How can I add a prefix to a WCF ServiceContract Namespace

Hi, I'm trying to implement an UPnP MediaServer in WCF. I'm slowly getting there, but now I've hit a brick wall. I need to add a prefix to the ServiceContract namespace. Right now I have the following: [ServiceContract(Namespace = "urn:schemas-upnp-org:service:ContentDirectory:1")] public interface IContentDirectory { [OperationCo...

How to use a SOAP API in ASP.NET?

Hi, I've trying to use the API for CapsuleCRM... http://capsulecrm.com/help/page/api_gettingstarted I've been reading some articles on SOAP in asp.net and I just don't get it. Most of them seem to be ablut creating a web service, not using it and none of them seem to explain how to use basic HTTP authentication. I have got as far as ...

Do you have to install the REST starter kit in asp.net to access APIs?

Hi, I'm currently trying to access a REST API for the first time using visual web developer 2008 express edition. Every article I have found says you have to install the WCF REST starter kit which is a .msi file, which would suggest that I have to install it on my machine and presumably our server too. My question is this. Is there a ...

WCF error service error message with shared classes

Source code: http://code.google.com/p/sevenupdate/source/browse/#hg/Source/SevenUpdate.Base SevenUpdate.Base.Sui cannot be used since it does not match imported DataContract. Need to exclude this type from referenced types. Now I tried unchecking reuse reference types and I was able to get my project to compile. but when sending a coll...

What are the industry standard ways of packaging and deploying WCF services

Hi Is there a industry standard way of packaging and deploying web services which can cater to following contraints/Complexities Web services are developed in different location and ultimately deployed on common site This should take care of versioning ( Side by side web service deployment) Client side versioning issues ...

Why are WCF Service Reference name spaces relative to my WCF client project's default namespace?

I have a WCF service with a namespace called: MyCompany.MyApplication.Configuration.ConfigurationHelperService On the client side I have an assembly called which consumes this service: MyCompany.MyApplication.Core (this is the default namespace) When I add the service reference, the namespace I'm asked to specify in the Add Service...

Specify IP address of WCF endpoint at runtime

I have a bunch of remote machines all running the same WCF service over HTTP. I have a central configuration utility that needs to decide at runtime which of these to connect to. I do not want to define all the endpoints in the configuration file because this is all database driven. I naively tried this: CustomerServiceClient GetClie...

Creating instance of a service-side DataContract class on client-side in WCF

Hi, I have my custom class Customer with its properties. I added DataContract mark above the class and DataMember to properties and it was working fine, but I'm calling a service class's function, passing customer instance as parameter and some of my properties get 0 values. While debugging I can see my properties values and after it g...

Arguments of using WCF/OData as access layer instead of EF/L2S/nHibernate directly

We develop mostly low traffic but highly specialized web applications. Normally we use L2S, EF or nHibernate as access layer and then throws Asp.Net MVC to it and in which for normal crud operations we query the ISession/DataContext directly but for more advanced functions/side effects we put it in a some kind of service layer. Now, i ...

InvalidOperationException when using soap client

I've added as wsdl file using the add servece reference dialog in vs2008. MyService serviceproxy = new MyService(); When I instantiate the service proxy, I get an InvalidOperationException with the following text (translated from german): Could not find default endpoint element to the contract "ServiceName.ServiceInterface" in...

linking the EF 4.0 context to the WCF call context

Hello, I would like to create an Entity Framework 4.0 context when a call is received and invoke to save changes when it finish, (something like JPA). I think it is a good idea because I can use the state for all the call, It is short and encapsulate enogh to be threadsafe and long enough for caching calls and the context itself. Any ...

WCF and Unity - Dependecy Injection

I'm trying to hock up WCF with dependecy injection. All the examples that I have found is based on the assumptions that you either uses a .svc (ServiceHostFactory) service or uses app.config to configure the container. Other examples is also based on that the container is passed around to the classes. I would like a solution where the ...

WCF CreateMessage from custom body xml

I have the following code: string body = "<custom xml>"; XDocument doc = XDocument.Parse(body); MemoryStream stream = new MemoryStream(); XmlWriter writer = XmlWriter.Create(stream); if (writer != null) { doc.Save(writer); writer.Flush(); writer.Close(); } stream.Position = 0; XmlReader rd = XmlReader.Create(stream); Message o...

How to expose service contract interfaces with multiple inheritance in WCF service on single endpoint

I have only simple data types in method signature of service (such as int, string). My service class implements single ServiceContract interface say IMathService, and this interface in turn inherits from some other base interface say IAdderService. I want to expose the MathService using interface contract IAdderService as a service on a ...

The maximum nametable character count quota (16384) has been exceeded while reading XML data

When I am trying to read a meta data I got this error any Idea here is My code WSHttpBinding binding = new WSHttpBinding(SecurityMode.None); binding.MaxReceivedMessageSize = Int32.MaxValue; // DPNote: This may actually be too big. see how it performs. binding.ReaderQuotas.MaxNameTableCharCount = 99999999; MetadataExchangeClientMode ex...

Silverlight - Closing a Service

Hello, I'm working on a Silverlight application that works with WCF services. While loading the service metadata in my browser, I noticed that it provides the following code: class Test { static void Main() { myServiceClient client = new myServiceClient(); // Use the 'client' variable to call operations on the ...

Figuring out the required MaxReceivedMessageSize in WCF with NetTcpBinding

I'm using NetTcpBinding in WCF and i want to send a Stream which does not exceed the size of 1 MB. I have set the MaxReceivedMessageSize to a really high number and that works fine of course. But I am curious: Does setting the MaxReceivedMessageSize to a very hight number have any (negative) impact or would it be useful to set it just...

Change the default WCF directory.

I have a WCF service which references a 3rd party DLL. That DLL looks for a settings file in the same directory as the DLL. However, WCF by default sets the current directory to "Inetpub" so of course the setting file can't be found. I tried to set WCF to "Aspnet compatibility mode" but that didn't seem to work. Any help is much apprec...

Passing Validation exceptions via WCF REST

I am using WCF and REST, and I have complex types, which are working fine. Now I need to check for validation, I am thinking of using DataAnnotations e.g. public class Customer { [Required] public string FirstName {get;set;} } Now where the issue is how do I pass this validation down to the REST service? ALso I need to validat...

How can I compose a WCF contract out of multiple interfaces?

I've got multiple interfaces. All of them should be inherited and exposed by a single contract interface. interface A { void X(); } interface B { void Y(); } interface C: A, B {} // this is the public contract How is this possible? I can't add ServiceContract to A and B because that would lead to multiple endpoints. And I don't want ...