WCF - How to choose the right binding and contracts when the request and response data is given?

Topics: Interop Bindings, Web Api
Jul 2, 2013 at 6:06 PM
I am trying to prototype a web server for enterprise device management as per the "Enterprise Device Management Protocol for Windows Phone 8" defined my Microsoft. I am struck with getting my web service working so that it can be called by Microsoft implemented client on Windows Phone 8.

How to choose the right binding and contracts in my Web Service if the request and response data of the web service is given? The below data shows HTTP Get and HTTP Post request and response.

HTTP GET
Request:
Request Full Url: http://EnterpriseEnrollment.ds.test.com/EnrollmentServer/Discovery.svc
Content Type: unknown
Header Byte Count: 153
Body Byte Count:0

Header:
GET /EnrollmentServer/Discovery.svc HTTP/1.1
User-Agent: WIndows Phone 8 Enrollment Client
Host: EnterpriseEnrollment.ds.test.com
Pragma: no-cache

Response:
Request Full Url: http://EnterpriseEnrollment.ds.test.com/EnrollmentServer/Discovery.svc
Content Type: text/html
Header Byte Count: 248
Body Byte Count: 0

Header:
HTTP/1.1 200 OK
Connection: Keep-Alive
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
Content-Length: 0

HTTP POST

Request:
Header:
POST /EnrollmentServer/Discovery.svc HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
User-Agent: Windows Phone 8 Enrollment Client
Host: EnterpriseEnrollment.ds.test.com
Content-Length: xxx
Cache-Control: no-cache

<?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:Header>
<a:Action s:mustUnderstand="1">ttp://schemas.microsoft.com/windows/management/2012/01/enrollment/IDiscoveryService/Discover</a:Action>
<a:MessageID>urn:uuid: 748132ec-a575-4329-b01b-6171a9cf8478</a:MessageID>
<a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous>
</a:ReplyTo><a:To s:mustUnderstand="1">
https:// EnterpriseEnrollment.ds.test.com/EnrollmentServer/Discovery.svc>
</s:Header>
<s:Body>
<Discover xmlns="
http://schemas.microsoft.com/windows/management/2012/01/enrollment/">
<request xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<EmailAddress>user@ds.test.com</EmailAddress> <RequestVersion>1.0</RequestVersion> </request> </Discover> __Response:__ Header HTTP/1.1 200 OK
Content-Length: 865
Content-Type: application/soap+xml; charset=utf-8
Server: EnterpriseEnrollment.ds.mot.com
Date: Tue, 02 Aug 2012 00:32:56 GMT

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1">http://schemas.microsoft.com/windows/management/2012/01/enrollment/IDiscoveryService/DiscoverResponse>
<ActivityId>d9eb2fdd-e38a-46ee-bd93-aea9dc86a3b8</ActivityId>
<a:RelatesTo>urn:uuid: 748132ec-a575-4329-b01b-6171a9cf8478</a:RelatesTo>
</s:Header>
<s:Body xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><DiscoverResponse xmlns="http://schemas.microsoft.com/windows/management/2012/01/enrollment">
<DiscoverResult>
<AuthPolicy>OnPremise</AuthPolicy>
<EnrollmentPolicyServiceUrl>https:// EnterpriseEnrollment.ds.test.com/ENROLLMENTSERVER/DEVICEENROLLMENTWEBSERVICE.SVC</EnrollmentPolicyServiceUrl>
<EnrollmentServiceUrl>https:// EnterpriseEnrollment.ds.test.com/ENROLLMENTSERVER/DEVICEENROLLMENTWEBSERVICE.SVC</EnrollmentServiceUrl>
</DiscoverResult>
</DiscoverResponse>
</s:Body>
</s:Envelope>