none
failed test wcf service with wcftestclient RRS feed

  • Question

  • Hi all,

    I created a wcf service following the following link,

    http://www.codeproject.com/Articles/105273/Create-RESTful-WCF-Service-API-Step-By-Step-Guide

    <?xml version="1.0"?>
    <configuration>
    
      <system.web>
        <compilation debug="true" targetFramework="4.0" />
      </system.web>
      <system.serviceModel>
        <services>
          <service name="RestService.RestServiceImpl" behaviorConfiguration="ServiceBehaviour">
            <endpoint address="" binding="webHttpBinding" contract="RestService.IRestServiceImpl" behaviorConfiguration="web">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <endpoint
              address="mex"
              binding="mexHttpBinding"
              contract="IMetadataExchange"/>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="ServiceBehaviour">
              <!-- 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>
          <endpointBehaviors>
            <behavior name="web">
              <webHttp/>
            </behavior>
          </endpointBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
     <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
      </system.webServer>
      
    </configuration>
    

    It works fine.

    After i published it, i want to test it using wcftestclient.

    It says service added successfully, but i cannot see the service in the left panel under "My Service Projects".

    Is there anybody know what's happened there?

    Thanks.

    Thursday, July 25, 2013 7:39 AM

Answers

  • Hi,

      If you would like to know how to use WCFTestClient.exe, better create a new WCF Service application[Template available in Visual Studio] and just click f5 and it will open automatically WCFTestclient...Check web.config for the configuration./


    Balaji -Please click mark as answer if my reply solves your problem.

    Friday, July 26, 2013 7:36 AM

All replies

  • Hi,

      The above service is like REST based service. WCFTestclient is used to load the service like SOAP Based and not REST based. In order to test the REST based service, just browse it in browser. for ex: http://xxx/yyy.svc/xml/23 for json, http://xxx/yyy.svc/json/23.


    Balaji -Please click mark as answer if my reply solves your problem.

    Thursday, July 25, 2013 10:24 AM
  • Hi

         If I am correct, you have created a service and want to test that by creating another project(client to consume that service).

         If it is, you have to add service reference. Steps to add are as follows

                  1) Right click references and select Service References

                  2) In that give your service url and select services(Service Contract) which will list when you give url and click go

                  3) Change the name and click ok

          Now under your project,new folder named service reference will be displayed and list the reference which you have given

        You can use the namespace to access the methods of your service

        Hope this helps

    Thanks

    Sowmiya

             

    Thursday, July 25, 2013 12:56 PM
  • Hi,

    Thank you very much for your reply.

    Yes, the reason that i made the service restful is because i also cannot add a normal WCF service in the WCFTestClient. So do you have an example of wcf service and its configure file that can work with WCFTestClient? And could you please tell me what's the key points that make a wcf service be accessed by WCFTestClient?

    Thanks again.

    Friday, July 26, 2013 7:29 AM
  • Thank you for your reply. 

    I know this way to test a wcf service, by creating a consumer project.

    But i want to use WCFTest client to test it.

    Anyway, thank you very much!

    Friday, July 26, 2013 7:31 AM
  • Hi,

      If you would like to know how to use WCFTestClient.exe, better create a new WCF Service application[Template available in Visual Studio] and just click f5 and it will open automatically WCFTestclient...Check web.config for the configuration./


    Balaji -Please click mark as answer if my reply solves your problem.

    Friday, July 26, 2013 7:36 AM
  • Wow!

    That's easy. I don't know that will do the trick!!!

    I can't believe that I spent so much time one this!

    I don't know how to thank you Balaji.

     

    Sunday, July 28, 2013 4:24 AM