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
RedSquirrelRedSquirrel 

attribute with associated element type is not bound - ruby and savon

Here is the code after a successful login:

 

I am trying to create a new Contact using the salesforce api with the savon client using ruby.

 

 

client.create! do |s|

    s.namespace = 'urn:enterprise.soap.sforce.com'

    s.header = {'wsdl:SessionHeader' => {'wsdl:sessionId' => mysessionid'}}

    s.body = {"wsdl:sObjects" => {"FirstName" => 'Test', "LastName" => 'Tester'}, :attributes! => {"wsdl:sObjects" => {"xsi:type" => 'ens:Contact'}}}.to_soap_xml

end

 

 

Here is the full error:

 

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring>The prefix &quot;xsi&quot; for attribute &quot;xsi:type&quot; associated with an element type &quot;wsdl:sObjects&quot; is not bound.</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>Savon::SOAPFault: (soapenv:Client) The prefix "xsi" for attribute "xsi:type" associated with an element type "wsdl:sObjects" is not bound.