Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have tried to set up my first cksdev wcf service in sharepoint 2010 and am unable to instantiate my service reference client object in code.

I have two separate sharepoint projects in my solution.

One project that holds the service references and will use the services of the other project. And one project that holds the cksdev wcf service.

The namespace of sharepoint project that holds the wcfservice is NameX.NameY.Application.Services

The wcf markup looks like this

When the first project which holds the wcf services is built and deployed. I am able to add a service reference to it from the othe sharepoint project that will use it.

And i am also naming the service reference Action.

The problem that i get is that when i in code do this

     ActionClient client = new ActionClient();

i immediately get this exception.

Could not find default endpoint element that references contract 'Action.IAction' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

I would be very thankful for any help with this.

with regards Stefan Johansson

share|improve this question
    
If you don't post your Service.Model configuration for your service and for your client it will be very hard to actually help you. Just looking at your error message i would say that you haven't configured your client side endpoint correctly. –  Robban1980 Aug 24 '12 at 7:18
    
Your absolutely correct, i am new at using WCF, so i sti –  Stefan Johansson Aug 24 '12 at 9:01
    
sorry slipped on the keyboard, i am new at wcf so i am probably doing something not so intelligent. From my understanding when using a factory attribute in the cksdev wcf template, the endpoint configuration would be configured for me, and i would not need to put them in a servicemodel configuration section in my app.config. Further regarding the client config it looks like this, –  Stefan Johansson Aug 24 '12 at 9:05
    
<system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IAction" closeTimeout="00:01:00" –  Stefan Johansson Aug 24 '12 at 9:11
    
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" –  Stefan Johansson Aug 24 '12 at 9:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.