I am creating sample example from http://andyinthecloud.com/2013/10/27/introduction-to-calling-the-metadata-api-from-apex/
I am getting following exception on Click of the button
Whats wrong?
Web service callout failed: WebService returned a SOAP Fault: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor=
Request XML:-
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header>
<SessionHeader xmlns="http://soap.sforce.com/2006/04/metadata">
<sessionId>00Di0000000kMtH!ARAAQC8gQUuNLICckL_8RNTs.cekDai6jQOAFR_Bj0durQozIiuBPikPce2xyDP5KnlS6JE_W2ihvsVRbih6DPsyMn9ETdy7</sessionId>
</SessionHeader>
</env:Header>
<env:Body>
<create xmlns="http://soap.sforce.com/2006/04/metadata">
<metadata xsi:type="CustomField">
<fullName>Activity__c.TestField__c</fullName>
<label>Test Field</label>
<length>42</length>
<type>Text</type>
</metadata>
</create>
</env:Body>
</env:Envelope>
Attribution to: Ganesh Bhosle
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/31906