You need to sign in to do that
Don't have an account?
PhantomLord
sObject.setField method does not exist in Partner WDSL
Hi guys,
I am starting with the SOAP API for Salesforce, and I have the following problem.
On this page I can see that there must be a setField method in sObject:
SObject account = new com.sforce.soap.partner.sobject.wsc.SObject(); account.setType("Account"); account.setField("Name","myAccount"); account.setField("XID1__c", "1");
But I don't see it in the Partner WDSL that I get in App Setup > API > Partner WDSL.
<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:sobject.partner.soap.sforce.com"> <import namespace="urn:partner.soap.sforce.com"/> <!-- Dynamic sObject --> <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> </schema>
According to google, I am the only one who has this problem. Is there any chance that I do something wrong when I get the WSDL?
I just stopped after seeing no getField method or Field property,while I should have just read the documentation further. I found a sample here:
http://www.salesforce.com/us/developer/docs/api/Content/sample_create_call.htm :)
All Answers
setField is part of the java API that WSC generates from the WSDL, its not from anything in the WSDL itself.
Perhaps you can back-up a step and describe the actual problem you're having.
Basically I want to create an object, like an Account, Lead or a Contact, and fill it with data, or get an existing object and update it. Right now I don't see how I could do it, because I don't get access to any fields. My goal is to be able to read/write fields using the Partner WSDL.
BTW, I am using C# and VS2010, not Java.
I just stopped after seeing no getField method or Field property,while I should have just read the documentation further. I found a sample here:
http://www.salesforce.com/us/developer/docs/api/Content/sample_create_call.htm :)
Hi Phantom,
Can you please tell how you achieved to solve that issue? I am integrating through iphone and not able to find the setField method for sObject.
Please help.