利用 WAS V6.1 开发安全可靠的 Web Services,第 2 部分:实现可靠的消息传递
2010-03-26 00:00:00 来源:WEB开发网第三条报文中看到数据参数 a,b 的传输,从报文中可以看到消息的 Identifier 为
urn:uuid:1D24784FA504F2842A1188808922780。发送报文如下:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<soapenv:Header>
<wsrm:Sequence xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"
soapenv:mustUnderstand="1">
<wsrm:Identifier>urn:uuid:1D24784FA504F2842A1188808922780</wsrm:Identifier>
<wsrm:MessageNumber>1</wsrm:MessageNumber>
</wsrm:Sequence>
<wsa:To>http://localhost:9090/Services/CalculatorService</wsa:To>
<wsa:MessageID>urn:uuid:1D24784FA504F2842A1188808922476</wsa:MessageID>
<wsa:Action>add</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<dlwmin:add xmlns:dlwmin="http://services.ws.ibm.com">
<a>52</a>// 参数 a 值
<b>24</b>// 参数 b 值
</dlwmin:add>
</soapenv:Body>
</soapenv:Envelope>
可以看到这是我们的消息序列中的第一条消息,其 MessageNumber 为 1,Identifier 值为 urn:
uuid:1D24784FA504F2842A1188808922780。
服务提供者响应如下:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<soapenv:Header>
<wsrm:SequenceAcknowledgement xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"
soapenv:mustUnderstand="1">
<wsrm:Identifier>urn:uuid:1D24784FA504F2842A1188808922780</wsrm:Identifier>
<wsrm:AcknowledgementRange Lower="1" Upper="1"/>
</wsrm:SequenceAcknowledgement>
<wsrm:Sequence xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"
soapenv:mustUnderstand="1">
<wsrm:Identifier>urn:uuid:1D24784FA504F2842A1188808922480</wsrm:Identifier>
<wsrm:MessageNumber>1</wsrm:MessageNumber>
</wsrm:Sequence>
<wsa:MessageID>urn:uuid:1D24784FA504F2842A1188808923039</wsa:MessageID>
<wsa:Action>http://services.ws.ibm.com/Calculator/addResponse</wsa:Action>
<wsa:RelatesTo>urn:uuid:1D24784FA504F2842A1188808922476</wsa:RelatesTo>
</soapenv:Header>
<soapenv:Body>
<ns2:addResponse xmlns:ns2="http://services.ws.ibm.com"/>
</soapenv:Body>
</soapenv:Envelope>
更多精彩
赞助商链接