You need to sign in to do that
Don't have an account?

JAX-WS wsimport tool does not compile enterprise.wsdl
I am trying to get my enterprise.wsdl to compile with the wsimport tool from the latest JAX-WS release. Basically what I am trying to do is to eventually move our application away from the now pretty tired Axis 1 environment to JAX-WS which will in due course come bundled with Java 1.6.
Typical errors are like:
[wsimport] [ERROR] A class/interface with the same name "com.sforce.soap.enterprise.DescribeLayout" is already in use. Use a class customization to resolve this conflict.
[wsimport] line 2611 of file:/home/mm/oscar/build_current/dev/jaxws/sforce/enterprise.wsdl
[wsimport] [ERROR] (Relevant to above error) another "DescribeLayout" is generated from here.
[wsimport] line 2456 of file:/home/mm/oscar/build_current/dev/jaxws/sforce/enterprise.wsdl
It seems wsimport which I believe internally uses the xjc compiler from JAXB doesn't like identical element and type names.
Have others encountered the same / similar problem? Are there simple solutions (I know I can create custom bindings for those elements but that is pretty painful)?
Thanks
Typical errors are like:
[wsimport] [ERROR] A class/interface with the same name "com.sforce.soap.enterprise.DescribeLayout" is already in use. Use a class customization to resolve this conflict.
[wsimport] line 2611 of file:/home/mm/oscar/build_current/dev/jaxws/sforce/enterprise.wsdl
[wsimport] [ERROR] (Relevant to above error) another "DescribeLayout" is generated from here.
[wsimport] line 2456 of file:/home/mm/oscar/build_current/dev/jaxws/sforce/enterprise.wsdl
It seems wsimport which I believe internally uses the xjc compiler from JAXB doesn't like identical element and type names.
Have others encountered the same / similar problem? Are there simple solutions (I know I can create custom bindings for those elements but that is pretty painful)?
Thanks
I guess this problem will not go away and if more developers adopt JAXB, JAX-WS with the release of Java 1.6 this question will be asked again.
If you're finding JAXB to be unsuitable for your real world use cases, then it would seem to me that your gripe should be directed at the JAXB folks.
Discussion forum:
http://forums.java.net/jive/forum.jspa?forumID=46=0
IssueTracker:
http://jax-ws.dev.java.net/servlets/ProjectIssues
Mailing list:
users@jax-ws.dev.java.net
-Pete
I managed to get the WSDL compiled using JAXB bindings. I may publish the details here later once its stable for the benefits(?) of other developers.
There are however at least two other issues with JAX-WS and sforce I haven't got to the bottom yet.
1) sforce seems to expect a SOAPAction header looking like
SOAPAction: ""
However, JAX-WS sends
SOAPAction:
Note the missing quotes! I have reported this under: http://forums.java.net/jive/thread.jspa?threadID=20913 although I am not sure 'who is right', i.e. how this should be set based on the WSDL defining action="".
2) Your wsdl uses the <soap:header ../> feature in its operation definitions heavily to maintain the session information. wsimport does not seem to create the appropiate parameters for this on the generated methods. Haven't got to investigate this to any depth yet and therefore I have not reported it (yet).
what I am looking for is a meaningful discussion on a technical issue. I was not asking for sforce to change it wsdl. I thought this was a sforce developer community discussion board where Java sforce developers can raise and discuss technical issues they encounter. Just because I encountered a problem in what I was doing and asked here if others encountered similar issues doesn't mean I blame sforce for the problem or expect sforce to have ready made solutions.
Manuel
1) Compile the enterprise.wsdl with a JAX-WS/JAXB bindings customisation file similar to:
Code:
2) Use code similar to this to log in and set the soap session header:
Code: Hope this helps someone else down the track.
Manuel
I tried to use "MyEclipse" to generate "client stub" using XFire(Right click on wsdl->MyEclipse->New Web Service Client) and it did not work.
I was able to get it working in MyEclipse by using Axis 1.3(right click on the wsdl->Web Service->Generate Client)
bin\wsimport.bat enterprise.wsdl -b enterprise.xjb
parsing WSDL...
[WARNING] src-resolve: Cannot resolve the name 'tns:ID' to a(n) 'type definition' component.
line 28 of file:/C:/work/incubator/salesForceExampleJAXBEnterprise/Enterprise/enterprise.wsdl#type
s?schema1
[ERROR] A class/interface with the same name "com.sforce.soap.enterprise.DescribeLayout" is already
in use. Use a class customization to resolve this conflict.
line 3289 of file:/C:/work/incubator/salesForceExampleJAXBEnterprise/Enterprise/enterprise.wsdl
[ERROR] (Relevant to above error) another "DescribeLayout" is generated from here.
line 3088 of file:/C:/work/incubator/salesForceExampleJAXBEnterprise/Enterprise/enterprise.wsdl
[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 3289 of file:/C:/work/incubator/salesForceExampleJAXBEnterprise/Enterprise/enterprise.wsdl
[ERROR] (Related to above error) This is the other declaration.
line 3088 of file:/C:/work/incubator/salesForceExampleJAXBEnterprise/Enterprise/enterprise.wsdl
wsdlLocation="enterprise.wsdl"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://java.sun.com/xml/ns/jaxws">
false
false
<bindings
wsdlLocation="enterprise.wsdl"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://java.sun.com/xml/ns/jaxws">
<bindings node="//xsd:schema[@targetNamespace='urn:enterprise.soap.sforce.com']">
<jaxb:globalBindings underscoreBinding="asCharInWord"/>
<jaxb:schemaBindings>
<jaxb:nameXmlTransform>
<jaxb:typeName suffix="Type"/>
</jaxb:nameXmlTransform>
</jaxb:schemaBindings>
</bindings>
<enableWrapperStyle>false</enableWrapperStyle>
<enableAsyncMapping>false</enableAsyncMapping>
</bindings>
Still getting [WARNING] src-resolve: Cannot resolve the name 'ens:sObject' to a(n) 'type definition' component.
any help? Im using this...
<bindings
wsdlLocation="enterprise.wsdl"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://java.sun.com/xml/ns/jaxws">
<bindings
node="//xsd:schema[@targetNamespace='urn:partner.soap.sforce.com']">
<jaxb:globalBindings
underscoreBinding="asCharInWord" />
<jaxb:schemaBindings>
<jaxb:nameXmlTransform>
<jaxb:typeName
suffix="Type" />
</jaxb:nameXmlTransform>
</jaxb:schemaBindings>
</bindings>
<enableWrapperStyle>false</enableWrapperStyle>
<enableAsyncMapping>false</enableAsyncMapping>
</bindings>
just as u did!!!!
I ran into same issue while generating the client code using JAX-WS.
I could successfully generatthe client code using Axis... but I need it with JAX-WS.. any help ???
Thanks,
Basically i searched around and was able to solve the errormessages when generating the stubs using wsimport. For details see below from fellow developers. Hope this helps.
wsimport
wsimport -version: JAX-WS RI 2.1.6 in JDK 6
Problem where warning occurs.
Bug.
ID Warning:
https://jax-ws.dev.java.net/issues/show_bug.cgi?id=844
SalesForce compatibility:
https://jax-ws.dev.java.net/issues/show_bug.cgi?id=228
Solution:
http://stackoverflow.com/questions/785945/problem-generating-java-soap-web-services-client-with-jdk-tool-wsimport-from-a-ws
Syntax example( which was working for me, where the "generated" option is the directory for the stubs):
wsimport -B-XautoNameResolution -d generated -keep partner.wsdl