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
ErenEren 

Problem compiling generated files for Java

I downloaded the Enterprise WSDL, and used Axis to generate the Java classes. It all look fine, until I tried to compile said classes. I got an error saying that the constructor for Account.java had too many parameters.  Since I am not using that class, I commented out the constructor and tried to recompile. This time I got another error message saying that the system had ran out of resources.

Any pointers on how to overcome this? I only to retrieve data from some custom objects, not create new ones.
Are there any pre-compiled classes I can use?
A way to minimize the size of the WSDL?
Or another way to retrieve object data through Java?

PS: I called SFDC for support last week but no one returned my call.
wyvernwyvern
I could never get axis to work properly (though I had different issues). I'm using JAX-WS now; you could try using that.
ErenEren
Thanks for the suggestion, but I tried to generate the classes with wsimport and I'm getting an error as well.
Code:
Line 7568:
            <element name="describeLayout">
                <complexType>
                    <sequence>
                        <element name="sObjectType" type="xsd:string"/>
                        <element name="recordTypeIds" type="tns:ID" minOccurs="0" maxOccurs="unbounded"/>
                    </sequence>
                </complexType>
            </element>

Line 7274:
            <complexType name="DescribeLayout">
                <sequence>
                    <element name="detailLayoutSections" type="tns:DescribeLayoutSection" minOccurs="0" maxOccurs="unbounded"/>
                    <element name="editLayoutSections"   type="tns:DescribeLayoutSection" minOccurs="0" maxOccurs="unbounded"/>
                    <element name="id"                   type="tns:ID"/>


                    <element name="relatedLists"                type="tns:RelatedList" minOccurs="0" maxOccurs="unbounded"/>
                </sequence>
            </complexType>

 


ERROR] Two declarations cause a collision in the ObjectFactory class.
 line 7568 of file:/C:/Program%20Files/jaxws-ri/bin/Prodenterprise.wsdl

ERROR] (Related to above error) This is the other declaration.
 line 7274 of file:/C:/Program%20Files/jaxws-ri/bin/Prodenterprise.wsdl

====
Does any one know of a successful way to get elements from SFDC using Java? I'm just trying to query data (not update it) but we do have a lot of custom objects in our organization.


Message Edited by Eren on 08-15-2008 03:25 PM
wyvernwyvern
You could try using the following snippet of code as a binding for the wsimport ant task. It solved some name conflicts for me.

Code:
<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: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>