gpt4 book ai didi

java - 类型为 ="xsd:base64Binary"的 Axis Web 服务

转载 作者:太空宇宙 更新时间:2023-11-04 09:00:08 24 4
gpt4 key购买 nike

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

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

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

我有以下问题:

  1. 如何从 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

  • 如何以允许我直接填充消息对象并通过线路传递的方式生成客户端对象
  • 我如何调用网络服务,将生成的对象转换为base64Binary(这个假设上述不可能)
  • 最佳答案

    所以回答我自己的问题,我能够生成工件来从 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 放入我得到的数据。

    总而言之,这是实现网络服务的愚蠢方法。

    关于java - 类型为 ="xsd:base64Binary"的 Axis Web 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/924921/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com