【发布时间】:2015-03-02 19:45:54
【问题描述】:
我正在尝试使用 Windows Azure 服务总线创建连接到 REST 服务的 Windows Phone。
我开发了我的 rest 服务(它是一个 Windows 服务),现在我使用 fiddler 来测试它。
但我不断收到错误“405 方法不允许”。
我注意到的事情:
我的服务在线,因为当我关闭它时,fiddler 又返回一个错误。
我的 Servicebus 已启动并正在运行,我可以在 Azure 门户上看到它。
这是我试图在 C# 中调用的操作
[WebInvoke(
//UriTemplate = "GetEmployees?Action=Get", // URI:"https://<MyBus>.servicebus.windows.net/GetEmployeesRest/GetEmployees?Action=Create"
UriTemplate = "GetEmployees?Action=Create",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.WrappedRequest)]
public DEVEmployee[] GetEmployees()
{
}
我在app.config中配置的url是:
<baseAddresses>
<add baseAddress="https://<MyBus>.servicebus.windows.net/GetEmployeesRest/"/>
</baseAddresses>
我这样称呼它是:
https://.servicebus.windows.net/GetEmployeesRest/GetEmployees?Action=Create
带有授权标头。
有人知道我做错了吗?
提前致谢。
【问题讨论】:
-
您在使用服务总线中继吗?
-
是的,我正在使用服务总线中继。我可以在 azure 门户中看到我的服务的巴士。但它总是返回 405。
标签: rest azure servicebus