使用Velocity创建SOAP消息

时间:2022-11-24 19:06:52

I need to create a SOAP message using Velocity. I am just wondering how would I be able to get a SOAP message object from the Velocity Template? as far as I know that Velocity Template is evaluated into String.

我需要使用Velocity创建SOAP消息。我只是想知道如何从Velocity模板中获取SOAP消息对象?据我所知,Velocity Template被评估为String。

Your help is appreciated

感谢您的帮助

2 个解决方案

#1


0  

It's true that Velocity just outputs a String, so you have one option: re-parse the XML into an object.

确实,Velocity只输出一个String,因此你有一个选择:将XML重新解析为一个对象。

#2


0  

Not really sure if this is still relevant, you can generate your SOAP XML message using velocity (as a String) and then do a POST using a plain HTTP client. Are you using some kind of framework which makes it necessary to have the velocity output to be deserialized into SOAP message object?

不确定这是否仍然相关,您可以使用velocity(作为String)生成SOAP XML消息,然后使用普通HTTP客户端执行POST。您是否正在使用某种框架,这使得必须将速度输出反序列化为SOAP消息对象?

#1


0  

It's true that Velocity just outputs a String, so you have one option: re-parse the XML into an object.

确实,Velocity只输出一个String,因此你有一个选择:将XML重新解析为一个对象。

#2


0  

Not really sure if this is still relevant, you can generate your SOAP XML message using velocity (as a String) and then do a POST using a plain HTTP client. Are you using some kind of framework which makes it necessary to have the velocity output to be deserialized into SOAP message object?

不确定这是否仍然相关,您可以使用velocity(作为String)生成SOAP XML消息,然后使用普通HTTP客户端执行POST。您是否正在使用某种框架,这使得必须将速度输出反序列化为SOAP消息对象?