Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I written wcf service for .net and Android..basic http binding for .net and web http binding for android

I am getting the Following Error:
When 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' is set to true in configuration, the endpoints are required to specify a relative address. If you are specifying a relative listen URI on the endpoint, then the address can be absolute. To fix this problem, specify a relative uri for endpoint 'http://www.sasdoc.com/test1/services/ICloudServices/RoleService/json'. 


My Web.config File is Like This:


XML
<system.serviceModel>
 <services>
<service name="ICloudServices.RoleService">
        <endpoint address="http://localhost:8732/Design_Time_Addresses/ICloudServices/RoleService/json" contract="ICloudServices.IRoleService" binding="webHttpBinding" behaviorConfiguration="restBehavior"  />
        <endpoint address="soap" binding="basicHttpBinding" contract="ICloudServices.IRoleService">

          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>

        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8732/Design_Time_Addresses/ICloudServices/RoleService/"/>
          </baseAddresses>
        </host>

      </service>
</Services>
</System.ServiceModel>

XML
<basicHttpBinding>
     <binding name="basicHttpBindingSettings" receiveTimeout="10:00:00" sendTimeout="10:00:00" openTimeout="10:00:00" closeTimeout="10:00:00" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" transferMode="Buffered" messageEncoding="Text" textEncoding="utf-8" bypassProxyOnLocal="false" useDefaultWebProxy="true">
       <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxStringContentLength="2147483647" maxNameTableCharCount="2147483647"/>
     </binding>
   </basicHttpBinding>
   <webHttpBinding>
     <binding name="webHttpBindingSettings"  crossDomainScriptAccessEnabled="true" openTimeout="00:01:00" receiveTimeout="05:00:00" sendTimeout="05:00:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" >
       <readerQuotas maxDepth="128" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
     </binding>
   </webHttpBinding>



Please help me...
Thanks in advance
Posted
Updated 21-Aug-12 21:07pm
v2

1 solution

This is the problem with address attribute. The exception message clearly tells the reason and also the solution to it.
Either remove the address value in service host, or change it to relative in the service client where the endpoint is located.
 
Share this answer
 

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