Can I use a WCF RESTful service from Silverlight? - wcf

I have a WCF RESTful service using the WebHttpBinding and I want to know if I can use this in Silverlight 3 without any modifications?

You can make HTTP requests from a Silverlight client, so therefore yes you can access a WCF Restful service using WebHttpBinding.
What part of making an HTTP request do you not know how to do?

Related

REST and hosting of WCF service

I am developing a WCF service (VS2010, .NET 4.0). If in the WCF service I utilise REST type functionality (i.e. decorate my methods with WebGet, etc), since REST heavily leverages the HTTP protocol, am I locked into hosting the WCF service as HTTP - i.e. do I have the option to host as net.tcp ?
Short answer - Yes, unless you want to write your own HTTP stack analog.
Is there any particular need in Tcp?

Advantages of WCF Web API over WCF REST service

I already have a WCF service that communicates through SOAP messages now I have a requirement to modify this service such that it can be consumed from JavaScript. The client asked me to look into WCF Web Api. I don't understand what are advantages I'm going to get using WCF Web Api than WCF RESTful services. Is WCF RESTful services is enough for this job?
WCF Web API is evolution of current WCF REST services = it will be the next version of WCF REST but at this time it is still preview.

Create WCF Json/RESTful service client proxy

here is my question: Is there any tool to generate one service client proxy when the service is Rest/Json? the service is WCF, and one of the clients is WPF and i need this in order to create the tests with similar code than I test the classic Soap WCF services.
If not What is the best way to achieve this?
Thanks in advance
No, there isn't simply because there is no metadata with RESTful protocols such as you get the WSDL from SOAP.
If the service is WCF, you can use the svcutil.exe util to create a client even if you're using JSON or REST as the binding.
This thread has information on it:
Client configuration to consume WCF JSON web service

WCF BasicHttpBinding Http Post

Is it possible to post to a WCF service hosted in IIS? I know that that this is possible using REST but I really need the WSDL generation and SOAP headers. I need to transition an existing ASMX web services to WCF but I need to also allow my clients to continue to utilize the service via http posts (xml http request via javascript). Is REST my only option?
No, with a SOAP service, you need to use the SOAP methods and actions - you cannot use HTTP POST to "dump" some data on a SOAP service.
If you need HTTP POST, then REST is the way to go.
You can also use REST style WCF
http://msdn.microsoft.com/en-us/netframework/cc950529.aspx

Calling WCF Service from MS Access

I want to create a create a WCF Service which is invoked on the button click of MS Access Form.
You CAN consume WCF services through MS Access, but not via standard WCF mechanisms. You'll need to consume the service via GET requests, POST requests, or SOAP requests.
One way to accomplish this for SOAP requests on the Access side is using the SOAP toolkit:
http://msdn.microsoft.com/en-us/library/aa140260%28office.10%29.aspx
Another way that would work for GET, POST or SOAP requests is using XMLHTTP (if you go the SOAP route, you'll need to make your own SOAP envelope in the XML):
http://www.codemaker.co.uk/it/tips/ado_conn.htm (search for XMLHTTP)
On the WCF side you have a couple of choices:
Host a WebHttpBinding service. This gives you options to expose GET and POST endpoints for your services. See http://www.windowsitpro.com/article/net-framework2/exposing-classic-http-endpoints-with-wcf-in-net-3-5.aspx.
Host a BasicHttpBinding service that exposes a SOAP endpoint (this is the default WCF endpoint if you create a new service in Visual Studio). If you go this route, you probably want to set it to use legacy XML serialization and WSDL for compatibility if you go with option 1 on the access end (see http://msdn.microsoft.com/en-us/library/system.servicemodel.xmlserializerformatattribute.aspx).
One other thing to note: If you create a BasicHttpBinding WCF Service with XmlSerializerFormatAttribute, you are basically getting (from a data exchange standpoint) the same thing as if you were to write a legacy asmx service.
You cannot consume a WCF directly with MS Access.
If you own the WCF service, you would have to change it to a web service using HTTP bindings.
If you don't own it, you will have to write your own web service that is basically a wrapper around the WCF.
Then you can consume it as a web service in MS Access.