nikk
nikk

Reputation: 2877

WCF metedata download troubles

I am having the following error creating the WCF Client Library for my application using the svcutil tool. I can do the same operation successfully on my local machine but not on the server with IIS.

C:\Program Files (x86)\Microsoft Visual Studio 12.0>svcutil.exe http://beanie.elasticbeanstalk.com/beanie/beanie.svc?wsdl Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.33440] Copyright (c) Microsoft Corporation. All rights reserved.

Attempting to download metadata from 'http://beanie.elasticbeanstalk.com/ beanie_deploy/beanie.svc?wsdl' using WS-Metadata Exchange or DISCO. Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.33440] Copyright (c) Microsoft Corporation. All rights reserved.

Error: Cannot obtain Metadata from http://beanie.elasticbeanstalk.com/beanie_deploy/beanie.svc?wsdl

If this is a Windows (R) Communication Foundation service to which you have acce ss, please check that you have enabled metadata publishing at the specified addr ess. For help enabling metadata publishing, please refer to the MSDN documentat ion at http://go.microsoft.com/fwlink/?LinkId=65455.

WS-Metadata Exchange Error URI: http://beanie.elasticbeanstalk.com/beanie_deploy/beanie.svc?wsdl

Metadata contains a reference that cannot be resolved: 'http://beanie

.elasticbeanstalk.com/beanie_deploy/beanie.svc?ws dl'.

Content Type application/soap+xml; charset=utf-8 was not supported by servic e

http://beanie.elasticbeanstalk.com/beanie_deploy/beanie.svc?wsdl. The client and service bindings may be mismatched.

The remote server returned an error: (415) Cannot process the message becaus e the content type 'application/soap+xml;

charset=utf-8' was not the expected ty pe 'text/xml; charset=utf-8'..

HTTP GET Error URI: http://beanie.elasticbeanstalk.com/beanie_deploy loy/beanie.svc?wsdl

The document was understood, but it could not be processed.

- The WSDL document contains links that could not be resolved. - There was an error downloading 'http:// win-iu76ruu909k /beanie_deploy/beanie.svc?xsd=xsd0'. - The remote name could not be resolved: 'win-iu76ruu909k'

If you would like more help, type "svcutil /?"

What can I do to get started with fixing them?

EDIT:web.config file

<behaviors>
  <serviceBehaviors>
    <behavior name="NewBehavior0">
      <serviceMetadata httpGetEnabled="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

<services>
  <service behaviorConfiguration="NewBehavior0" name="Syncre_LayerAB_WebService.LayerAB_WebService">
    <endpoint address="" binding="basicHttpBinding"
        bindingConfiguration="" contract="Syncre_LayerAB_WebService.ILayerAB_WebService" />
  </service>
</services>

Upvotes: 0

Views: 262

Answers (1)

Marc Selis
Marc Selis

Reputation: 833

Your service is correctly configured to publish its metadata, but I suspect the problem lies with the IIS settings. For example, security could be configured to use Ntlm or Basic authentication while your service is using Anonymous access.

That "charset=utf-8' was not the expected type 'text/xml'" error indicates that IIS is returning an error message instead of the metadata. Try to open the svc url (http://beanie.elasticbeanstalk.com/beanie/beanie.svc) in a browser to see the error message.

You might also have to disable the custom errors feature of IIS to see the real error message, instead of a generic one.

<configuration>
  <system.web>
    <customErrors mode="Off" />
  </system.web>
</configuration>

Upvotes: 1

Related Questions