wcf

Can a WCF ServiceRoute Route Prefix contain a path value?

Currently I use this: RouteTable.Routes.Add(new ServiceRoute("API", new WebServiceHostFactory(),typeof(MySite.Web.MyServiceV1))); To make this url point to the MyServiceV1.SVC MySite.com/API I want to use a Prefix which contains a / in it but it doesn't seem to work. RouteTable.Routes.Add(new ServiceRoute("API/V2", new WebService...

Unity Child Container Lifetime with WCF

We're using Unity to provide dependency injection within the WCF service layer for our current project, and we have followed examples such as the following to write a service host factory, service host, service behaviour and instance provider: http://avingtonsolutions.com/blog/post/2008/08/02/Uisng-Unity-with-a-WCF-Service.aspx The sol...

What to take care of when using NHibernate with WCF?

I am just a simple beginner with both NHibernate and WCF. I would like to use NHibernate as my ORM in the class library where my repositories are. I also need to use WCF to expose my business logic, and behind that my repositories, to the rest of the company. Is there some good documentation on how to accomplish this task? Are there pit...

Help: Contract First Webservices

I want to write a high level design document for a application which will expose it's webs ervices for various clients. For this purpose I need to provide the WSDL of webservices that we will develop in the future at server side. I've use web services earlier but never drill down in the details of WSDL. I searched a lot and found that I...

How to add WCF Service Reference when using net.msmq

How do you start a WCF client when using the service is only available on net.msmq - when you use the "Add Service Reference", you get an error ... The MetadataExchangeClient instance could not be initialized because no Binding is available for scheme 'net.msmq'. You can supply a Binding in the constructor, or specify a configurationN...

WCF location seen in a test

WCF project in a Test harness. Why would HttpContext.Current.Server.MapPath("~/"); or HttpContext.Current.Server.MapPath("."); fail in my test? I am attempting to put together a PDF building module for existing app. I have to identify where to write the final output. TIA ...

Best Practices to Deprecate WCF Services

Is there any attibute or similar mechanism to inform a web service consumer that a Service/Operation contract has been deprecated? I have a set of WCF services that need updating. As part of this update I would like to simplify some of the original design. I plan on leaving the existing operations in place but I would like to somehow ...

"Could not find endpoint element with name..."

Sorry for the long problem statement...I've spent two days debugging and have a lot of notes... I have a WCF data service and another process trying to connect to it as a client via TCP and/or HTTP. I have a VERY simple test client app that seems to connect fine, but the more complicated production app cannot connect (neither TCP or HT...

Mocking wcf in silverlight

I thought that I could create a WCF in and call it in Silverlight. I would inject an interface to the WCF. Then in my unit test I would mock the wcf.... However when I actually got to do this I notice that the interface does not actually have the methods that I am calling. ie myWCF.myfunctionCompleted(myhandler); myWCF.myfunctionAsy...

Simple proxy server for web services

Hi I am looking for a proxy server for web services primarily for port forwarding in the DMZ environment. Previously I have used Amberpoint or Data Power for this purpose. Now, in my new project I do not have access to any proxy servers and the traffic is pretty light at a maximum of 100 requests/day. I looked at Managed Service Engin...

WCF-service: how to authorize user

WCF-service is hosted by ASP.NET web-site. ASP.NET Membership is not used in web-site. User is logged using "custom" page, ID of logged user is stored into Session (HttpContext.Current.Session). WCF-service is consumed by Silverlight (4 version) application. How to check if current user (that loaded Silverlight application) is authoris...

Why is WCF serializing a Enum as a string?

Code on the server <DataContract(Namespace:="http://schema.aam.us.com/2010/6", Name:="TradeStatus")> Public Enum TradeStatus NewOrder = 100 SendToProvider = 101 ProviderSubmitted = 102 ProviderAccepted = 103 ExecutionPending = 104 Executed = 105 TicketsCreated = 106 'TERMINAL STATE End Enum <DataContract(N...

How to create generic WCF OperationContract to retrieve data from a SQL table.

I've been given the task of creating a .net interface for a table that will be retrieved a database. One of the obvious things that the interface must do is retrieve data from the table. So.... I could write a function that simply does Select * from MyTable; and then returns the result. However, the table has ten columns and someone u...

How to read binary data/image from WCF REST

I have the following: Public Interface INorthwindSvc <OperationContract()> <WebGet(UriTemplate:="EmployeePictureBytes?id={EmpId}")> Function GetEmployeePictureBytesById(ByVal EmpId As String) As Byte() End Interface I got the method implemented (using EF 4.0) as follows: Public Function GetEmployeePictureBytesById(ByVal EmpId As S...

Protocol Buffers over HTTP GET using WCF

I have a WCF service hosted that is returning a byte[] of protobuf-net serialized data. Originally this was hosted over the default webHttpBinding settings (SOAP) and everything was working properly. I recently found out that I need to call HTTP GETs and POSTs directly from our client so I thought it'd be easier to switch to use a RESTfu...

How to specify custom SoapAction for WCF

Hi, I am creating a WCF service which will be called from another service. In the WSDL soapaction is appearing as follows <soap12:operation soapAction="http://tempuri.org/ISubscriptionEvents/MyMethod" style="document" /> I want it to be <soap12:operation soapAction="http://www.TextXYZ.com/FUNC/1/0/action/MyMethod" style="document" /...

Is WCF RoutingService transactional?

Hello everyone, In WCF4 we a provided with a great feature - routing services. MSMQ4 supports remote transactional read. So now building simple publish-subscribe on WCF seems to be a piece of cake. But I get one doubt. Does the System.ServiceModel.Routing.RoutingService, which implements routing stuff for messages, work in a transaction...

Assembly could not be loaded

Hi, I am creating a WCF service with a Silverlight CLient I added a reference to System.ServiceModel.PollingDuplex in Silverlight 3. I modified the web.config When I run, I am getting this error. Could not load file or assembly 'System.ServiceModel.PollingDuplex, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad36...

A WCF service which deals with large objects

Viewing WCF in its use as a way to do RPC between remote PCs you can nicely just send an object as a method parameter. This is easy to code but means whenever the object changes you send the whole thing, and also potentially means the receiver has to have extra logic to only act on changed fields. Or you can have a class which has one me...

NHibernate Session gets disposed off on each wcf service method call

Hi guys, I am using Wcf in Sharp Architecture. I have configured my project following northwind sample using WcfSessionStorage etc. I have a method in the wcf service that gets a list of business object using Repository<>.GetAll(). I am testing the service method using WcfTestClient. When the method is called the very first time, every...