2

I'm trying to integrate a SOAP service in my Spring MVC application. I have a WSDL & XSD files. To generate the java classes I'm using the Apache CXF Maven plugin (cxf-codegen-plugin).
Maven Config:

  <plugin>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-codegen-plugin</artifactId>
            <version>2.7.7</version>
            <executions>
                <execution>
                    <id>generate-sources</id>
                    <phase>generate-sources</phase>
                    <configuration>
                        <sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>

                        <wsdlOptions>
                            <wsdlOption>
                                <wsdl>${project.basedir}/src/main/resources/wsdl/xxxx.wsdl</wsdl>
                                <wsdlLocation>classpath:wsdl/xxxx.wsdl</wsdlLocation>
                                <extraargs>
                                    <extraarg>-impl</extraarg>
                                    <extraarg>-verbose</extraarg>
                                </extraargs>
                            </wsdlOption>
                        </wsdlOptions>
                    </configuration>
                    <goals>
                        <goal>wsdl2java</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

XSD File:

<xs:sequence>
      <xs:element name="paramone" nillable="true" type="xs:string"/>
      <xs:element name="paramdate" type="xs:dateTime"/>
      <xs:element name="paramtwo" nillable="true" type="xs:string"/>
      <xs:element name="paramthree" nillable="true" type="xs:string"/>
      <xs:element name="paramfour" nillable="true" type="xs:long"/>
 </xs:sequence>

Generated Java File

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "data", propOrder = {
"paramone",
 "paramdate",
"paramtwo",
"paramthree"
})
public class Data{

@XmlElement(required = true, nillable = true)
protected String paramone;
@XmlElement(required = true)
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar paramdate;
@XmlElement(required = true, nillable = true)
protected String paramtwo;
@XmlElement(required = true, nillable = true)
protected String paramthree;
...

}

You can see that "paramfour" is NOT generated in the Java file.

4

0 回答 0