I’ve just recently built a Silverlight application that communicates with a server via WCF. The data we communicate back and forth has been seamless and to be honest, quite easy to implement (w/ SL). Unfortunately, I need the ability to request this same information from the WCF similarly to that of an ASMX web service. Right now, I’m running the service locally (http://localhost/aps.svc) but I’m not able to “Invoke” any of the methods via a web browser (similar to a asmx web service). For example: http://FooBar/Service/servic.aspx?op=GetName would return a name. I need this ability, as our 3rd party software is limited to using web asmx services and I would like to use the WCF already built.
I’m fairly new to WCF and web services in general – so any help would be greatly appreciated!
-Tom
In order to use your WCF service directly in the browser, you need to switch to a REST-style WCF service.
See the WCF REST Developer Center for a great deal of information on WCF and REST.
Basically, with WCF REST, you can “address” everything in your domain as resources; REST is resource-oriented, while SOAP / ASMX is operation-oriented.
So you probably wouldn’t have something like
op=GetNamein your method, but rather something like:and this would return the name “object” of that object or resource, as an XML or JSON stream of data.