|
|
Comments and Discussions
|
|
 |

|
Thank you very much.
I got what I need exactly.
|
|
|
|

|
Found exactly what I was looking for.
|
|
|
|
|

|
Helped me lots although I did get caught out in my own project...
This worked for me:
<endpoint name="REST"
address=""
binding="webHttpBinding" bindingConfiguration="RESTBinding"
contract="xxxxxService.IService1">
I initially copy&pasted from this article but needed to changed BehaviourConfiguration to BindingConfiguration for my own scenario. Without it, no error but no .svc published...
I probably need specific BehaviourConfigurations too.
Good work mate
Would be five if touched upon a couple more points. Would almost certainly be five if there was just a bit more whitespace in the example. More white lines please!
|
|
|
|

|
I was using application/xml and kept getting Status 400 and 500 when i call the service using PHP.
application/x-www-form-urlencoded solve my problem. thanks again.
|
|
|
|

|
Very helpful sir,
It will better if you introduce Restful Services GET/POST with subscribe/unsubscribe technique.
Thanks
|
|
|
|
|
|

|
I already worked on creating a webservice using get method. This article gave me everything I needed to add the POST method to my web service.
EASY, STRAIGHTFORWARD, & To the Point! I was up in about 10 minutes going through this easy to understand article.
Just a noob trying to learn
|
|
|
|

|
Hi OnlineNewby,
Thanks for your valuable inputs, which helps in contributing more good stuff to the community.
|
|
|
|

|
Hi Surya,
I followed this tutorial step by step, but I got error saying like this:
1). The contract name 'WCFRestSample.IMyService' could not be found in the list of contracts implemented by the service 'MyService'.
The reason behind this is we need to decorate the interface with [ServiceContract] attribute. You have specified about OperationContract attribute , but this is missing.
2). In MyService.svc file, we need to add the following code,
<%@ ServiceHost Language="C#" Debug="true" Service="WCFRestSample.MyService" %>
3).The Link :https://ch1blogs.cognizant.com/blogs/279850/2011/10/18/service-end-point-not-found/
is asking for authentication name and password.
4). Please attach the sample.zip file as like other Code project articles for reference to understand the client side code implementation details.
Kindly update both C#Corner and Codeproject article , as it will be helpful for others who are following the article.
Regards,
Rajesh
modified 3-Nov-11 5:33am.
|
|
|
|

|
Hi Rajesh,
Thanks for your inputs.
Please find answers for your questions respectively
1). When you add service to your solution i.e. MyServic.svc. By default it will add Interface IMyService & this interface will be added with attribute ServiceContract by Default, here we dont need to do any stuff.
2). You dont need to add it manually, it will get added by default
3).I Appologize for this
4). Sure will attach code soon
Regards,
Prakash
|
|
|
|

|
Thanks Prakash,
That's a good insight,
In that case, the article is targeted for .Net 4 Framework, but when some one tries to develop the service using .Net 3.5 Framework and VS 2010 like me, they have to manually add those attributes.
Regards,
Rajesh
|
|
|
|

|
Eight months later, and still no download available...
I'm also having problems getting to grips with Web Services, and trying to get this code to work has hardly helped.
For example, you suggest we should name the new service "WCF Rest Based", but tell us to put this in the web.config file:
<service name="WcfRestBased.MyService"
Errr, no. This stuff (is .Net 3.5 at least) is case-sensitive.
So, if you don't name the service WCF_Rest_Based.MyService (notice the capital letters), then you'll get one of WCF's many baffling error messages.
Service 'WCF_Rest_Based.MyService' has zero application (non-infrastructure) endpoints.
Messages like this just result in yet more desperate Googling...
Hardly what a "beginner" wants to spend their time doing, whilst trying to get a beginner's guide to run....
|
|
|
|

|
(A lot of debugging later..)
For those of you who don't want to waste a few hours fixing the bugs & issues with this code, I've posted a working version here:
WCFRestBased.zip
It's a VS2010 project, but for .Net 3.5 rather than 4.0 (simply because that's the environment our company has setup at the moment).
Sarcasm aside, this was a useful article, nicely written, but I had to overcome many errors and problems in the code to get it working. It really should've included a working copy of the project, particularly as it's meant to be targetted at beginners.
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
|
How to create WCF REST based service
| Type | Article |
| Licence | CPOL |
| First Posted | 30 Oct 2011 |
| Views | 52,684 |
| Bookmarked | 35 times |
|
|