Created
January 4, 2021 21:55
-
-
Save ctigeek/7c00568372224dc3acbbd1bdd70776db to your computer and use it in GitHub Desktop.
Calling the soap api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using NUnit.Framework; | |
namespace RackspaceSoapTest | |
{ | |
[TestFixture] | |
public class Class1 | |
{ | |
[Test] | |
public void Test1() | |
{ | |
string username = "xxxxxxxxxxxxxxxxxxxx"; | |
string password = "xxxxxxxxxxxxxxxxxxxx"; | |
string domain = "mydomain.net"; | |
string user = "someUser"; | |
var client = new excedent.UtilsSoapPortClient(); | |
var activeStatus = client.GetUserActiveStatus(username, password, domain, user); | |
if (activeStatus == 1) | |
{ | |
Console.WriteLine("Disabling user...."); | |
var response = client.ModifyUser(username, password, domain, user, "", 0, "", "", "", "", "", "", "", "", "", ""); | |
Console.WriteLine(response); | |
} | |
else | |
{ | |
Console.WriteLine("Enabling user...."); | |
var response = client.ModifyUser(username, password, domain, user, "", 1, "", "", "", "", "", "", "", "", "", ""); | |
Console.WriteLine(response); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment