2017-03-14 51 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