0

MULE CE 3.3.0 には、この構成 XML ファイルがあります (以下にコピーしました)。

    <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http"
    xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.3.0"
    xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd 
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd 
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd ">


    <configuration>
        <expression-language>
            <global-functions>
                def parseIp(fullIp) {
                return
                fullIp.substring(fullIp.indexOf('/') + 1, fullIp.indexOf(':'))
                }
        </global-functions>
        </expression-language>
    </configuration>

    <cxf:configuration enableMuleSoapHeaders="false"
        doc:name="CXF Configuration" />
    <flow name="soapservice" doc:name="soapservice">

        <http:inbound-endpoint exchange-pattern="request-response"
            address="http://localhost:8089/services/Echo">
            <cxf:proxy-service service="Weather" payload="envelope"
                wsdlLocation="classpath:myWS.wsdl"

                namespace="http://ws.cdyne.com/WeatherWS/">
                <cxf:inInterceptors>
                    <spring:bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />
                </cxf:inInterceptors>
                <cxf:outInterceptors>
                    <spring:bean class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
                </cxf:outInterceptors>
            </cxf:proxy-service>
        </http:inbound-endpoint>
        <copy-properties propertyName="SOAPAction" />
        <set-variable variableName="remoteClientAddress"
            value="#[parseIp(message.inboundProperties['MULE_REMOTE_CLIENT_ADDRESS'])]" />

        <component doc:name="classTest" class="com.subu.mule.IpClient" />
        <http:outbound-endpoint address="http://wsf.cdyne.com/WeatherWS/Weather.asmx"
            encoding="UTF-8" responseTimeout="1000000" exchange-pattern="request-response">
            <cxf:proxy-client payload="envelope">
                <cxf:inInterceptors>
                    <spring:bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />
                </cxf:inInterceptors>
                <cxf:outInterceptors>
                    <spring:bean class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
                </cxf:outInterceptors>
            </cxf:proxy-client>
        </http:outbound-endpoint>


    </flow>
</mule>

その後、ブラウザで自分のミュール プロジェクトを実行します。入力するとhttp://localhost:8089/services/Echo?wsdl、wsdl のコードが表示されます。しかし、何らかの理由でミュールプロジェクトが停止することがあるため、入力するhttp://localhost:8089/services/Echo?wsdlと、ブラウザcould not connect to localhost:8089 OR page could not findにこのメッセージが表示されます。

このメッセージを制御したいのですが、実際にはサービス (ミュール プロジェクト) がダウンしているときに、設定したカスタム メッセージを公開します。たとえば、ブラウザでクライアントに次のメッセージを表示します。この時点でサービスがダウンしています。後で試してください!!!!

4

1 に答える 1