0

How can i test a wcf service in a browser? I mean if i only enter the url in the browser it should give me only relevent xml

2 Answers 2

2

It depends on what type of WCF service you have:

  • if you're using a WCF REST service (webHttpBinding), then you should be able to just navigate to the service address, e.g. http://yourserver/somedir/service.svc

  • if you're using anything else, you have a SOAP service, and you cannot test a SOAP service in a web browser - the browser just doesn't understand and speak SOAP. There's however a WCF Test Client app in your C:\ drive somewhere which you can use for that purpose.

2
  • can u pl tell me how can i useit in first way i.e, as WCF REST service (webHttpBinding),
    – pankaj
    Apr 5, 2010 at 11:48
  • @pankaj: check out the WCF REST dev center on MSDN: msdn.microsoft.com/WCF/REST. To test a WCF REST service, just navigate to the service URL and you should see the XML returned right away
    – marc_s
    Apr 5, 2010 at 12:17
0

Make a test application for it. It can be as simple as having a UI with a bunch of buttons, when you press a button then a certain function exposed by the WCF service is called, you could maybe echo the output to a textblock in the app. You could also have a bunch of input type UI items (textboxes, dropdowns, whatever) so you can select parameters to pass to the WCF function.

If you want to be really classy, then make a set of unit tests for it - this means that you will have to have it hosted somewhere though so that it can be called any time the tests are run.

2
  • hi, i need to use the output of the wcf service in a iphone application. So i need a url now which can return me xml which i can use it in iphone
    – pankaj
    Apr 5, 2010 at 11:36
  • You should mention things like that in your question description - it is an important detail. Having said that, XML is XML - you can "test" it on any platform, unless your WCF functions are changing what is returned based on the caller.
    – slugster
    Apr 5, 2010 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.