views:

6

answers:

0

I got a WCF service hosted inside the SharePoint 2010 following this article http://answers.oreilly.com/topic/1404-how-to-customize-wcf-services-in-sharepoint-2010/

Everything was going great until I wanted to increase the MaxReceivedMessageSize however there is no configuration file for this service.

I tried to add a configuration file to be deployed along with the svc service in the same directory inside the ISAPI mapped folder but I get this error:

The service '/_vti_bin/epcc/messagesarchive/contactssearcher.svc' cannot be activated due to an exception during compilation. The exception message is: Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are []..

Here is my configuration,

    <configuration>
  <system.serviceModel>
    <services>
      <service name="WCFServices.ContactsSearcher.ContactsSearcher" behaviorConfiguration="ContactsSearcherBehavior">
        <endpoint address="ContactsSearcher"
                  binding="basicHttpBinding"
                  bindingConfiguration="ContactsSearcherBinding"
                  contract="WCFServices.ContactsSearcher.IContactsSearcher"></endpoint>
        <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange"></endpoint>
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:3399/epcc/MessagesArchive/"/&gt;
          </baseAddresses>
        </host>
      </service>
    </services>
    <bindings>
      <basicHttpBinding>
        <binding name="ContactsSearcherBinding" maxReceivedMessageSize="10485760"></binding>
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ContactsSearcherBehavior">
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <serviceMetadata httpGetEnabled="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

Would be better if I can configure the binding to increase the MaxReceivedMessageSize by adding an attribute on the service class instead of the configuration file? and if yes how could this be done?