function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
YAYA 

Generating Enterprise WSDL client using JAX-WS

I am trying to generatin Web Service client for Enterpirse WSDL using JAX-WS but getting following error.

 

Errors occurred during wsimport.
 
  error: XPath evaluation of "//xsd:schema[@targetNamespace='urn:enterprise.soap.sforce.com']" results in empty target node
warning: src-resolve: Cannot resolve the name 'tns:ID' to a(n) 'type definition' component.
  line 0 of file:/C:/src/SalesForce-Enterprise.wsdl#types?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 0 of file:/C:/src/SalesForce-Enterprise.wsdl#types?schema2
error: (Relevant to above error) another "DescribeLayout" is generated from here.
  line 0 of file:/C:/src/SalesForce-Enterprise.wsdl#types?schema2
error: Two declarations cause a collision in the ObjectFactory class.
  line 0 of file:/C:/src/SalesForce-Enterprise.wsdl#types?schema2
error: (Related to above error) This is the other declaration.   
  line 0 of file:/C:src/SalesForce-Enterprise.wsdl#types?schema2
error: com.sun.istack.SAXParseException2: (Related to above error) This is the other declaration.   

  com.sun.istack.SAXParseException2: (Related to above error) This is the other declaration.   

 

I am using the below JAXB bindings..

<bindings
    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>

 

Any help on this, is much appreciated.. Thaks

 

It might be duplicate post in the forum, sorry abou it....

SuperfellSuperfell

Have you looked at the JAX-WS quick start ?

YAYA

Hello Simon,

 

Thank you for posting the response. I did tried with Quick start now, it is working as it is.. but we need to use the latest Enterprise WSDL (other than what is ther ein QuickStart / Enterpirse.zip files -  I do see some differences).

 

If try to generate WS client, I get the same error what I was gettign in Rational Application Developer (RAD) yestarday..

 

1. I tried with out JAXB binding

H:\JULY 2010\Enterprise\bin>wsimport SalesForce-Enterprise.wsdl
parsing WSDL...


[WARNING] src-resolve: Cannot resolve the name 'ens:sObject' to a(n) 'type definition' component.
  line 3990 of file:/H:/JULY%202010/Enterprise/bin/SalesForce-Enterprise.wsdl#types?schema2

[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 4894 of file:/H:/JULY%202010/Enterprise/bin/SalesForce-Enterprise.wsdl

[ERROR] (Relevant to above error) another "DescribeLayout" is generated from here.
  line 4606 of file:/H:/JULY%202010/Enterprise/bin/SalesForce-Enterprise.wsdl

[ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 4894 of file:/H:/JULY%202010/Enterprise/bin/SalesForce-Enterprise.wsdl

[ERROR] (Related to above error) This is the other declaration.
  line 4606 of file:/H:/JULY%202010/Enterprise/bin/SalesForce-Enterprise.wsdl

 

2. I tried with JAXB bindings

H:\JULY 2010\Enterprise\bin>wsimport SalesForce-Enterprise.wsdl -b sforce-enterprise-wsdl.xjb
parsing WSDL...


[ERROR] XPath evaluation of "//xsd:schema[@targetNamespace='urn:enterprise.soap.sforce.com']" results in empty target node
  line 6 of file:/H:/JULY%202010/Enterprise/bin/sforce-enterprise-wsdl.xjb

[WARNING] src-resolve: Cannot resolve the name 'ens:sObject' to a(n) 'type definition' component.
  line 3990 of file:/H:/JULY%202010/Enterprise/bin/SalesForce-Enterprise.wsdl#types?schema2

[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 4894 of file:/H:/JULY%202010/Enterprise/bin/SalesForce-Enterprise.wsdl

[ERROR] (Relevant to above error) another "DescribeLayout" is generated from here.
  line 4606 of file:/H:/JULY%202010/Enterprise/bin/SalesForce-Enterprise.wsdl

[ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 4894 of file:/H:/JULY%202010/Enterprise/bin/SalesForce-Enterprise.wsdl

[ERROR] (Related to above error) This is the other declaration.
  line 4606 of file:/H:/JULY%202010/Enterprise/bin/SalesForce-Enterprise.wsdl

Any help is much appreciated....

 

Thanks,

YAYA

Thank you Simon. I got it now.. I am able to generate WS client code...

SCJSCJ

Hi YA,

 

That's great that you got it working, but how did you do that?  I'm having the same problem.

 

Thanks,

 

- Steve

Micky MMicky M

Did anyone ever post a solution to this as im having the exact same problem?