2017-03-14 52 views
1

我有一個HTTP POST請求發送到Web服務的流程。它不返回預期的SOAP XML響應,而是返回一個頁面重定向。 測試服務時,我使用SOAPUI。我使用相同的URL和POST請求。我得到實際的數據。沒有頁面重定向。Mule HTTP POST請求返回302頁面重定向

我的流動如下所示:

<flow name="webService_Flow"> 
    <http:listener 
     config-ref="HTTP_Listener_Configuration" 
     path="/getWS" 
     allowedMethods="GET" 
     doc:name="HTTPS"/> 
    <parse-template 
     location="templates/ws.template" 
     mimeType="text/xml" 
     doc:name="Parse Template"/> 
    <http:request 
     config-ref="HTTP_Request_Configuration" 
     path="${webservice.request.path}" 
     method="POST" 
     doc:name="HTTP"> 
     <http:request-builder> 
      <http:header headerName="Content-Type" value="text/xml"/> 
     </http:request-builder> 
     <http:failure-status-code-validator values="302"/> 
    </http:request> 
    <flow-ref 
     name="transformWS_subflow" 
     doc:name="Transform WS"/> 
    <logger 
     message="#[message]" 
     level="INFO" 
     category="HTTP_MESSAGE" doc:name="Logger"/> 
</flow> 

HTTP請求連接器看起來如下:

<http:request-config 
    name="HTTP_Request_Configuration" 
    protocol="HTTPS" 
    host="${webservice.host}" 
    basePath="${webservice.path}" 
    port="${webservice.port}" 
    followRedirects="false" 
    doc:name="HTTP Request Configuration"/> 

我已驗證的URL,路徑,端口和協議。任何想法如何彌補這一點?

+0

我甚至嘗試使用Web服務消費者連接器。我得到頁面重定向。 – tbriscoe

回答

0

將followRedirects設置爲true應該可以做到。您在配置中將其設置爲false,因此所有收到的重定向都將按原樣返回。 HTH

+0

仍將頁面重定向到網頁。沒有數據。我有一個幾乎相同的流量到另一個服務。有用。這讓我感到困惑。 – tbriscoe

+0

你可以用followRedirects =「true」來嘗試,還可以向主機發送一個明確的主機頭?當服務器無法處理髮送包含端口的隱式主機頭時,我看到類似的東西。 – afelisatti

+0

沒有成功,但它確實返回了404頁而不是302頁重定向。我會鼓搗它一些,你可能有一些東西在那裏。 – tbriscoe