Click here to Skip to main content
15,900,816 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have a wcf service which is hosted in iis. After hosting it the wsdl url is used for consuming my webservice. But whenever the code is running it id raising an error Invalid URI: The hostname could not be parsed. why it is so

[FROM OP'S COMMENT]
XML
<!--?xml version="1.0"?-->
<configuration>
  <system.web>
    <compilation debug="true" targetframework="4.0"></compilation>
  </system.web>
  <system.servicemodel>
    <behaviors>
      <servicebehaviors>
        <behavior>
          <servicemetadata httpgetenabled="true"></servicemetadata>
          <servicedebug includeexceptiondetailinfaults="true"></servicedebug>
        </behavior>
      </servicebehaviors>
    </behaviors>
    <servicehostingenvironment multiplesitebindingsenabled="true"></servicehostingenvironment>
  </system.servicemodel>
 <system.webserver>
    <modules runallmanagedmodulesforallrequests="true"></modules>
  </system.webserver>
</configuration>
Posted
Updated 27-Apr-15 7:59am
v2
Comments
virusstorm 27-Apr-15 13:44pm    
Without seeing the web.config, I can't say for certain, but I believe your issue is going to be with the web.config. You most likely have an entry in there that is returning a bad value in your WSDL.
Vish014 27-Apr-15 13:51pm    
<!--?xml version="1.0"?-->
<configuration>

<system.web>
<compilation debug="true" targetframework="4.0">

<system.servicemodel>
<behaviors>
<servicebehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<servicemetadata httpgetenabled="true">
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<servicedebug includeexceptiondetailinfaults="true">



<servicehostingenvironment multiplesitebindingsenabled="true">

<system.webserver>
<modules runallmanagedmodulesforallrequests="true">


virusstorm 27-Apr-15 14:16pm    
I'm not sure what you posted.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900