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

SoapClient.Retrieve() unable to deserialize Activity object. #84

Open
barokzi opened this issue Jun 10, 2020 · 3 comments
Open

SoapClient.Retrieve() unable to deserialize Activity object. #84

barokzi opened this issue Jun 10, 2020 · 3 comments
Labels

Comments

@barokzi
Copy link

barokzi commented Jun 10, 2020

Describe the bug
SoapClient.Retrieve() unable to deserialize Activity object.

To Reproduce

{
:
RetrieveRequest rr = new RetrieveRequest();
            rr.ClientIDs = new[] { _ClientId }; // instantiated outside block, ClientId1 assigned.
            rr.ObjectType = "Activity";
            rr.Properties = new[] {
                "ObjectID",
                 "Definition.ObjectID",
                "Sequence",
                "Name",
                "CustomerKey",
                "IsActive",
                "CreatedDate",
                "ModifiedDate" };
            rr.Filter = filter;
           
            string resp = SoapClient.Retrieve(rr, out string requestID, out APIObject[] results);
            // i get an exception at this point.

:
}

Expected behavior
results parameter would contain deserialized Activity objects.
The same snippet above (with appropriate "Properties" settings) work for retrieving Automation objects.

Screenshots
image

Note: I did have to instantiate a new SoapClient object so I can use my UserName/Password:
```
public SoapClient OpenSoapClient(string username, string password)
{
// Create the SOAP binding for call.
BasicHttpBinding binding = new BasicHttpBinding();
binding.Name = "UserNameSoapBinding";
binding.Security.Mode = BasicHttpSecurityMode.TransportWithMessageCredential;
binding.MaxReceivedMessageSize = 2147483647;
var soap = new SoapClient(binding, ETClient.SoapClient.Endpoint.Address);
soap.ClientCredentials.UserName.UserName = username.IfNullOrWhiteSpace("");
soap.ClientCredentials.UserName.Password = password.IfNullOrWhiteSpace("
");
return soap;
}

@barokzi barokzi added the bug label Jun 10, 2020
@imartinflores
Copy link

Is there any updates on this ?

I am getting "Security requirements are not satisfied because the security header is not present in the incoming message." when trying to execute a SoapClient.Retrieve , is the header token not working ?

@rodelpontanares
Copy link

So what I am trying to do in my original post is to get the (at least the SQL) activities for a particular automation.
My intent was to get the automation activity(s) for the automation, and based on the documentation automationactivity object includes activity object definition (key or id).

Anyone?

@barokzi
Copy link
Author

barokzi commented Jan 28, 2021

@imartinflores.
Unfortunately, the deserialization issue is still unsolved. However in your case, you need to add the authorized token header prior to calling SoapClient.Retrieve(), which is actually easier than what i did to circumvent the header issue.

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