Last post Mar 05, 2013 11:19 PM by pak437337
Mar 02, 2013 01:56 AM|pak437337|LINK
I have a solution with 3 projects
1) ConsoleClient (for testing wcf service)
2) ServiceLibrary (for wcf)
3) Web (asp.net mvc project)
I have done some settings in my ServiceLibrary project in app.config
<endpoint address="http://localhost:8050/ServiceLibrary/basic" binding="basicHttpBinding" bindingConfiguration="" contract="MrDAStoreJobs.ServiceLibrary.Interface.IAdvertisementService" />
<add baseAddress="http://localhost:8050/Design_Time_Addresses/MrDAStoreJobs/ServiceLibrary/AdvertisementService/" />
<!-- To avoid disclosing metadata information,
set the value below to false 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" />
when i run this project, everythings seems normally using wcf test client. Now, i have also added a `WcfDataServiceTest.svc` in my `Web project(mvc)` to host my wcf service.So, my question is <br />1) what configuration do i need for my web project (web.config) to actually host this wcf service.2) And then i want to run the console app to test itNote: i have tested my service using `console project` but that was getting proxy generation from **wcf test client**.By the way, the wcfDataServiceTest.svc file looks like this;
public class WcfDataServiceTest : DataService<AdvertisementService>
// This method is called only once to initialize service-wide policies.
public static void InitializeService(DataServiceConfiguration config)
// TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
// config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All);
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
Mar 04, 2013 01:39 AM|Haixia Xie - MSFT|LINK
Now, i have also added a `WcfDataServiceTest.svc` in my `Web project(mvc)` to host my wcf service.
It seems that you are trying to host the service in IIS, if you want to host the service in IIS, please refer:
How to: Host a WCF Service in IIS.
If you want to test the service with the ConsoleClient, you just need consume the service with "Add Service Reference", it will generate proxy class for you, and in this way, the service is self-hosted.
Mar 04, 2013 01:59 AM|prabu.raveendran|LINK
Below links may help you,
Mar 05, 2013 01:31 PM|pak437337|LINK
Can i test my wcf service using local iis express or i should deploy to iis (in inetpub directory)
Mar 05, 2013 04:22 PM|sukumarraju|LINK
test my wcf service using local iis express
Yes, visual studio IIS express can be used during development.
As suggested above add service reference to your console application, being in the same solution your service is found uing
After adding the service reference, create an instance of service proxy and access service method.
Mar 05, 2013 11:19 PM|pak437337|LINK
thanks for your precious time