facebook

MyEclipse 6.5 (Blue) – JAX-WS webservice client – error

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #286104 Reply

    mfkilgore
    Member

    I 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.

    #286126 Reply

    Loyal Water
    Member

    Ill get this checked by the dev team and get back to you with an update asap.

    #286152 Reply

    Brian Fernandes
    Moderator

    The 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.

    #286172 Reply

    mfkilgore
    Member

    Thank 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.

    #286181 Reply

    Brian Fernandes
    Moderator

    Not 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.

    #286184 Reply

    mfkilgore
    Member

    Thank you very much, I had gotten myself close but did not have the XML correct. Your version works perfectly.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: MyEclipse 6.5 (Blue) – JAX-WS webservice client – error

You must be logged in to post in the forum log in