FuelSDK-CSharp
FuelSDK-CSharp copied to clipboard
SoapClient.Retrieve() unable to deserialize Activity object.
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
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; }
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 ?
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?
@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.