xsd - CXF wsdl2java not reading schema properly -
i using below wsdl2java plugin configured generate java classes using wsdl.
<plugin> <groupid>org.apache.cxf</groupid> <artifactid>cxf-codegen-plugin</artifactid> <version>3.0.1</version> <executions> <execution> <id>generate-sources</id> <phase>generate-sources</phase> <configuration> <sourceroot>${basedir}/src/main/java</sourceroot> <wsdloptions> <wsdloption> <wsdl>src/main/resources/xxxxservice.wsdl</wsdl> <validate>none</validate> <extraargs> <extraarg>-server</extraarg> <extraarg>-impl</extraarg> <extraarg>-verbose</extraarg> <extraarg>-p</extraarg> <extraarg>http://xxx/yy=xxx</extraarg> <extraarg>-autonameresolution</extraarg> </extraargs> </wsdloption> </wsdloptions> </configuration> <goals> <goal>wsdl2java</goal> </goals> </execution> </executions> </plugin>
now, have below schema included in wsdl.
<xsd:include schemalocation="myschema.xsd" xmlns="tns"></xsd:include>
when element definition within wsdl below, generates class myelement , fine:
<xsd:element name="myelement"> <xsd:complextype> <xsd:sequence> <xsd:element name="a" type="xsd:string" minoccurs="1"> </xsd:element> <xsd:element name="b" type="xsd:string" minoccurs="1"> </xsd:element> </xsd:sequence> </xsd:complextype>
but when element definition in wsdl refers complextype definition in schema. element class aaa doesn't generated aaatype class gets generated.
<xsd:element name="aaa" type="tns:aaatype"> </xsd:element>
is there way can specify wsdl2java generate both classes aaa , aaatype , reference aaatype within aaa ?
you can check xmlns:tns
, targetnamespace
on both wsdl , schema.
<xsd:element name="aaa"
... - can defined in schema itself.
you can seek browse wsdl , check if proper, issue seems related schema include.
xsd cxf wsdl2java cxf-codegen-plugin
No comments:
Post a Comment