views:

23

answers:

1

I am able to consume the WCF Service in my front end ASP MVC application. I am now trying to configure a client side service for Jquery and this is where I am running in circles.

The first thing I tried was to put the service I consumed into the client side "svc" file like below, remove the codebehind and add the factory. Using this method I get a contract null error, so I'm guessing I can't just put in the Service I consumed directly into the client side svc file.

<%@ ServiceHost Language="C#" Debug="true" Service="ServiceIConsumed" Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory" %>

So do I need to recreate all the OperationContracts and add the webHttpEndpoint, along with the other configurations, on my client side manually ?

+1  A: 

You can reuse contracts from service reference but you have to create new service implementation that will call your business WCF service.

Ladislav Mrnka
Thanks for clearing that up. I have it working except when I'm returning a complex type called "City" that has an ID and Name property, which are being returned as "[object Object]".
Jisaak