You need to sign in to do that
Don't have an account?
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 "xsi" for attribute "xsi:type" associated with an element type "wsdl:sObjects" 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.