Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

[BUG] Security requirements not satisfied #89

Open
1 task
imartinflores opened this issue Aug 25, 2020 · 2 comments
Open
1 task

[BUG] Security requirements not satisfied #89

imartinflores opened this issue Aug 25, 2020 · 2 comments
Labels

Comments

@imartinflores
Copy link

Describe the bug
Security requirements are not satisfied because the security header is not present in the incoming message.

To Reproduce
Execute SoapClient.Retrieve()

Expected behavior
Retrieve should work and retrieve data

Code snippet
var myClient = new ETClient();
var r = myClient.SoapClient.Retrieve(
new RetrieveRequest
{
ObjectType = "DataExtensionObject",
Properties = new[] { "Name", "Value" },
Filter = queryFilter
}, out requestID, out results);

Note: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (e.g. gif) is not sufficient.

Environment

  • SDK Version [e.g. 1.3.0]
  • .NET Framework 472

The bug has the severity

  • Major: The defect affects major functionality or major data. It has a workaround but is not obvious and is difficult.or efficiency. It is merely an inconvenience.
@barokzi
Copy link

barokzi commented Jan 28, 2021

There is a bug in SoapClient in that it does not send the authorized token when making the call.
You can either add the header for the token or if your goal is to retrieve the DE rows, since you're using FuelSDK anyway, just use what functionality is already there.

https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-sdks.meta/mc-sdks/data-extension-row-retrieve.htm

@simeonlbailey
Copy link

simeonlbailey commented Mar 23, 2022

Oauth2 is not broken, it just doesnt work how you might expect.
This is documentation issue imho.

Works like this->

    private static void TestFuel2()
    {
        ETClient myETClient = new ETClient();
        SoapClient mySClient = myETClient.SoapClient;

        using (var scope = new OperationContextScope(mySClient.InnerChannel))
        {
            // Add oAuth token to SOAP header.
            XNamespace ns = "http://exacttarget.com";

            var xmlHeader = MessageHeader.CreateHeader("fueloauth", "http://exacttarget.com", myETClient.AuthToken);

            OperationContext.Current.OutgoingMessageHeaders.Add(xmlHeader);

            var httpRequest = new System.ServiceModel.Channels.HttpRequestMessageProperty();
            OperationContext.Current.OutgoingMessageProperties.Add(
                System.ServiceModel.Channels.HttpRequestMessageProperty.Name, httpRequest);
            httpRequest.Headers.Add(HttpRequestHeader.UserAgent, ETClient.SDKVersion);

            Automation automation = new Automation();

            automation.ObjectID = " <id goes here>";

            string sStatus = "";
            string sStatusMessage = "";
            string sRequestId = "";

            PerformResult[] pResults = mySClient.Perform(new PerformOptions(), "start", new APIObject[] { automation }, out sStatus, out sStatusMessage, out sRequestId);
            Console.WriteLine("Status: " + sStatus);
            Console.WriteLine("Status Message: " + sStatusMessage);
            Console.WriteLine("Request ID: " + sRequestId);
            foreach (PerformResult pr in pResults)
            {
                Console.WriteLine("StatusCode: " + pr.StatusCode);
                Console.WriteLine("ErrorCode: " + pr.ErrorCode);
                Console.WriteLine("StatusMessage: " + pr.StatusMessage);
            }
        }
        return;
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants