1

I have a WCF Service programmed in VB.NET that is exhibiting strange behavior. The web.config has the following xml:

<system.serviceModel>
  <services>
    <service behaviorConfiguration="CentricBasicHttpBehavior" name="OnbaseService">
      <endpoint binding="basicHttpBinding" bindingConfiguration="CentRicBasicHttpServerBinding" contract="IOnbaseService">
        <identity>
          <servicePrincipalName value="HTTP/JFOLKENDT7E" />
        </identity>
      </endpoint>
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="CentricBasicHttpBehavior">
        <serviceAuthorization impersonateCallerForAllOperations="true" />
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="true" />
        <dataContractSerializer maxItemsInObjectGraph="2147483646" />
        <serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100" maxConcurrentInstances="100" />
      </behavior>
      <behavior name="">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="true" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  <bindings>
    <basicHttpBinding>
      <binding name="CentRicBasicHttpServerBinding" maxReceivedMessageSize="5000000">
        <security mode="TransportCredentialOnly">
          <transport clientCredentialType="Windows" />
        </security>
      </binding>
    </basicHttpBinding>
  </bindings>
</system.serviceModel>

When I configure the service in wcf test client, both the Binding Mode and TransportClientCredentialType are coming across as "None". I expected for them to be "TransportCredentialOnly" and "Windows" respectively.

Can someone please share with me how WCF Test Client infers the binding configuration, and how I should go about correcting this issue? The end result is that within the source code of the service, the WindowsIdentity isn't impersonating the user like I expected.

Thanks,

Jason

Jason
  • 174
  • 3
  • 18

2 Answers2

1

I work with Jason and we looked at this together. The service configuration needed the name and contact properties to match the fully qualified service class name and fully qualified contact interface name. Otherwise, we were getting the fun new .Net 4.0 defualt bindings for a default service.

Matt Poland
  • 398
  • 4
  • 9
  • Yep. If you look at the Name attribute of the Service tag, you'll see I didn't fully qualify it with namespaces. – Jason Jul 29 '11 at 17:33
0

In my own experience with WCF, I had modified session Timeouts and connection Timeout settings in the config file but WCF Test Client was not respecting those settings. Seems like WCF Test client just takes up the default values for communicating with WCF services. Hence I test my WCF services using my own custom WCF Test Clients by generating app.config and proxy. cs through svcutil.exe .

Deepansh Gupta
  • 593
  • 4
  • 9
  • Well... in all actuality (at least in this case), the WCF Test Client is inferring it correctly, because if I change the binding configuration inside WCF Test Client to what I put in the web.config, and launch one of the web methods using wcf test client, I get the following error: "The remote HTTP server did not satisfy the mutual authentication requirement." So I don't think WCF Test client is in error here; I just want to know HOW it inferrs the binding configuration so I can fix it. – Jason Jul 29 '11 at 14:59