You need to sign in to do that
Don't have an account?
CageMMA
Need help with Partner WSDL
Hi everyone:
I have the following scenario:
Partner WSDL, Sobject has 3 elements (type, fieldsToNull, Id) .
<complexType name="sObject"> <sequence> <element name="type" type="xsd:string"/> <element name="fieldsToNull" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/> <element name="Id" type="tns:ID" nillable="true"/> <any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="lax"/> </sequence> </complexType>
When converting this WSDL to Java, It will generate the following methods only.
1. getType, setType.
2. getFieldsToNull, setFieldsToNull
3. getId , setId
---------------------------------------------------------------------------------------------------------------------------------
But, I need setField & getField methods.
Ex:
SObject contact = new com.sforce.soap.partner.sobject.SObject();
contact.setType("Contact");
contact.setField("LastName", "LName");
contact.setType("Contact");
contact.setField("LastName", "LName");
In WSDL, the complexType name "SObject" should have the element name "field",
then only java can generate getField & SetField methods
Ex:
<element name="field" type="xsd:string"/>
So anyone can solve my issue here please??
Thanks
Zishan
Are you using wsc ? If not, please download the wsc18.jar, partner18.jar.(http://code.google.com/p/sfdc-wsc/downloads/list). I'm using these to get SObject and can retrieve getField info from the SObject. Can you generate the jar using the wsdlc utility in wsc.jar instead of axis wsdl2java ?
Like the other poster said - use WSC if you can. If you have to use Axis, the get/setField methods don't exist and you'll have to use get/setAny, which is a lot harder to use.
you cant use getters and setters with patner wsdl.
Using partner wsdl is bit harder. but you dont have to download it again for a change in data structure.
To do what you are expecting use enterprise wsdl.
@Zishan did you ever succeed in getting the enterprise and wsc jars to generate with getfield defined?
I think that you might have to use the partner API to use the getfield method. This thread talks about it a bit.