WCF - can't consume?

Discussion in 'General troubleshooting' started by kennyess, Apr 15, 2011.

  1. Hi,

    This is making me feel a bit stupid. I've worked a fair bit with WCF and have often had a little 'fun' getting the metadata endpoints set up correctly in the past (highway to hell anyone?).

    I got my WCF Service Application and published it using VS2010 Web Deploy.

    When I try to browse it (http://www.kennyess.com/kennyessService/kennyessService.svc) I get the page beginning "This is a Windows© Communication Foundation service. Metadata publishing for this service is currently disabled."

    When I try to consume it with a vb.net application I get told:

    "The HTML document does not contain Web service discovery information.
    Metadata contains a reference that cannot be resolved: 'http://www.kennyess.com/kennyessService/kennyessService.svc'.
    Content Type application/soap+xml; charset=utf-8 was not supported by service http://www.kennyess.com/kennyessService/kennyessService.svc. The client and service bindings may be mismatched.
    The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..
    If the service is defined in the current solution, try building the solution and adding the service reference again."

    Spent many hours now trying a variety of config settings. Have compared with a number of other services hosted elsewhere and it looks ok?

    Here's the current web.config:

    <?xml version="1.0"?>
    <configuration>

    <system.web>
    <compilation debug="false" strict="false" explicit="true"/>
    </system.web>

    <system.serviceModel>

    <services>
    <service behaviorConfiguration="kennyessService.ServiceBehavior" name="kennyess.kennyessService">
    <endpoint address="http://www.kennyess.com/kennyessService/kennyessService.svc" binding="wsHttpBinding"
    bindingConfiguration="TransportSecurity" contract="kennyess.IkennyessService">
    <identity>
    <dns value="localhost"/>
    </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="kennyess.IkennyessService"/>
    <host>
    <baseAddresses>
    <add baseAddress="http://www.kennyess.com/kennyessService/"/>
    </baseAddresses>
    </host>
    </service>
    </services>

    <bindings>
    <wsHttpBinding>
    <binding name="TransportSecurity" maxBufferPoolSize="99916384" maxReceivedMessageSize="99916384">
    <readerQuotas maxDepth="32" maxStringContentLength="9998192" maxArrayLength="99916384" maxBytesPerRead="9994096"
    maxNameTableCharCount="99916384"/>
    <security mode="Transport">
    <transport clientCredentialType="None"/>
    </security>
    </binding>
    </wsHttpBinding>
    </bindings>

    <behaviors>
    <serviceBehaviors>
    <behavior name="kennyessService.ServiceBehavior">
    <serviceMetadata httpGetEnabled="True"/>
    <serviceDebug includeExceptionDetailInFaults="True"/>
    </behavior>
    </serviceBehaviors>
    </behaviors>

    </system.serviceModel>

    <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>

    </configuration>

    The binding mismatch is probably legit. I've never had this before and don't know how to go about resolving it.

    Please help

    :(
     
  2. "kennyessService.ServiceBeha vior"

    is really

    "kennyessService.ServiceBehavior"

    The 'kennyess' namespace makes no odds, same result with or without.
     
  3. Ah... looks like the web.config didn't go across.

    I have moved the service into a subdirectory (services/).

    The address is now http://www.kennyess.com/Services/kennyessService/kennyessService.svc

    Don't know where the config file has gone...?

    - I have used IIS to add a simple test app setting to the service.. This created a web.config file! Why doesn't the config file I wrote go into place?? Republish doesn't overwrite the newly created config file either.
     
  4. Sorry for spamming your forum!

    I checked an option in VS2010 -> Property pages -> Package/Publish Web -> Items to deploy = all files in this project.

    I now have a different error - but one that I can work towards resolving.

    Thanks for listening. Maybe at least this could identify a web.config issue with web deploy for others.
     
  5. Yeah, thanks. It's not spamming, and someone will find it useful, I'm pretty sure of that.
     

Share This Page