小编Waj*_*khi的帖子

从webhook调用时,Azure WebJob控制台应用程序空Args

我正在使用Azure WebJob.我首先在Visual Studio中创建一个控制台应用程序,然后在VisualStudio中将该应用程序作为webJob发布在portal.azure中.

该WebJob与触发Manualy从其网络挂接username和password https://{MyWebAPP}.scm.azurewebsites.net/api/triggeredwebjobs/{MyWebJob}/run?arguments=1 2 3从第二程序.

这个WebJob非常简单.它只显示参数1,2和3.

当我从CommandeLine运行程序时,dotnet MyProject.dll 1 2 3它运行良好.但是当我从webHook运行它时,它不会读取参数.

这是我的主要脚本:

 class Program
{
    static void Main(string[] args)
    {

        Console.WriteLine("PARAMS Passed : " + string.Join(",", args));
    }
}
Run Code Online (Sandbox Code Playgroud)

当我从WebHook by Post请求运行时,这是WebJob中的日志: [06/09/2018 15:19:37 > 33a9f2: INFO] PARAMS Passed :

当我从commande Line运行时,这是控制台: [06/09/2018 15:19:37 > 33a9f2: INFO] PARAMS Passed : 1,2,3

可以帮助一些人.Tha,ks From All.

azure azure-webjobs asp.net-webhooks

2
推荐指数
1
解决办法
350
查看次数

.net core 2 及更高版本:连接服务 WcfServiceClient SOAP with NTLM Authorization 如何?

我正在 .net core 2.1 上运行一个应用程序。我通过已成功生成 WcfServiceClient 的连接服务添加了 wsdl Web 服务。

使用Basic Autorization 时,它工作正常。

这是我用于调用 helloword soap 方法的类:

public string HellowWorld(string input)
{
    string wsRes = null;
    try
    {
        var service = new WorkerProcessServiceClient();
        var url = $"http://ServerUrl/Directory/WsName.svc";
        UriBuilder uriBuilder = new UriBuilder(url);

        service.Endpoint.Address = new EndpointAddress(uriBuilder.Uri);
        service.ClientCredentials.UserName.UserName = Username;
        service.ClientCredentials.UserName.Password = Password;

        using (OperationContextScope scope = new OperationContextScope(service.InnerChannel))
        {
            HttpRequestMessageProperty httpRequestProperty = new HttpRequestMessageProperty();
            httpRequestProperty.Headers[System.Net.HttpRequestHeader.Authorization] =
                "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(service.ClientCredentials.UserName.UserName
                + ":"
                + service.ClientCredentials.UserName.Password));
            OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = …
Run Code Online (Sandbox Code Playgroud)

wcf soap asp.net-core-2.0 ntlm-authentication

1
推荐指数
1
解决办法
4658
查看次数