我正在執行從SOAP-UI到IIS C#REST/JSON Web服務的POST。我有它的工作,然後改變我的web.config需要SSL和這個問題開始。 還將IIS webservice更改爲SSL,而不是接受。SOAP-UI Http狀態:405 - 不允許傳入請求的HTTP方法'GET'
現在我得到的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
從跟蹤偵聽:
<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; outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&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「GET」方法有關的錯誤?
這也發生在生產中的SOAP-UI中,但外部客戶似乎仍然可以使用他們正在使用的任何軟件調用Web服務。
我在StackOveflow上看到有關405的其他文章,但沒有涉及SOAP-UI帖子。
更新於次日發佈後,上面:
1)我安裝與調試/跟蹤 - 和運行SOAP-UI時,跟蹤不會進入方法
2)我成立了一個執行Post的C#客戶端程序,它確實進入了方法,並且我可以使用Debug/Trace(它以另一個我必須解決的問題結束)。
更新2:一些研究讓我認爲它可能與HTTP頭被加密的事實有關。 SOAP-Ui論壇中有人提到缺少HTTP標頭;但不知道在哪裏,導致我...
它可能與SSL沒有任何關係,我在最後找到了一個較老的屏幕截圖。 – NealWalters