locked
Check WCF method result without WCF client? RRS feed

  • Question

  • User48651432 posted

    My WCF service has 2 methods and if I debug through the wcf client, everything works correctly.

    Besides using the wcf client, is there any way to make sure that I'm correctly accessing the method? For example, I want to make sure that I'm accessing the method correctly with the following url: http://localhost:4916/Service1.svc/GetList

    The reason I ask is because I can't test through a browser, but I'm always getting a blank page regardless of the method name. "GetList" is the correct name, but entering anything other name (ie. "GetListBlah") will also display a blank page.

    Thanks.

    Tuesday, July 9, 2013 4:49 PM

Answers

  • User48651432 posted

    I converted the result to JSON and now I can see the result in the browser.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 10, 2013 4:11 PM

All replies

  • User220959680 posted

    WCF Test client is best tool to test service methods. 

    Any method that works in WCF Test client works in any client. 

    Besides using the wcf client, is there any way to make sure that I'm correctly accessing the method? For example, I want to make sure that I'm accessing the method correctly with the following url: Fiddler

    The reason I ask is because I can't test through a browser, but I'm always getting a blank page regardless of the method name. "GetList" is the correct name, but entering anything other name (ie. "GetListBlah") will also display a blank page.

    REST service being the Http protocol can be invoked from the browser. SOAP service can be invoked from the browser as it utilises other transport protocols (ws-*). 

    In order to test SOAP service create simple console app, add web service reference and test the functionality.

    Tuesday, July 9, 2013 5:24 PM
  • User48651432 posted

    Thanks for the post.

    The question isn't really how to test the service, I already know it works. The problem is that I won't be using it with a .net application so I can't add it as a reference.

    I'm working with a 3rd-party chart control that reads from a service, so I need to enter the exact URL that will return data. How can I make sure that the URL I'm using in the chart will actually return data?

    For example, I know this JSON service is correct because I can actually see the returned data. How can I do this with the wcf service?

    Wednesday, July 10, 2013 9:34 AM
  • User1482785467 posted

    Hi vmhatup,

    fiddler can do it for you ...

    Wednesday, July 10, 2013 10:16 AM
  • User220959680 posted

    I know this JSON service is correct because I can actually see the returned data. How can I do this with the wcf service?

    As mentioned earlier 'Fiddler' is widely used web debugger for web services or web applications testing.

    It is feasible to make a GET request with the URI you already tested in WCF Test Client in Fiddler.

    There are number of browser Addons such as 

    Chrome - Advanced REST client

    Firefox POSTER 

    Wednesday, July 10, 2013 2:03 PM
  • User48651432 posted

    I converted the result to JSON and now I can see the result in the browser.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 10, 2013 4:11 PM