Name clashes changes the schema output
We have found a difference on the WSDL generation between Metro 2.0 and Metro 2.1.1. It seems like it is possible to make name clashes that changes the schema output when generating the WSDL.
We have a class called Business and we take that as an input for an operation where we use the @WebParam to give it the name business. Now the new metro framework generates an reference instead. This is now as it breaks with the earlier version of Metro where it becomes type + name.
Is this a known behavior and is it expected?
If so is there some way to enforce metro to generate the same schema in version 2.1.1 as in version 2.0
Here are some implementation specifics. If you need more please let me know.
Implementation of the webservice method for saveBusiness:
@WebMethod
public String saveBusiness(@WebParam(name = "business") Business business,
@WebParam(name = "ownerCertificateSubject") String credentials) throws
InternalErrorFault, BadRequestFault, UnauthorizedFault {
//removed for simplification of example
}
SaveBusiness with "business" as parameter on Metro 2.1.1
Generated schema part
<xs:complexType name="saveBusiness">
<xs:sequence>
<xs:element ref="tns:business" minOccurs="0"/>
<xs:element name="ownerCertificateSubject" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
Full schema
http://ec2-79-125-86-229.eu-west-1.compute.amazonaws.com:8080/ProfileReg...
SaveBusiness with "business" as parameter on Metro 2.0
<xs:complexType name="saveBusiness">
<xs:sequence>
<xs:element name="business" type="tns:business" minOccurs="0"/>
<xs:element name="ownerCertificateSubject" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
Full Schema
http://pors.nemhandel.gov.dk/ProfileRegistrationService20100304/prs?xsd=1
I hope you can help.
Best regards
Dennis Søgaard




