Clickatell SOAP wsdl 到 JAXB java 类 [英] Clickatell SOAP wsdl to JAXB java classes

查看:20
本文介绍了Clickatell SOAP wsdl 到 JAXB java 类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从 Clickatell wsdl 生成 JAXB 类:你可以在这里找到 wsdl 的定义,它非常大:http://api.clickatell.com/soap/webservice.php?WSDL

I'm trying to generate JAXB classes from the Clickatell wsdl: You can find the wsdl definition here it quite large: http://api.clickatell.com/soap/webservice.php?WSDL

尝试从此 Wsdl 生成 Java 类时,出现以下错误:[错误] 未定义的简单或复杂类型SOAP-ENC:Array"[错误] 未定义属性 'SOAP-ENC:arrayType'

When trying to generate java classes from this Wsdl i got the following errors: [ERROR] undefined simple or complex type 'SOAP-ENC:Array' [ERROR] undefined attribute 'SOAP-ENC:arrayType'

希望有人能帮帮我.干杯,提姆

I hope someone can help me out. Cheers, Tim

推荐答案

您的架构指的是架构 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap 中定义的 SOAP-ENC:Array 类型/encoding/" 但该架构未包含在 wsdl 中.

Your schema refers to the type SOAP-ENC:Array defined in the schema xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" but that schema is not included in the wsdl.

我遇到了类似的问题,不得不使用目录来告诉 jaxb/xjc 在哪里可以找到架构.

I had a similar problem and had to use a catalog to tell jaxb/xjc where to find the schema.

转到 http://schemas.xmlsoap.org/soap/encoding/ 和另存为soapenc.xsd

Go to http://schemas.xmlsoap.org/soap/encoding/ and save as soapenc.xsd

然后创建一个包含以下内容的纯文本文件

Then create a plain text file with following content

PUBLIC "http://schemas.xmlsoap.org/soap/encoding/" "soapenc.xsd"

然后将该文件作为目录文件传递给 xjc

Then pass that file to xjc as the catalog file

更新:如果你在 maven 上,这就是它如何结合在一起.

Update: If you are on maven, this is how it would all hang together.

将 schema、soapenc.xsd 和 catalog.cat(纯文本文件)放在 src/main/resources 中

place the schema, soapenc.xsd, and catalog.cat(the plain text file) in src/main/resources

然后告诉jaxb插件把目录传给xjc

Then tell the jaxb plugin to pass the catalog to xjc

<plugin>
    <groupId>org.jvnet.jaxb2.maven2</groupId>
    <artifactId>maven-jaxb2-plugin</artifactId>
    <executions>
      <execution>
        <id>wsdl-generate</id>
        <configuration>
          <schemaIncludes>
            <include>*.wsdl</include>
          </schemaIncludes>
          <catalog>${project.basedir}/src/main/resources/catalog.cat</catalog>
        </configuration>
        <goals>
          <goal>generate</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

这篇关于Clickatell SOAP wsdl 到 JAXB java 类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆