Posted: Mon Jan 05, 2015 8:02 am Post subject: Creating xsi:type in SOAP message
Master
Joined: 08 Jul 2013 Posts: 220
I tried to achieve xsi:type to form a SOAP message as below(msg snippet),
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
<soapenv:Body>
<urn:upsert> <urn:externalIDFieldName>Vacancy_Reference__c</urn:externalIDFieldName> <urn:sObjects xsi:type="urn1:Requisition__c">
<urn1:Id xsi:nil="true" />
<urn1:Car_Allowance__c>Fleet Car</urn1:Car_Allowance__c>
Both namespace declaration and context not working for me.
As Namespace declaration:
SET OutputRoot.SOAP.Body.(XMLNSC.NamespaceDecl)xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance';
SET OutputRoot.SOAP.Body.(XMLNSC.NamespaceDecl)xmlns:ns_tar='urn:sobject.enterprise.soap.sforce.com';
SET OutputRoot.SOAP.Body.(XMLNSC.NamespaceDecl)xmlns:ns='urn:enterprise.soap.sforce.com';
SET OutputRoot.SOAP.Body.ns:upsert.ns:sObjects.(XMLNSC.Attribute)xsi:type='ns_tar:Requisition__c';
---- SET refOut.ns_tar:Id='1';
SET OutputRoot.SOAP.Body.ns:upsert.ns:sObjects.ns_tar:Car_Allowance__c= SUBSTRING(refIn.*:Requisition.*:"Company_Car" FROM 1 FOR 20);
SET refOut.ns_tar:Vacancy_Reference__c = refIn.*:Requisition.*:Auto_reqID;
===============================================
As Context:
SET OutputRoot.SOAP.Context.Namespace.(SOAP.NamespaceDecl)xmlns:xsi = xsi;
SET OutputRoot.SOAP.Context.Namespace.(SOAP.NamespaceDecl)xmlns:soap_ns = soap_ns;
SET OutputRoot.SOAP.Context.Namespace.(SOAP.NamespaceDecl)xmlns:ns = ns;
SET OutputRoot.SOAP.Context.Namespace.(SOAP.NamespaceDecl)xmlns:ns_tar = ns_tar;
SET OutputRoot.SOAP.Body.ns:upsert.ns:sObjects.ns_tar:Car_Allowance__c= SUBSTRING(refIn.*:Requisition.*:"Company_Car" FROM 1 FOR 20);
Both the tries are throwing error as below,
XML schema validation error: cvc-complex-type.2.4.e: Unexpected element. Element "ns_tar:Car_Allowance__c" is not one of the choices. Element: /XMLNSC Internal error codes: 5008
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum