Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi ... i am new for wcf ..

i have config my App.config as given below . where i have generated three end points
of three different type bindings .


XML
<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="myBasciHttpBinding" />
      </basicHttpBinding>
      <netNamedPipeBinding>
        <binding name="namedpipeConfig" />
      </netNamedPipeBinding>
      <netTcpBinding>
        <binding name="mynetTcpBinding" />
      </netTcpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="wcfServicebehaviour">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="wcfServicebehaviour" name="WcfServiceLibraryNew.wcfServiceClass">
        <clear />
        <endpoint binding="basicHttpBinding" bindingConfiguration="myBasciHttpBinding"
          name="endPoint1" contract="WcfServiceLibraryNew.IwcfService"
          listenUriMode="Explicit">
          
        </endpoint>
        <endpoint address="nettcp" binding="netTcpBinding" bindingConfiguration=""
          name="endPoint2" contract="WcfServiceLibraryNew.IwcfService"
          listenUriMode="Explicit">
          
        </endpoint>
        <endpoint address="netpipe" binding="netNamedPipeBinding"
          bindingConfiguration="namedpipeConfig" name="namedPipeEndPoint"
          contract="WcfServiceLibraryNew.IwcfService" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:53114/wcfService.svc" />
            <add baseAddress="net.tcp://localhost:53115/wcfService.svc" />
            <add baseAddress="net.pipe:/localhost/wcfService.svc" />
          </baseAddresses>
        </host>
      </service>
    </services>
  </system.serviceModel>



but it gives an error on running that " Only an absolute Uri can be used as a base address ".
The complete error is
"System.ArgumentException: Only an absolute Uri can be used as a base address.
at System.ServiceModel.Description.ConfigLoader.LoadHostConfig(ServiceElement serviceElement, ServiceHostBase host, Action`1 addBaseAddress)
at System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress, Boolean skipHost)
at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection)
at System.ServiceModel.ServiceHost.ApplyConfiguration()
at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)
at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
at Microsoft.Tools.SvcHost.ServiceHostHelper.CreateServiceHost(Type type, ServiceKind kind)
at Microsoft.Tools.SvcHost.ServiceHostHelper.OpenService(ServiceInfo info)
"


can please tell ?
Posted
Updated 15-Jan-15 1:09am
v2

1 solution

Um...shouldn't this:
HTML
<add baseAddress="net.pipe:/localhost/wcfService.svc" />
Have two slashes:
HTML
<add baseAddress="net.pipe://localhost/wcfService.svc" />
 
Share this answer
 
Comments
Gaurav Dixit 15-Jan-15 7:46am    
thanx bro . working
OriginalGriff 15-Jan-15 8:08am    
You're welcome!

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