11 java web-services
我正在尝试从Clickatell wsdl生成JAXB类:你可以在这里找到wsdl定义它非常大:http: //api.clickatell.com/soap/webservice.php?WSDL
当尝试从此Wsdl生成java类时,我收到以下错误:[错误] undefined简单或复杂类型'SOAP-ENC:Array'[ERROR] undefined attribute'SOAP-ENC:arrayType'
我希望有人可以帮助我.干杯,蒂姆
dan*_*ter 19
您的模式引用了类型SOAP-ENC:在模式xmlns中定义的数组:SOAP-ENC ="http://schemas.xmlsoap.org/soap/encoding/"但该模式不包含在wsdl中.
我有类似的问题,不得不使用目录告诉jaxb/xjc在哪里找到架构.
转到http://schemas.xmlsoap.org/soap/encoding/并另存为soapenc.xsd
然后创建包含以下内容的纯文本文件
PUBLIC "http://schemas.xmlsoap.org/soap/encoding/" "soapenc.xsd"
Run Code Online (Sandbox Code Playgroud)
然后将该文件作为目录文件传递给xjc
更新:如果你是maven,这就是它们如何挂在一起的方式.
将架构,soapenc.xsd和catalog.cat(纯文本文件)放在src/main/resources中
然后告诉jaxb插件将目录传递给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>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7982 次 |
| 最近记录: |