If you can narrow down your wsdl types section, then it might be easier to find. Or come to think of it ... I remember that in Eclipse, you should be able to ask it to validate your schemas, and it will get you close to the location of the problem. If you still can't find it, please attach your wsdl and I can take a look. Hope that helps.
I could not resolve this problem, so I have included the wsdl.
I used to be able to generate my skeleton & stubs via the command WSDL2jAVA (using antscript) without getting the above error.
I was using AXIS2 and jdk1.4 with my antscript. I have now changed to jdk1.5 and this seems to be
generating different schemas xmlns at the top of the wdsl file. The interface class that I use to generate
the wsdl using the command JAVA2WSDL (using antscript) has not changed. I have no idea how to solve this one
Hi Mat. So this is what I had to do. In Eclipse, I did File-->New-->Other, then selected WSDL to create a new WSDL file, and then pasted your wsdl in there. You can then right-click the WSDL and select Validate from the context menu to validate it. Here are the changes I needed to make to fix it:
Change 1 Error: The processing instruction target matching "[xX][mM][lL]" is not allowed.
Resolution: Removed 1st line <?xml ...>
Change 2 cvc-identity-constraint.4.2.2: Duplicate key value [PersonPVOSecure] declared for identity constraint "type" of element "schema".
Comments: The third xs:schema in namespace ax24 has two definitions for PersonPVOSecure. Can't have more than one. So name one of them something else. In this case, I named the second one PersonPVOSecure002. You will have to rename and modify any references to it.
The revised wsdl is below. If you don't want multiple schemas in the wsdl:types section, then you will have to manually merge them.
thank you for your response, it was very helpfull .
The extra complexType name="PersonPVOSecure" within <xs:schema xmlns:ax24
Could that have been generated because during the wsdl2java it could have possibly picked up two
different PersonPVOSecure on the class path
In my original wsdl I had the following at top of the auto generated wsdl and I was still able to develop ws
I currently use contract last to generate my ws using Axis2, but after this experience, I think I will stop being lazy and start to use the contract first approach.
sorry on my previous message i should have said:-
Could that have been generated because during the java2wsdl it could have possibly picked up two
different PersonPVOSecure on the class path.
I have also noticed that the name spaces used have changed, could this because I have switched to jdk 1.5 from jdk 1.4
Hi Mat. Yes, Contract-first is considered a best practice. Its the same as interface-based programming - the interface is the contract.
- Regarding the <?xml> processing instruction, it is because it needs to be the very first line in an xml document, but its the second line in your first post. I didn't notice that yesterday. Probably a copy/paste error. So we can ignore this one.
- But I have no idea why it might generate duplicate types. There are bugs that look similar. Could be a wsdl2java issue where it generates code instead of reporting an error. Don't know. If you are using an older version of Axis, then you could try a newer version, maybe 1.4 or 1.5.
- As far as the namespaces changing, I have no idea.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop