SOAP UI稳定:发生错误[索引处路径中的非法字符

时间:2018-11-28 09:20:13

标签: java rest web-services testing soapui

我目前正在开发Web Service RESTFUL。 为了测试Web服务,我正在使用SOAP UI。

执行测试时,我在路径中收到错误非法字符。 我可以知道错误的原因是什么吗?如何解决这个问题? 下面是问题的详细信息。

错误日志:

Wed Nov 28 17:05:26 SGT 2018:ERROR:java.net.URISyntaxException: Illegal character in path at index 62: http://127.0.0.1:8080/AdaptiveAuthWSApps/rest/AdaptiveService/{uuid}/{browserinfo}/{ipint}/{lat}/{longitude}/{sessionid}/{spid}/{tr}/{jsnum}/{fingerprint}/{methodset}
java.net.URISyntaxException: Illegal character in path at index 62: http://127.0.0.1:8080/AdaptiveAuthWSApps/rest/AdaptiveService/{uuid}/{browserinfo}/{ipint}/{lat}/{longitude}/{sessionid}/{spid}/{tr}/{jsnum}/{fingerprint}/{methodset}

SOAP UI日志:

Wed Nov 28 17:05:26 SGT 2018:ERROR:An error occurred [Illegal character in path at index 62: http://127.0.0.1:8080/AdaptiveAuthWSApps/rest/AdaptiveService/{uuid}/{browserinfo}/{ipint}/{lat}/{longitude}/{sessionid}/{spid}/{tr}/{jsnum}/{fingerprint}/{methodset}], see error log for details
Wed Nov 28 17:05:26 SGT 2018:DEBUG:Attempt 1 to execute request
Wed Nov 28 17:05:26 SGT 2018:DEBUG:Sending request: POST /?uuid=iz23456&browserinfo=Mozilla%2F8.0%20%28Windows%20NT%206.1%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F49.0.2623.112%20Safari%2F537.36&ipint=16885247&lat=1&longitude=0&sessionid=12w3e4&spid=https%3A%2F%2Fuap%2Fowa&tr=10&jsnum=2&fingerprint=yh8u87&methodset=1%2C1 HTTP/1.1
Wed Nov 28 17:05:26 SGT 2018:DEBUG:Receiving response: HTTP/1.1 200 
Wed Nov 28 17:05:26 SGT 2018:DEBUG:Connection can be kept alive indefinitely

下面是我在SOAP UI中创建测试套件时使用的WADL。

  

http://127.0.0.1:8080/AdaptiveAuthWSApps/rest/application.wadl

SOAP UI参数初始化:

enter image description here

2 个答案:

答案 0 :(得分:1)

我相信问题在于您的uuid参数的值。

uuid应该仅由十六进制字符组成。那是0-9和a-f(当然也是“-”)

您已编写iz123456,并且“ i”或“ z”均无效。

如果uuid也应该是实际的uuid,则它应该看起来像这样:13a1a079-4a39-4625-91a4-ddbf09c2c324

尝试将此uuid复制/粘贴到uuid参数中,然后再次运行。

答案 1 :(得分:0)

您似乎混淆了参数样式。如果定义QUERY样式,则将键/值对添加到URL中的问号之后,而不添加到资源路径中。使用{uuid}/{browserinfo}/...TEMPLATE风格。

因此,从资源路径中删除{uuid}/{browserinfo}/...,然后将键/值对留在问号之后。