Search code examples
wcfsvc

How to create a SVC page that is accessed directly


According to my documentation 3rd party device connects to address:

https://Enrollment.myweb.com/EnrollmentServer/Register.svc

Header:

POST /EnrollmentServer/Register.svc HTTP/1.1 
Content-Type: application/soap+xml; charset=utf-8 
User-Agent: Windows Phone 8 Enrollment Client 
Host: Enrollment.myweb.com 
..    
<?xml version="1.0"?> 
<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope"> 
... 
</s:Envelope>

Some samples of SVC I have seen all have some additional methods that they call, like Service.svc/GetData and calling directly Service.svc I will get the standard response:

You have created a service.
To test this service, you will need to create a client and use it to call the service.

Can anyone point me to the correct documentation or even better - to a simple sample in C# on how to create SVC page that can be accessed directly and that would return some XML text?


Solution

  • You can go for REST Service.

    See this: http://beyondrelational.com/blogs/dhananjaykumar/archive/2011/02/01/walkthrough-creating-rest-service-in-wcf-4-0.aspx

    Also, can use Web API. http://www.asp.net/web-api