none
"Bad Request" error while consuming REST WCF Service RRS feed

  • Question

  • Hi,

    I do have a POST method in my REST Service. Also, i have enabled Certificate Authentication for the POST Method.

    This is my Service,

     [ServiceContract]
        public interface IMailingService
        {
            [WebInvoke(UriTemplate = "Sample", Method = "POST", RequestFormat = WebMessageFormat.Xml)]
            bool Sample(Message message);
        }

    Message is a complex type.

    My web.config has settings like below,

     <serviceCredentials>
                <clientCertificate>
                  <certificate findValue="somethumbprint" x509FindType="FindByThumbprint" storeLocation="LocalMachine" storeName="My" />
                </clientCertificate>
              </serviceCredentials>
    
     <security mode="Transport">
                <transport clientCredentialType="Certificate"/>
              </security>
        <security>
          <access sslFlags="Ssl, SslNegotiateCert, SslRequireCert" />
        </security>

    I have hosted my service in Azure. 

    Using HttpWebRequest object im consuming this service. i do pass the certificate in the request object. but, always im getting "Bad request".

    i have considered these points like,

    -My XML input namespaces are same.

    -My certificates are installed in Azure VM.

    -Im passing certificate from client side.

    -i have executed the cmd to unlock the azure VM's IIS  settings for SSL require.

    Could you please help me out ?

    Note: This code works very well without authentication.


    • Edited by PappiG Monday, December 17, 2012 11:42 AM
    • Changed type PappiG Monday, December 17, 2012 11:43 AM
    Monday, December 17, 2012 11:41 AM

Answers

  • PappiG --
     
    I believe you have erroneously posted your question in a public user forum dedicated to questions about Microsoft Project, a project management tool.  I would recommend you repost your question in a forum dedicated to software development questions.  Hope this helps.

    Dale A. Howard [MVP]
    VP of Educational Services
    msProjectExperts
    http://www.msprojectexperts.com
    http://www.projectserverexperts.com
    "We write the books on Project Server"

    Monday, December 17, 2012 1:30 PM
    Moderator

All replies