将 xml 文档(作为参数?)传递给 Web 服务

发布于 2024-10-07 20:14:19 字数 230 浏览 0 评论 0原文

我正在用java和Metro开发一个Web服务,需要传递大量信息。例如,类似 xml 的内容描述了客户的所有属性。

我想知道是否有某种标准方法可以在文档中传递数据。目前,我一直将数据作为名为“customerXML”的字符串参数传递。

任何建议表示赞赏。仅供参考,我使用 RestEasy 定义了另一个宁静的 ws,它在使用输入/输出流时效果很好,但我正在寻找一种利用基于肥皂的 Web 服务来公开类似功能的方法。

I am developing a web service in java and Metro that requires a lot of information to be passed. For example, something like xml describing all the attributes of a customer.

I am wondering if there is some standard way in which to pass the data in a document. Currently I have been passing the data as a string parameter named 'customerXML'.

Any suggestions appreciated. FYI I have defined another restful ws using RestEasy which works great using input/output streams, but am looking for a way to leverage soap-based web services to expose similar functionality.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

猥︴琐丶欲为 2024-10-14 20:14:19

JAX WS 非常适合此要求,它适用于 SOAP

JAX WS is perfect for this requirement, It works on SOAP

亽野灬性zι浪 2024-10-14 20:14:19

我的假设是,没有一种标准方法可以将 xml 文档传递到基于 SOAP 的 Web 服务,而无需您自己编码整个 SOAP 消息。因此,我认为没有一种简单的方法可以做到这一点,这也是 RESTful Web 服务获得认可的原因之一。使用基于 SOAP 的 Web 服务执行此操作的最佳方法是将文档作为字符串参数传递,并在服务器代码中进行验证/解析。

My hypothesis is that there isn't a standard way to pass xml documents to a soap-based web service without coding the entire SOAP message yourself. Hence I do not think there is an easy way to do so and one reason why RESTful web services are gaining acceptance. The best way to do it using SOAP based web services is to pass the document as a string parameter and validate/parse within your server code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文