You need to sign in to do that
Don't have an account?
Milan
Partner API : INVALID_TYPE: Must send a concrete entity type
Hello Friends,
I tried seeing many posts on INVALID_TYPE: Must send a concrete entity type but I am still confused and still havent been able to rectify my code. So I am posting my issue here.
I am trying to CREATE a Lead using PARTNER API. The steps followed are as follows:
- Login and retrieve the Server URL and Session ID. (This works)
- Set the new Session ID and use the retrieveed Server URL from step 1 above to make subsequent call for getUserInfo( ) . (This one works too, which means I am pointing to the right URL and have the session ID set correctly in the header)
- Try to create a Lead with the code snippet as follows:
Code:
SObject[] sObject = new SObject[1]; MessageElement[] lead = new MessageElement[5]; lead[0] = new MessageElement(new QName("FirstName"),"Joe"); lead[1] = new MessageElement(new QName("LastName"),"Doe"); lead[2] = new MessageElement(new QName("Company"),"John Doe Inc"); lead[3] = new MessageElement(new QName("Email"),"johndoe@jdoe.com"); lead[4] = new MessageElement(new QName("Phone"),"4156832669"); sObject[0] = new SObject(); sObject[0].setType("Lead"); sObject[0].set_any(lead); SaveResult[] sr = null; try { sr = stub.create(sObject); } catch (Exception ex) { System.out.println("An unexpected error has occurred." + ex.getMessage()); return; }
I get the following error :
An unexpected error has occurred.INVALID_TYPE: Must send a concrete entity type.
I am using PARTNER API. Any clue what should I do ?Thanks for any insight.
Regards,
Milan
All Answers
The request / Response :
Any clues ?
Thanks Simon! That was it. I started wiuth the wrong URL and it returned a wrong one and so on...But on pointing to the appropriate partner wsdl URL, it worked!
Thanks,
Milan
<sf:exceptionCode>INVALID_TYPE</sf:exceptionCode>
<sf:exceptionMessage>Must send a concrete entity type.</sf:exceptionMessage>
<sf:row>-1</sf:row>
<sf:column>-1</sf:column>
</sf:fault>
Thanks for the quick response, as awlays :).
Here is the request :
Code:
Here is the response :
Code:
Kindly advice.
Thanks,
Milan
i 'm trying to invoke ""create"" method of salesforce from BPEL , but getting an error as "must send a concrete entity type" "invalid _type"
Here are the copy operations performed in BPEL code:
<assign name="Settings">
<copy>
<from variable="LoginResponse" part="parameters"
query="/ns1:loginResponse/ns1:result/ns1:sessionId"/>
<to variable="Header" part="SessionHeader"
query="/ns1:SessionHeader/ns1:sessionId"/>
</copy>
<copy>
<from>
<EndpointReference xmlns="http://schemas.xmlsoap.org/ws/2003/03/addressing">
<Address/>
</EndpointReference>
</from>
<to variable="partnerRef"/>
</copy>
<copy>
<from expression="string(bpws:getVariableData('LoginResponse','parameters','/ns1:loginResponse/ns1:result/ns1:serverUrl'))"/>
<to variable="partnerRef"
query="/ns2:EndpointReference/ns2:Address"/>
</copy>
<copy>
<from variable="partnerRef"/>
<to partnerLink="SalesForceServ"/>
</copy>
<copy>
<from expression='"JS"'/>
<to variable="AccountVar" query="/ns3:Account/ns3:Name"/>
</copy>
<copy>
<from expression='"Jagjit Singh, 5/18/2008 10:40 PM"'/>
<to variable="AccountVar" query="/ns3:Account/ns3:CreatedBy"/>
</copy>
<copy>
<from expression='"Jagjit Singh"'/>
<to variable="AccountVar" query="/ns3:Account/ns3:OwnerId"/>
</copy>
<copy>
<from expression='"jagjit Singh"'/>
<to variable="AccountVar" query="/ns3:Account/ns3:Owner"/>
</copy>
<copy>
<from expression='"23344"'/>
<to variable="AccountVar"
query="/ns3:Account/ns3:AccountNumber"/>
</copy>
<copy>
<from variable="AccountVar"/>
<to variable="sObject"/>
</copy>
<copy>
<from expression='"D24"'/>
<to variable="sObject" query="/ns3:sObject/ns3:Id"/>
</copy>
<copy>
<from expression='"DDDD"'/>
<to variable="sObject" query="/ns3:sObject/ns3:fieldsToNull"/>
</copy>
<copy>
<from variable="sObject"/>
<to variable="CreateRequest" part="parameters"
query="/ns1:create/ns1:sObjects"/>
</copy>
</assign>
and error in BPEL Console is:
<messages><input><CreateRequest><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="parameters"><create xmlns="urn:enterprise.soap.sforce.com">
<ns0:sObjects xmlns="urn:sobject.enterprise.soap.sforce.com" xmlns:ns0="urn:enterprise.soap.sforce.com">
<fieldsToNull>DDDD</fieldsToNull>
<Id>D24</Id>
<AccountContactRoles/>
<AccountNumber>23344</AccountNumber>
<AccountPartnersFrom/>
<AccountPartnersTo/>
<Active__c/>
<ActivityHistories/>
<AnnualRevenue/>
<Assets/>
<Attachments/>
<BillingCity/>
<BillingCountry/>
<BillingPostalCode/>
<BillingState/>
<BillingStreet/>
<Cases/>
<Contacts/>
<Contracts/>
<CreatedBy>Jagjit Singh, 5/18/2008 10:40 PM</CreatedBy>
<CreatedById/>
<CreatedDate/>
<CustomerPriority__c/>
<Description/>
<Events/>
<Fax/>
<Histories/>
<Industry/>
<IsDeleted/>
<LastActivityDate/>
<LastModifiedBy/>
<LastModifiedById/>
<LastModifiedDate/>
<MasterRecord/>
<MasterRecordId/>
<Name>JS</Name>
<Notes/>
<NotesAndAttachments/>
<NumberOfEmployees/>
<NumberofLocations__c/>
<OpenActivities/>
<Opportunities/>
<OpportunityPartnersTo/>
<Owner>jagjit Singh</Owner>
<OwnerId>Jagjit Singh</OwnerId>
<Ownership/>
<Parent/>
<ParentId/>
<PartnersFrom/>
<PartnersTo/>
<Phone/>
<ProcessInstances/>
<ProcessSteps/>
<Rating/>
<SLAExpirationDate__c/>
<SLASerialNumber__c/>
<SLA__c/>
<Shares/>
<ShippingCity/>
<ShippingCountry/>
<ShippingPostalCode/>
<ShippingState/>
<ShippingStreet/>
<Sic/>
<Site/>
<SystemModstamp/>
<Tasks/>
<TickerSymbol/>
<Type/>
<UpsellOpportunity__c/>
<Website/>
</ns0:sObjects>
</create>
</part></CreateRequest></input><fault><InvalidSObjectFault xmlns="urn:enterprise.soap.sforce.com"><part name="fault"><sf:InvalidSObjectFault xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="sf:InvalidSObjectFault">
<sf:exceptionCode xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">INVALID_TYPE</sf:exceptionCode>
<sf:exceptionMessage xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Must send a concrete entity type.</sf:exceptionMessage>
<sf:row xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">-1</sf:row>
<sf:column xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">-1</sf:column>
</sf:InvalidSObjectFault>
</part></InvalidSObjectFault></fault></messages>
Please help me ......
Thx and regards
Jag
<ns0:sObjects xsi:type='ns0:Account' xmlns:ns0="urn:enterprise.soap.sforce.com">
You also have other problems, including a missing name element, and the fact that you're populating heiractical data elements with character data (e.g. createdBy & owner).
I suggest you walk through the quickstart in the docs and get some basic java or .NET samples working before jumping in with something more complex.
Thx for your quick reply...
I have already done some work in webservices in JAVA, but in BPEL it is for the first time..... So please let me know the certain steps to call the salesforce "create" method to create an account.....
I have successfully used , getuserinfo methos and query method of salesforce.....
I know sObject is an array object where i can put the account object(s) and send it to create as a parameter......
Please let me know how to do it in BPEL
Thanks...
thx a lot for ur help...... I analysed the code closely as you said and
set " <ns0:sObjects xsi:type='ns0:Account' xmlns:ns0="urn:enterprise.soap.sforce.com">" in my sourcecode
now i m able to run "create" and "update" methods exposed by salesforce...
Problem resolved finally...
Regards
Jag
Hi,
I am having similar issues while trying to create Accounts using BPEL. I am able to successfully login to SalesForce but not able to create. I tried to follow most of the instructions, but might have missed something.
Can you please tell where you updated
"<ns0:sObjects xsi:type='ns0:Account' xmlns:ns0="urn:enterprise.soap.sforce.com">".
Also I am not clear as how to set "fieldsToNull". Do you happen to have the BPEL code?
Your response will be greatly appreciated.
FYI:
I tried to update enterprise wsdl with concrete Account element as follows below complex type Account.
<element name="Account" type="ens:Account"/>. I am using this object to set Account values. Finally I set this account to CreateRequest/sObjects.
Thanks
Somesh