Splunk Dev

Why am I receiving an XmlException when logging on using the C# sdk?

shaselschwerdt
Engager

I have a very simple code snippet in a console app designed to just setup a service and log on.

var service = new Service(new Uri( "https://my-instance-name.cloud.splunk.com" ) );
service.LogOnAsync( "username", "password" ).Wait();

The inner exception of the AggregateException is an XmlException with this message: "Unexpected DTD declaration. Line 1, position 3." I'm sure this is something really simple.

For reference, I'm trying to connect to Splunk Cloud with the Splunk.Client NuGet v.2.2.5 and .NET Framework v4.5.2.

Thanks for any help.

Tags (3)
0 Karma
1 Solution

shaselschwerdt
Engager

I actually fiddled the response and found out I was getting a full html page back, so apparently I was using the wrong uri endpoint.

View solution in original post

0 Karma

shaselschwerdt
Engager

I actually fiddled the response and found out I was getting a full html page back, so apparently I was using the wrong uri endpoint.

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...