1

I am trying to access my WCF service on a shared hosting server, i can consume the service but when i try to call the service i get "The caller was not authenticated by the service" error.

Client app.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsDualHttpBinding>
                <binding name="WSDualHttpBinding_TicketingService" clientBaseAddress="http://mmservice.somee.com:8001/MMService.Ticketing.svc" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00" />
                    <security mode="Message">
                        <message clientCredentialType="IssuedToken" negotiateServiceCredential="true"
                            algorithmSuite="Default" />
                    </security>
                </binding>
            </wsDualHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://mmservice.somee.com/MMService.Ticketing.svc"
                binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_TicketingService"
                contract="MMService.TicketingService" name="WSDualHttpBinding_TicketingService">
                <identity>
                    <servicePrincipalName value="host/vb5100" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>
</configuration>

Service app.config

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true"/>
    <customErrors mode="Off"/>
  </system.web>
  <system.serviceModel>
    <client>

    </client>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="True"/>
    <services>
      <service behaviorConfiguration="MMService.Service1Behavior" name="MMService.Ticketing">
        <host>
          <baseAddresses>
            <add baseAddress = "http://localhost:8732/Design_Time_Addresses/MMService/Service1/"/>
          </baseAddresses>
        </host>
        <endpoint address ="" binding="wsDualHttpBinding" bindingConfiguration="" contract="MMService.ITicketService">

        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="MMService.Service1Behavior">
          <serviceMetadata httpGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

anybody know how to fix this ? thanks.

Lost
  • 65
  • 1
  • 6
  • Most shared hosting services don't support net.tcp (firewall limitations). It's possible that somee.com doesn't as well. If this is the case, then you'll have to change your binding to use a HTTP-based one. – carlosfigueira Jul 14 '11 at 16:38
  • OK i have changed it to wsDualHttpBinding and I can get the service visible on the server and i can comsume it, however when i try to access it, i receieve The caller was not authenticated by the service error. I have edited my question to be about this new problem. – Lost Jul 14 '11 at 19:06
  • PS: I have now changed the security mode to "None" in the client becaus ethe client and service are on different networks so the windows credentials wouldnt work. i also removed the identity and now i get either a timed out error or a no endpoint was listening error. I dont know if what i did helped or hurt but it seemed logical. – Lost Jul 14 '11 at 19:46

1 Answers1

0

I had the same error with my WCF service hosted in IIS on a shared provider. Apparently WCF does not support partially trusted callers. My solution was to add a trust declaration inside the tags of the web config file of the WCF service. Everything was just fine after that.

<configuration>
  <system.web>
    <trust level="full"/>
    ...
  </system.web>
  ...
</configuration>
Orgbrat
  • 331
  • 6
  • 20