簡體   English   中英

錯誤407 Azure通知中心

[英]Error 407 Azure notification hubs

我正在嘗試在Azure通知中心上配置ios推送通知。 我知道我做對了所有事情,因為我之前做過這件事,並且有一份清單。 但是由於某種原因,它沒有任何邏輯上的解釋就失敗了。 我得到的錯誤是

The remote server returned an error: (407) Proxy Authentication Required..TrackingId:b12dc955-b24f-42f9-acc4-3440c4d60ab4,TimeStamp:03/04/2014 10:48

和StackTrace

Exception rethrown at [0]: 
at Microsoft.ServiceBus.Common.ExceptionDispatcher.Throw(Exception exception)
at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
at Microsoft.ServiceBus.Messaging.ServiceBusResourceOperations.EndGetAll(IAsyncResult asyncResult, String& continuationToken)
at Microsoft.ServiceBus.NamespaceManager.EndGetRegistrationsByTag(IAsyncResult result)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at RD8MobileApp.Api.Services.PushNotificationService.<RegisterForNotifications>d__1.MoveNext() in c:\Development\TFS\RD8\MobileApp.Api\Services\PushNotificationService.cs:line 29

有人可以幫忙嗎?

我認為Henrik是對的。

您必須位於需要身份驗證信息的代理服務器之后。

您可以添加以下代碼...

WebRequest.DefaultWebProxy = new WebProxy("http://proxyserveraddress:port");
WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultNetworkCredentials;

然后您就可以通過API發送通知。

我使用當前用戶的憑據,但是您可以創建自定義NetworkCredentials。

希望能幫助到你。

哈維爾

我的猜測是您位於HTTP代理(可能是防火牆)的后面,該代理希望您進行身份驗證,然后再進入實際的Azure Notification Hub。 您可能必須在Notification Hub客戶端API上設置代理的憑據-我不太確定該怎么做,但希望文檔可以為您指明正確的方向。

亨里克

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM