如何为soap头和体创建xPath
我正在尝试为soap请求创建一个存根,它的头和主体如下所示为soap请求:如何为soap头和体创建xPath,xpath,wiremock,Xpath,Wiremock,我正在尝试为soap请求创建一个存根,它的头和主体如下所示为soap请求: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns3="http://example.com/ws/Namespaces/CustomerCareProductAndInsurance/Types/Public/CommonDataModel.xsd" xmlns:inq="http:/
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns3="http://example.com/ws/Namespaces/CustomerCareProductAndInsurance/Types/Public/CommonDataModel.xsd"
xmlns:inq="http://example.wsproduct.com/ws/Namespaces/Container/Public/InquireProductDetailsRequest.xsd"
xmlns="http://example.wsproduct.com/ws/Namespaces/Types/Public/MessageHeader.xsd">
<soap:Header>
<MessageHeader>
<TrackingMessageHeader>
<version>224</version>
</TrackingMessageHeader>
</MessageHeader>
</soap:Header>
<soap:Body>
<inq:InquireProductDetailsRequest>
<inq:ProductSelector>
<inq:code>013881004138416</inq:code>
</inq:ProductSelector>
</inq:InquireProductDetailsRequest>
</soap:Body>
</soap:Envelope>
有人可以帮助为上述soap请求创建匹配的xPath吗。提前谢谢 试试这个
{
"request": {
"method": "POST",
"url": "/inquireProductDetails",
"headers": {
"Content-Type": {
"contains": "text/xml"
}
},
"bodyPatterns": [
{
"matchesXPath": "//*[local-name()='code'][text()='224']"
},{
"matchesXPath": "//*[local-name()='version'][text()='013881004138416']"
}
]
},
"response": {
"transformers": [
"response-template"
],
"bodyFileName": "productDetails-Success-Response.xml",
"status": 200
}
}
{
"request": {
"method": "POST",
"url": "/inquireProductDetails",
"headers": {
"Content-Type": {
"contains": "text/xml"
}
},
"bodyPatterns": [
{
"matchesXPath": "//*[local-name()='code'][text()='224']"
},{
"matchesXPath": "//*[local-name()='version'][text()='013881004138416']"
}
]
},
"response": {
"transformers": [
"response-template"
],
"bodyFileName": "productDetails-Success-Response.xml",
"status": 200
}
}