locked
Windows Phone 8 MDM - Issue with discovery web service POST request RRS feed

  • Question

  • I have implemented a discovery web service using WCF with the operational contract for GET and POST with webhttpbinding over HTTP and HTTPS and hosted this service on IIS 8 as http://enterpriseenrollment.am.test.com/enrollmentserver/discovery.svc .

    I could successfully see the request and response for HTTP GET in the WireShark tool from WP8 company apps by providing the email address (user@am.test.com) and password. But I have trouble in getting the HTTP POST request to my web service. I don’t even see the request the WireSHark log.

    The service contract code looks as below:

    [ServiceContract(Namespace = "http://schemas.microsoft.com/windows/management/2012/01/enrollment/")]
        public interface IDiscoveryService
        {
            [OperationContract]
            [WebGet(UriTemplate = "")]
            void GetRequest();
    
            [OperationContract]
            [WebInvoke(Method = "POST", UriTemplate = "")]
            Stream Discover(Stream xmlData);
        }

    The web.config file looks as below:

    <configuration>
      <system.serviceModel>
        <services>
          <service behaviorConfiguration="DiscoveryServiceBehavior" name="DiscoveryWebService.DiscoveryService">
            <endpoint address="" behaviorConfiguration="WebBehavior" binding="webHttpBinding"
              bindingConfiguration="webBinding" name="webHttp" contract="DiscoveryWebService.IDiscoveryService">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <endpoint address="" behaviorConfiguration="WebBehavior" binding="webHttpBinding"
              bindingConfiguration="webBindingHTTPS" name="webHttps" contract="DiscoveryWebService.IDiscoveryService">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" name="mex" contract="IMetadataExchange" />
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="DiscoveryServiceBehavior">
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
          </serviceBehaviors>
          <endpointBehaviors>
            <behavior name="WebBehavior">
              <webHttp/>
            </behavior>
          </endpointBehaviors>
        </behaviors>
        <bindings>
          <webHttpBinding>
            <binding name="webBinding">
              <security mode="None">
                <transport clientCredentialType="None"/>
              </security>
            </binding>
            <binding name="webBindingHTTPS">
              <security mode="Transport">
                <transport clientCredentialType="None"/>
              </security>
            </binding>
          </webHttpBinding>
        </bindings>
      </system.serviceModel>
      <system.web>
        <compilation debug="true"/>
      </system.web>
    </configuration>
    Please suggest me what is wrong?

    K Raj

    Monday, July 22, 2013 4:34 PM