SOAP-UI Http状态:405 - HTTP方法' GET'传入的请求...是不允许的

时间:2016-11-30 22:31:46

标签: rest wcf soapui

我正在从SOAP-UI执行POST到IIS C#REST / JSON Web服务。我有它的工作,然后改变我的web.config以要求SSL,这个问题开始了。 还将IIS webservice更改为SSL而不是已接受。

现在我在SOAP-UI的RAW视图中收到错误:

HTTP/1.1 405 Method Not Allowed
Allow: POST
Content-Length: 1565
Content-Type: text/html; charset=UTF-8
Server: Microsoft-IIS/7.5

来自Trace Listener:

    <ExceptionString>System.InvalidOperationException: The HTTP method 'GET' of the incoming request (with URI 'https://mysite/MyApp/SQRTREST.svc/placeOrderSQRT/') is not allowed.</ExceptionString>
<StackTrace>   at System.Runtime.Diagnostics.EtwDiagnosticTrace.WriteExceptionToTraceString(XmlTextWriter xml, Exception exception, Int32 remainingLength, Int32 remainingAllowedRecursionDepth)
   at System.Runtime.Diagnostics.EtwDiagnosticTrace.ExceptionToTraceString(Exception exception, Int32 maxTraceStringLength)
   at System.Runtime.Diagnostics.EtwDiagnosticTrace.GetSerializedPayload(Object source, TraceRecord traceRecord, Exception exception, Boolean getServiceReference)
   at System.Runtime.TraceCore.HandledExceptionWarning(EtwDiagnosticTrace trace, String param0, Exception exception)
   at System.ServiceModel.Dispatcher.HttpUnhandledOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp;amp; outputs)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp;amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp;amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp;amp; rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
   at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)
   at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)
   at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)

因此,如果SOAP-UI正在进行POST,为什么错误与HTTP&#34; GET&#34;相关。方法

这也发生在生产中的SOAP-UI中,但是外部客户端似乎仍然能够使用他们使用的任何软件来调用web服务。

我在StackOveflow上看到关于405的其他帖子,但没有解决SOAP-UI帖子的问题。

在发布上述内容后的第二天更新:

1)我使用Debug / Trace进行了设置 - 当运行SOAP-UI时,跟踪永远不会进入方法

2)我设置了一个C#客户端程序来执行Post,它确实进入了方法并且我能够使用Debug / Trace(它以另一个问题结束我必须解开)。

更新2:一些研究让我觉得它可能与HTTP标头加密的事实有关。 SOAP-Ui论坛中有人提到缺少HTTP标头;但不确定导致我的地方......

1 个答案:

答案 0 :(得分:0)

这引出了解决方案:

https://forums.iis.net/t/1152122.aspx?HTTP+1+1+405+Method+Not+Allowed+Allow+OPTIONS+TRACE+GET+HEAD

我只是在方法名称上添加了一个斜杠。 我将端点设置为xxx.svc。 然后我将Resource设置为诸如/ Resource1之类的值。 通过将其更改为/ Resource1 /它工作。

上面的链接表明它试图读取目录或其他东西。