什么是下面的Azure通知集线器REST响应的意思是:'指定的资源描述是无效的。“? [英] What does the following Azure Notification Hub REST response mean: 'The specified resource description is invalid.'?
问题描述
的我尝试注册我的Windows通用应用程序,通过我们的Java后端服务从Azure的通知中心通知。的
我调试从Visual Studio应用程序,这是在我的Windows Phone设备上运行一段时间。该应用程序可以正确得到ChannelUri,并通过它传递给我们的Java后端。 (我跑我的本地PC上的后端。)
I debugged the app from Visual Studio, while it was running on my Windows Phone device. The app could properly get a ChannelUri and passed it along to our Java backend. (I ran the backend on my local PC.)
在Java后端生成一个模板注册以下的请求,并试图将其发送到Azure的REST API:
The Java backend generated the following request for a template registration and tried to send it to the Azure REST Api:
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<content type="application/xml">
<WindowsTemplateRegistrationDescription xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Tags>Windows,10204394042027091,broadcast</Tags>
<ChannelUri>https://db3.notify.windows.com/?token=AwYAAABXiUp%2bD8v1%2bVfWbWLr3FZ3rQcJtPkUgFwaiGZus4GbtkM8zbZ6uQt1NKXpC4FOtYWHDxXvBb3FkoefaozvCYTFiDjhdb3jDuORUDY8zBlkGw1MxY0QjrH7G0fFbW0RXgo%3d</ChannelUri>
<BodyTemplate><![CDATA[{...}]]></BodyTemplate>
<WNSHeaders>
<WNSHeader>
<Header>X-WNS-Type</Header>
<Value>wns/raw</Value>
</WNSHeader>
</WNSHeaders>
<TemplateName>geoinfo</TemplateName>
</WindowsTemplateRegistrationDescription>
</content>
</entry>
在此是根据MS Azure的REST参考我认为: HTTP ://msdn.microsoft.com/en-us/library/azure/dn223265.aspx
In my opinion this is according to the MS Azure REST reference: http://msdn.microsoft.com/en-us/library/azure/dn223265.aspx
不过,响应包含以下错误:
Still, the response contains the following error:
<Error><Code>400</Code><Detail>The specified resource description is invalid..TrackingId:4ffaabcc-c7f8-4a6c-ab2f-4f65e94427df_G16,TimeStamp:10/21/2014 9:42:52 PM</Detail></Error>
的什么天青的问题是,在这里任何想法?的
推荐答案
该错误消息显然意味着该请求缺少必需的XML元素。
在我的情况的问题是资本化:
The error message apparently means that the request is missing required XML elements. The problem in my case was the capitalization:
的两个 WNSHeader
和 WNSHeaders
应该用Pascal写的情况下,而不是为 WnsHeader
和 WnsHeaders
。的
微软对API 文档误导对此
这篇关于什么是下面的Azure通知集线器REST响应的意思是:'指定的资源描述是无效的。“?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!