2016-11-30 306 views
0

我正在執行從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;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「GET」方法有關的錯誤?

這也發生在生產中的SOAP-UI中,但外部客戶似乎仍然可以使用他們正在使用的任何軟件調用Web服務。

我在StackOveflow上看到有關405的其他文章,但沒有涉及SOAP-UI帖子。

更新於次日發佈後,上面:

1)我安裝與調試/跟蹤 - 和運行SOAP-UI時,跟蹤不會進入方法

2)我成立了一個執行Post的C#客戶端程序,它確實進入了方法,並且我可以使用Debug/Trace(它以另一個我必須解決的問題結束)。

更新2:一些研究讓我認爲它可能與HTTP頭被加密的事實有關。 SOAP-Ui論壇中有人提到缺少HTTP標頭;但不知道在哪裏,導致我...

回答

0

這導致我的解決方案:

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

我只是增加了一個結尾的斜線上我的方法名。 我將Endpoint設置爲xxx.svc。 然後,我將Resource設置爲諸如/ Resource1之類的值。 通過將其更改爲/ Resource1 /它工作。

上面的鏈接表明它試圖讀取目錄或其他東西。

+0

它可能與SSL沒有任何關係,我在最後找到了一個較老的屏幕截圖。 – NealWalters

相關問題