我有以下代码:
@WebMethod
public String replaceEnvironment(String someVar) {
return someVar;
}
当我试图发送一个消息包含${something}
子字符串,我的字符串unmashalling后截断:${something}
子串dissappeared。这种行为的原因是什么?我需要有与我在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的更多信息。(规则) – Oyeme
试的String.Format()? – aishwarya