我的目标是能够从使用基于 SOAP 的 API 的端点发布和检索
我的项目结构
我生成了一个带有 WSDL 文件的客户端以定位 cucm 11.5,然后
我按照github上的示例创建了所有在 repo 上完成的类和接口
第三,我的解决方案由两个项目组成,一个类库和一个控制台项目,类库包含从 WSDL 文件生成的客户端,控制台项目由与类库项目交互的类和接口组成
我有以下课程来执行操作
public class TestAxl
{
public void CreateUsers()
{
var axlClient = new AxlClient(new AxlClientConfiguration
{
Server = "Ip to the publish server",
User = "administrator",
Password = "password provided"
});
var addUserResult = axlClient.ExecuteAsync(async client =>
{
var userId = Guid.NewGuid().ToString();
var request = new AddUserReq
{
user = new XUser
{
userid = userId,
userIdentity = userId,
password = "P@ssw0rd",
firstName = "test",
lastName = "test"
}
};
var response = await client.addUserAsync(request);
return response.addUserResponse1.@return;
});
}
}
我像这样从主类中调用它
class Program
{
static void Main(string[] args)
{
var letsDoSomeTesting = new TestAxl();
try
{
letsDoSomeTesting.CreateUsers();
}
catch (Exception e)
{
Console.WriteLine("The following is the exceeption from calling final class ", e.Message);
}
}
}
当我尝试运行控制台项目时,它以 0 启动并退出,
然后我回到 CUCM 沙箱环境,没有任何改变,可能是什么原因导致此操作无法正常工作
仅供参考:运行时 netCore 3.1