type=“xsd:base64Binary”的 Axis Web 服务

发布于 2024-07-22 14:35:40 字数 525 浏览 4 评论 0原文

所以我有一个 wsdl 定义了一个消息部分,如下所示

<wsdl:message name="processEnvelopeResponse">
    <wsdl:part name="processEnvelopeReturn" type="xsd:base64Binary"/>
</wsdl:message>

这映射到一个 xsd,然后导入其他 xsd 等等。

我有以下问题:

  1. 如何从 xsd 生成消息部分对象

忽略这个,我已经找到了 回答,你可以这样做,只要你 将 xsd 导入到 wsdl 文件中。 稍后会详细解释

  1. 如何以允许我直接填充消息对象并通过网络传递的方式生成客户端对象
  2. 如何调用Web服务,将生成的对象转换为base64Binary(这个假设以上是不可能的)

So i have a wsdl that defines a message part like the following

<wsdl:message name="processEnvelopeResponse">
    <wsdl:part name="processEnvelopeReturn" type="xsd:base64Binary"/>
</wsdl:message>

This maps to a xsd, wich then imports other xsds and so on.

I have the following questions:

  1. How can i generate the Message part objects from the xsd

Ignore this one, i have found the
answer, you can do this as long as you
import the xsd into the wsdl file.
Will explain better later on

  1. How can i generate the client side objects in a way that allows me to directly fill the message objects and pass it over the wire
  2. How do i call the webservice, transforming the generated objects in to base64Binary (this one assumes the above is not possible)

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

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

发布评论

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

评论(1

嘿嘿嘿 2024-07-29 14:35:40

因此,回答我自己的问题时,我能够生成工件以从 xsd 列表中调用 Web 服务,但在调用 Web 服务时我无法使用它们。

所以我最终不得不手动生成 XML,幸运的是这是一个小调用。

String input="XML";
byte[] s = port.processEnvelope(input.getBytes());

由于响应也来自 xsd:base64Binary,我必须将传入的字符串映射到 xml 对象中才能处理响应。

String xmloutput = new String(s,"UTF-8");

然后我通过 jdom 将 xmloutput 放入我得到的数据。

总而言之,这是一种愚蠢的方式来实现网络服务。

So answering my own question, i was able to generate the artifacts to call the webservice from the list of xsd's, but i was unable to use them when calling the webservice.

So i ended up having to generate the XML by hand, lucky was i that this was a small call.

String input="XML";
byte[] s = port.processEnvelope(input.getBytes());

And since the response came in xsd:base64Binary too i had to map the incoming string into xml objects in order to process the response.

String xmloutput = new String(s,"UTF-8");

I then put xmloutput through jdom i got my data.

all in all a stupid way to implement a webservice.

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