MyEclipse Forums
This thread has been locked & this forum has been archived.
Please post new topics to Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
View previous topic Printable version Log in to check your private messages View next topic
Author Message
stevelopez
Post subject: Problem creating Web Service client from WSDL  PostPosted: May 03, 2012 - 06:50 PM
Registered Member
Registered Member


Joined: Jan 12, 2009
Posts: 14

After providing the URL of a valid WSDL and attempting to create a JAX-WS ewb service client I get the following error:

A class/interface with the same name as package.class is already in use. Use a class customization to resolve this conflict.

the package is empty and remains empty after hitting OK.

What is causing this error?

Thanks,
Steve
 
 View user's profile Send private message  
Reply with quote Back to top
stevelopez
Post subject: update  PostPosted: May 03, 2012 - 09:00 PM
Registered Member
Registered Member


Joined: Jan 12, 2009
Posts: 14

Update: Out of curiosity I tried to create the client using another PC with MyEclipse. (also has MyEclipse 10.1). Same result.
 
 View user's profile Send private message  
Reply with quote Back to top
stevelopez
Post subject: WSDL  PostPosted: May 04, 2012 - 02:14 AM
Registered Member
Registered Member


Joined: Jan 12, 2009
Posts: 14

Here is the WSDL:
http://www.craigattiwillinc.com/Member.asmx?wsdl

It validates properly on http://xmethods.net/ve2/Tools.po

From reading other forums it appears that JAX-WS is improperly collapsing the namespace. I have no control over the WSDL - how can I get MyEclipse to properly generate the service classes?
 
 View user's profile Send private message  
Reply with quote Back to top
support-tony
Post subject:   PostPosted: May 07, 2012 - 11:35 AM



Joined: Mar 09, 2011
Posts: 916

Steve,

The name collision seems to be a valid error (in that the WSDL provided will produce that error). To avoid name collisions, a bindings customization file is needed, as the error message mentions. It's not easy to figure out and I'm not sure I understand all the complexities but I found an example on the Web which, when modified, seems to fix your problem.

If you copy and paste the following code into an xml file in your project, then the ValidateResponse type will be given a name of ValidateResponseType and it won't clash with the element name. Browse to and select the file in the generation wizard.
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxws:bindings
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
  xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1"
  xmlns:s="http://www.w3.org/2001/XMLSchema"
  wsdlLocation="http://www.craigattiwillinc.com/Member.asmx?wsdl">

    <jaxws:bindings node="wsdl:definitions/wsdl:types/s:schema/s:complexType[@name='ValidateResponse']">
        <jaxb:class name="ValidateResponseType"/>
    </jaxws:bindings>
</jaxws:bindings>

An alternative to this is to download the WSDL into your own file, then alter the name of the complex type to ValidateResponseType and also change the reference to it. Then you can generate from the modified WSDL. I guess the customization file is the best option though, in either case, any change to the WSDL may necessitate a change to a local file.

I'm afraid that there is no way to specify other arguments to the generation process.

Please let us know if this helps.

_________________
Tony
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits