Java cxf codegen插件在解析wsdl时失败(JSXB:undefined attribute';xml:lang';)
我尝试从wsdl为ExchangeWeb服务生成java代码 我使用的apache cxf codegen插件配置为:Java cxf codegen插件在解析wsdl时失败(JSXB:undefined attribute';xml:lang';),java,exchangewebservices,saxparser,cxf-codegen-plugin,Java,Exchangewebservices,Saxparser,Cxf Codegen Plugin,我尝试从wsdl为ExchangeWeb服务生成java代码 我使用的apache cxf codegen插件配置为: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.o
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>ews-api</name>
<groupId>net.retn</groupId>
<artifactId>ews-api</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<encoding>UTF-8</encoding>
<cxf.version>3.1.6</cxf.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<dependencies>
<dependency>
<groupId>net.retn</groupId>
<artifactId>cxf-ews-authenticator</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.sourceDirectory}/</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>https://server/EWS/Services.wsdl</wsdl>
<extraargs>
<extraarg>-b</extraarg>
<extraarg>${basedir}/src/main/resources/async_binding.xml</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
types.xsd:
<xs:schema xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:tns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xs="http://www.w3.org/2001/XMLSchema" id="types" elementFormDefault="qualified" version="Exchange2013_SP1" targetNamespace="http://schemas.microsoft.com/exchange/services/2006/types">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"/>
.....
<xs:complexType name="ReplyBody">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Message" type="xs:string"/>
</xs:sequence>
<xs:attribute ref="xml:lang" use="optional"/>
</xs:complexType>
.....
</xs:schema>
.....
.....
有人想做这样的事吗?什么问题?我找到了解决办法。的XML架构的位置已更改:
你能从这里发布WSDL吗
https://mail-lon.retn.net/EWS/Services.wsdl
,还是制作一个简单的复制该问题的文件?这是一个非常大的文件!但我认为问题出在types.xsd中,或者我错了?是否有可能以这种方式配置cxf codegen插件,即schema types.xsd在不修改types.xsd(远程文件)的情况下使用schemaLocation=”“for namespace=“”
<xs:schema xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:tns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xs="http://www.w3.org/2001/XMLSchema" id="types" elementFormDefault="qualified" version="Exchange2013_SP1" targetNamespace="http://schemas.microsoft.com/exchange/services/2006/types">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"/>
.....
<xs:complexType name="ReplyBody">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="Message" type="xs:string"/>
</xs:sequence>
<xs:attribute ref="xml:lang" use="optional"/>
</xs:complexType>
.....
</xs:schema>