【发布时间】:2011-12-02 12:03:55
【问题描述】:
我有以下代码:
@WebMethod
public String replaceEnvironment(String someVar) {
return someVar;
}
当我尝试发送包含${something} 子序列的字符串的消息时,我的字符串在解组后被截断:${something} 子字符串消失了。这种行为的原因是什么?我需要与我在replaceEnvironment 方法中发送的字符串相同。
P.S.我没有在我的项目中使用像 Velocity 或 Freemaker 这样的库。
SOAP 示例。
请求:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.test.net/">
<soapenv:Header/>
<soapenv:Body>
<ws:replaceEnvironment>
<!--Optional:-->
<arg0>test ${test} test</arg0>
</ws:replaceEnvironment>
</soapenv:Body>
</soapenv:Envelope>
回复:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:replaceEnvironmentResponse xmlns:ns2="http://ws.test.net/">
<return>test test</return>
</ns2:replaceEnvironmentResponse>
</S:Body>
</S:Envelope>
谢谢。
【问题讨论】:
-
请在此处填写有关 WSDL 的更多信息。(规则)
标签: java web-services jakarta-ee soap