tags:

views:

212

answers:

3

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

A: 

Did you mean to ask this question twice?

You already asked it here link text

ltech
That does not appear to be a duplicate of this question?
slugster
mistakenly i updated one of my earlier post, but i have corrected that, u can recheck that post
pankaj
A: 

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.

slugster
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
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
A: 

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.

marc_s
can u pl tell me how can i useit in first way i.e, as WCF REST service (webHttpBinding),
pankaj
@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