0

I have been trying to create a custom field using the following xml data, as mentioned in the following link link using this soap endpoint url

https://na1.salesforce.com/services/Soap/c/25.0

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Header>
  <ns1:SessionHeader soapenv:mustUnderstand="0" xmlns:ns1="http://soap.sforce.com/2006/04/metadata">
   <ns1:sessionId>00D28000000aTBh!ARwAQOkpYbkSeGeSSgdY0H9z3OEIoDSV_uWzqBV9.DSCK87HZjQoRDPIhoQx.OU1Z.6yDxqlf3kFGPB4yYHUUe.oUbN5baD8</ns1:sessionId>
  </ns1:SessionHeader>
 </soapenv:Header>
 <soapenv:Body>
  <create xmlns="http://soap.sforce.com/2006/04/metadata">
   <metadata xsi:type="ns2:CustomField" xmlns:ns2="http://soap.sforce.com/2006/04/metadata">
    <fullName>sampleco__c.samplecf__c</fullName>
    <label>samplecf</label>
    <length>100</length>
    <type>Text</type>
   </metadata>
  </create>
 </soapenv:Body>
</soapenv:Envelope>

with the following error response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode>soapenv:Client</faultcode>
            <faultstring>No operation available for request {http://soap.sforce.com/2006/04/metadata}create</faultstring>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>

My guess is the endpoint url is wrong. Can anyone help me out on providing the correct endpoint url for metadata calls or am i missing anything?

1 Answer 1

1

You are sending a metadata API request to the enterprise API endpoint.

IIRC, it should be services/Soap/m/25.0 If you're using the partner/enterprise login call, there's a metadataAPI url in the login result you can use.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .