我有一个WCf服务,在使用VS Application时正常工作。但是在使用SOAP UI时,它会给出错误(在验证消息的安全性时发生错误。)。
如果我在VS中运行WCF,请求(工作正常)
<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">http://tempuri.org/ITest/GetUserData</a:Action>
<a:MessageID>urn:uuid:7b4aa2ac-4399-4e24-9ea7-b8f3a9c446b6</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
</s:Header>
<s:Body>
<GetUserData xmlns="http://tempuri.org/">
<EmployeeID>XXXX</EmployeeID>
</GetUserData>
</s:Body>
</s:Envelope>
但是,如果我尝试使用下面的SoapUI消费它是请求(不工作)
POST http://localhost/ABC/Test.svc HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/soap+xml;charset=UTF-8;action="http://tempuri.org/ITest/GetUserData"
Content-Length: 435
Host: localhost
Proxy-Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/">
<soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Action>http://tempuri.org/ITest/GetUserData</wsa:Action></soap:Header>
<soap:Body>
<tem:GetUserData>
<!--Optional:-->
<tem:EmployeeID>XXXX</tem:EmployeeID>
</tem:GetUserData>
</soap:Body>
</soap:Envelope>