I have created a simple wcftestclient application. I used window server 2003,.net 3.5 framework. When run the application, it get the following error "Failed to add a service. Service metadata may not be accessible. Make sure your service is running and
exposing metadata." Please help me on this. The same application works on windows 7.
Here is the appconfig file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service behaviorConfiguration="EvalServiceLibrary.Service1Behavior"
name="EvalServiceLibrary.EvalService">
<endpoint address="ws" binding="wsHttpBinding" contract="EvalServiceLibrary.IEvalService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<endpoint address="basic" binding="basicHttpBinding" contract="EvalServiceLibrary.IEvalService" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:1374/Design_Time_Addresses/EvalServiceLibrary/Service1/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="EvalServiceLibrary.Service1Behavior">
<!-- 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="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
See above the config file, it seems that there are no any issue in your app.config, but this error may be caused if the service did not start correctly. I want to know how did you host your WCF service? you can try to host your WCF service in an console application,
and also make sure that the objects being used to put DataContract and DataMembers for its repective properties.
Yes, the issue is not with the app.config file. I tested the same code in other environment and it was working good. The problem may be,i test the code where IIS have sharepoint environment. Its a Virtual PC where sharepoint is installed and running. So
i think they may be issue with that. So i tested in other environment where sharepoint is not running. I guess this may be the issue. Any idea?
Based on my understanding, there is no problem hosting a WCF service on a virtual PC running sharepoint, but it is advisable to host it in a different website rathan than in sharepoint. Here is a article to which you can refer to.
venkatramcse
Member
40 Points
72 Posts
Could not run the Wcftestclient application
Feb 10, 2012 04:59 AM|LINK
Hi,
I have created a simple wcftestclient application. I used window server 2003,.net 3.5 framework. When run the application, it get the following error "Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata." Please help me on this. The same application works on windows 7.
Here is the appconfig file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service behaviorConfiguration="EvalServiceLibrary.Service1Behavior"
name="EvalServiceLibrary.EvalService">
<endpoint address="ws" binding="wsHttpBinding" contract="EvalServiceLibrary.IEvalService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<endpoint address="basic" binding="basicHttpBinding" contract="EvalServiceLibrary.IEvalService" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:1374/Design_Time_Addresses/EvalServiceLibrary/Service1/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="EvalServiceLibrary.Service1Behavior">
<!-- 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="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Thanks,
Venkat V
Peter pi - M...
Star
12871 Points
1786 Posts
Re: Could not run the Wcftestclient application
Feb 13, 2012 04:34 AM|LINK
Hi,
See above the config file, it seems that there are no any issue in your app.config, but this error may be caused if the service did not start correctly. I want to know how did you host your WCF service? you can try to host your WCF service in an console application, and also make sure that the objects being used to put DataContract and DataMembers for its repective properties.
Hope this hopes
Regards,
Peter
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
venkatramcse
Member
40 Points
72 Posts
Re: Could not run the Wcftestclient application
Feb 13, 2012 05:50 AM|LINK
Hello Peter,
Thanks for your help on this issue.
Yes, the issue is not with the app.config file. I tested the same code in other environment and it was working good. The problem may be,i test the code where IIS have sharepoint environment. Its a Virtual PC where sharepoint is installed and running. So i think they may be issue with that. So i tested in other environment where sharepoint is not running. I guess this may be the issue. Any idea?
Thanks,
Venkat V
Peter pi - M...
Star
12871 Points
1786 Posts
Re: Could not run the Wcftestclient application
Feb 16, 2012 06:01 AM|LINK
Hi,
Based on my understanding, there is no problem hosting a WCF service on a virtual PC running sharepoint, but it is advisable to host it in a different website rathan than in sharepoint. Here is a article to which you can refer to.
http://www.dotnetcurry.com/ShowArticle.aspx?ID=760
Regards,
Peter
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework