WCF REST POST XML - The remote server returned an error: (400) Bad Request

前端 未结 2 732
日久生厌
日久生厌 2020-12-13 16:02

I have exposed my REST API service using WCF Service Library and started by console application. when I try to consume the service from client ( another console application)

相关标签:
2条回答
  • 2020-12-13 16:42

    Your XML namespaces are wrong. I don't have time to correct it for you, but needs to be in the "http://www.test.com/Enrollment" namespace according to your data contract.

    0 讨论(0)
  • 2020-12-13 16:59

    Your POST payload should be :

    <Enroll xmlns="http://www.test.com/Enrollment">
    <ClientId>000</ClientId>
    <AccountNumber>123</AccountNumber>
    <TaxId>123</TaxId>
    <TaxType>123</TaxType>
    <EmailAddress>123</EmailAddress>
    <Pin>123</Pin>
    <State>122</State>
    </Enroll>
    
    0 讨论(0)
提交回复
热议问题