I am trying to integrate Marketing Cloud with Salesforce.
//I set the accessToken which I get via the REST Auth service
Map<String, String> headerMap = new Map<String, String>();
headerMap.put('fueloauth','eyJhbGciOiJIUzI1NiIsImtpZCI6IjQiLCJ2ZXIiOiIxIiwidHlwIjoiSldUIn0.eyJhY2Nlc3NfdG9rZW4iOiI3WUtodXVqMjBvdkpuRmlxQWs3Y2hHT1EiLCJjbGllbnRfaWQiOiJjbzd4iLCJlaWQiOjcyMzQ1ODYsInN0YWNrX2tleSI6IlM3IiwicGxhdGZvcm1fdmVyc2lvbiI6MiwiY2xpZW50X3R5cGUiOiJTZXJ2ZXJUb1NlcnZlciIsInBpZCI6NjYxfQ.lSpM806fZExsr4efmCTf4E0RmlygKFTqsHKsinIFDD8.TZznixbYgq_Ow8PeHbpernAlxPHsKijmYMPoAMeGkZm_g7dVDn82S0wBze89zbITRRqEhJUC0yN0ASpT74HoRzEqHpoDCJ_w73ik6l05qZIQ1busAQwDva-U4Q1U41vLGYW9E68YEDx6lJUcXujGO1iXQhrFO0YlJmHrbieSm');
//I search for Data extension records for a data extension named "RespondedCustomers" with the following properties : SubscriberKey and Phone
exacttargetComWsdlPartnerapi.RetrieveRequest vRetrieveRequest = new exacttargetComWsdlPartnerapi.RetrieveRequest();
String s = 'DataExtensionObject[RespondedCustomers]';
System.debug(s);
vRetrieveRequest.ObjectType = s;
String p1 = 'SubscriberKey';
String p2 = 'Phone';
String[] arrP = new String[]{p1,p2};
vRetrieveRequest.Properties = arrP;
exacttargetComWsdlPartnerapi.Soap ins = new exacttargetComWsdlPartnerapi.Soap();
ins.inputHttpHeaders_x = headerMap;
System.debug(ins);
System.debug(ins.Retrieve_x(vRetrieveRequest));
I am getting a SOAP fault shown below stating that security requirements are not satisfied.
Can someone let me know what needs to be done in this case ?
Working example from Postman