You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Qmetry框架中执行POST请求时遇异常问题咨询

Fixing "Passed in key must select exactly one node" Error in Qmetry POST Request with XML Body

I’ve run into this exact issue before with Qmetry’s request parsing—let’s get your XML POST request working since it already works in Postman. The error you’re seeing (java.lang.IllegalArgumentException: Passed in key must select exactly one node: post.sample.call) happens because Qmetry’s configuration parser interprets the dot-separated key post.sample.call as a nested node path instead of a single top-level key. Here’s how to fix it step by step:

1. Rename the Request Key to Avoid Dot Separators

Qmetry’s parser treats dots in key names as node hierarchy markers, so post.sample.call looks like it’s trying to access a call node inside sample inside post, instead of one single request object. Change the key to something without dots, like postSampleCall or soapRequest:

postSampleCall={'headers':{'SoapAction':'<url here>','Content-Type':'text/xml;charset=UTF-8','Accept':'*/*','Authorization':'<authorization key here>'},'endPoint':'<endpoint here>','baseUrl':'<url here>','method':'POST','query-parameters':{},'form-parameters':{},'body':'<sending xml content here>'}

2. Properly Escape the XML Body

Qmetry is strict about special characters in string values, especially XML’s angle brackets and quotes. If your XML body has unescaped characters, it can break the configuration parsing. Try one of these approaches:

  • Escape double quotes in the XML using backslashes:
    body:'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><Request param=\'value\'></Request></soap:Body></soap:Envelope>'
    
  • Wrap XML in CDATA (if Qmetry supports it) to avoid escaping individual characters:
    body:'<![CDATA[<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><Request param="value"></Request></soap:Body></soap:Envelope>]]>'
    

3. Verify the Request Structure Matches Qmetry’s Expectations

Some Qmetry versions expect POST requests to be wrapped in a standard top-level key like request or httpRequest. Try nesting your entire request object under this key:

request={'headers':{'SoapAction':'<url here>','Content-Type':'text/xml;charset=UTF-8','Accept':'*/*','Authorization':'<authorization key here>'},'endPoint':'<endpoint here>','baseUrl':'<url here>','method':'POST','query-parameters':{},'form-parameters':{},'body':'<sending xml content here>'}

4. Check baseUrl and endPoint Combination

Qmetry automatically concatenates baseUrl and endPoint, so make sure their combined value matches the exact URL you used in Postman. For example:

  • If your Postman URL is https://api.example.com/soap/service, set baseUrl to https://api.example.com and endPoint to /soap/service, or set baseUrl to the full URL and leave endPoint empty.

Start with renaming the key first—this is almost always the root cause of that "must select exactly one node" error. Once that’s fixed, double-check the XML escaping and URL combination to ensure everything lines up with your working Postman request.

内容的提问来源于stack exchange,提问作者sanjay pujari

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 08:21:01