cancel
Showing results for 
Search instead for 
Did you mean: 

ARBECreateSubscriptionResponse is Null C#

I am trying to create a subscription, but the response comes back nul.  Here is my code:

 

paymentScheduleTypeInterval interval = new paymentScheduleTypeInterval();
interval.length = 12;
interval.unit = ARBSubscriptionUnitEnum.months;

paymentScheduleType schedule = new paymentScheduleType
{
interval = interval,
startDate = DateTime.Now.AddDays(1),
totalOccurrences = 9999,

};
ARBSubscriptionType subscriptionType = new ARBSubscriptionType
{
amount = Price,
paymentSchedule = schedule,
payment = paymentType,
billTo = billingAddress


};
var subscriptionRequest = new ARBCreateSubscriptionRequest { subscription = subscriptionType };

var subscriptionController = new ARBCreateSubscriptionController(subscriptionRequest);
subscriptionController.Execute();

ARBCreateSubscriptionResponse subscriptionResponse = subscriptionController.GetApiResponse();
if (subscriptionResponse != null && subscriptionResponse.messages.resultCode == messageTypeEnum.Ok)
{
success = true;

}
else if (subscriptionResponse != null)
{
success = false;
}

 

All variables do have value, but response is null.  If a drill down through the controller object I see Error E00045 "The root node does not reference a valid XML namespace.", but I am not using XML and my payment transactions process with no problem using the same credentials.  Any assistance is greatly appreciated!

DevQueen
Member
2 REPLIES 2

Hi @DevQueen,

 

While your code is interacting with the SDK, the SDK is building a request to be sent to our API endpoint out of the information that you're passing it. That request that's actually sent to our servers is formatted as XML. So, when our server is responding with an XML parsing error, that's some indication that it's not recognizing the request as sent.

 

Would it be possible for you to post the actual API request that the SDK is creating? The SDK will log that request, although I'm not sure if logging is on by default.

Aaron
All Star

How can I log this and get the XML. I set a breakpoint and can examine the values in the debugger, but I can't see the XML