- This topic has 5 replies, 3 voices, and was last updated 16 years, 6 months ago by mfkilgore.
-
AuthorPosts
-
mfkilgoreMemberI was attempting to connect to and generated code for the microsoft live webservice (http://soap.search.msn.com/webservices.asmx?wsdl). The WSDL validation step completes with now problem, however the code generation step fails with:
A class/interface with same name “com.test.SearhResponse” is already in use. Use class customization to resolve this conflict.
Known issue? How do I use class customization to resolve?
I used the New Webservice Client option and selected JAX-WS.
Loyal WaterMemberIll get this checked by the dev team and get back to you with an update asap.
Brian FernandesModeratorThe problem is that you have a complexType and and an element in the WSDL both defined with the “SearchResponse” name, leading to two classes for different types – with the same name. You need to create a JAXB2 customization file and use the classCustomization element to override the default name for either of the two SearchResponse types defined in the WSDL. Once you have this ready, point to this file in the Binding customization file section of the JAX-WS top down wizard.
Please see this link for more information on the customization file: http://java.sun.com/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html
Alternatively, you could create a local copy of the WSDL where you modify the name of the conflicting element directly.
Hope this helps.
mfkilgoreMemberThank you for the quick response. Interesting issue, no surprise Visual Studio 2008 properly generates based on this WSDL. The JAXB information is good, very detailed, and will take time to absorb, would you happen to have a customization file I could use in the short term for quick testing? Or as an alternative more details on how to modify the WSDL. I would guess that this will be a common interoperability (Java/Microsoft) problem and question to you.
Brian FernandesModeratorNot really an interoperability problem, just a difference in the schema > code transformation routines.
<jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <jxb:bindings schemaLocation="http://soap.search.msn.com/webservices.asmx?wsdl#types?schema1"> <jxb:schemaBindings> <jxb:package name="example" /> <jxb:nameXmlTransform> <jxb:elementName suffix="Element" /> </jxb:nameXmlTransform> </jxb:schemaBindings> </jxb:bindings> </jxb:bindings>
If you stick that in a file and point to it as mentioned above, the 2nd element will be named SearchResponseElement. See the “Fix Collides Example” in the above doc for more details on this snippet.
Hope this gets you going.
mfkilgoreMemberThank you very much, I had gotten myself close but did not have the XML correct. Your version works perfectly.
-
AuthorPosts