WCF service wrong URL address listed in service.svc?wsdl RRS feed

  • General discussion

  • I have a problem in deploying WCF service to IIS 6 server.

    1. On VS ->Build->Publish the Web Site, The Target Location: http://mydomain.com/sl13 . (Everything Okay and publish succeeded)

    2. Open IE and go to http://mydomain.com/sl13/service.svc?wsdl

    3. All the URL in the xml file is point to a computer name (svr02), not domain name (mydomain.com). Please see the code listed below:-


    ..... Skipped Code...

    - <xsd:schema targetNamespace="http://tempuri.org/Imports">

      <xsd:import schemaLocation="http://svr02/sl13/Service.svc?xsd=xsd0" namespace="http://tempuri.org/" />
      <xsd:import schemaLocation="http://svr02/sl13/Service.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
    ..... Skipped Code ....
    - <wsdl:service name="Service">
    - <wsdl:port name="BasicHttpBinding_IService" binding="tns:BasicHttpBinding_IService">
      <soap:address location="http://svr02/sl13/Service.svc" />



    4. I try to create a window App and add service reference with the URL: http://mydomain.com/sl13/

    5. It shown the following error:-

    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://svr02/sl13/Service.svc?xsd=xsd0'.
      - The remote name could not be resolved: 'svr02'
    Metadata contains a reference that cannot be resolved: http://mydomain.com/sl13/service.svc?wsdl'.
    Content Type application/soap+xml; charset=utf-8 was not supported by service http://mydomain.com/sl13/service.svc?wsdl.  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.


    Anyone can tell me how to solve this problem. Thanks!


    Wednesday, July 16, 2008 10:53 AM

All replies

  • Hi,

    Please change the address of the endpoint in Web.config:

     <endpoint address="http://mydomain.com/sl13/service.svc"



    Thursday, July 17, 2008 11:00 PM
  • After changed the endpoint address, server error displayed:-

    "No protocol binding matches the given address 'http://mydomain.com/sl13/service.svc'. Protocol bindings are configured at the Site level in IIS or WAS configuration."

    Friday, July 18, 2008 2:29 AM
  • Hi,

    Please do this after deployment. You can find the Web.config file in C:\Inetpub\wwwroot\YourWebSiteFolder. Open it in notepad and change the address.

    Friday, July 18, 2008 2:53 AM
  • Yes, I do it after deployment. The error reported by IIS server not VS.


    Friday, July 18, 2008 7:27 AM

  • Hi,

    Please do this after deployment. You can find the Web.config file in C:\Inetpub\wwwroot\YourWebSiteFolder. Open it in notepad and change the address.


    I have modified the endpoint address

            <endpoint address="http://mydomain.com/sl13/service.svc" binding="basicHttpBinding" contract="IService">

    and add baseAddresses:

                <add baseAddress="http://mydomain.com"/>


    both not work...




    Saturday, July 19, 2008 6:50 AM
  • Hi

    Is sl13 the virtual directory which points to the physical directory where the service.svc locates?

    When publishing it you can name it as sl13 directly. In this way a virtual directory with the same name will be created in IIS. In addition a physical directory containing the service will be created at C:\Inetpub\wwwroot\sl13.

    Sunday, July 20, 2008 9:47 PM
  • Hi there,

    Did you solve this issue? I too have this error occurring and have not been able to fix it yet.



    Wednesday, August 6, 2008 9:40 PM
  • Still not solved. Any idea? Did you try to deploy the application to Window Server 2008?

    Wednesday, August 6, 2008 9:51 PM
  • Hi, I don't have the anwser, but I Know someone who does...


    if you don't want to go there, this is the essecial...

    1. Open IIS
    2. Right click on your website and click "properties"
    3. Click the "Web Site" tab and then click the "Advanced" button under the "Web site identification" heading
    4. You should have a default Identity for the website (TCP port 80). Edit that and make sure the host header value is the domain name for your website (so it should say www.yourdomain.com)

    I think that this solve your problem.


    Thursday, August 14, 2008 4:27 PM
  • The right answer!

    Wednesday, December 16, 2009 3:52 AM
  • Thank you

    Fix my problem.

    Tuesday, April 14, 2015 8:53 PM