无法通过其http端点URL访问WSO2 ESB代理服务

时间:2018-04-06 11:46:33

标签: http wso2 wso2esb wso2carbon endpoint

我们拥有可通过其https端点访问的WSO2 ESB代理服务。我想配置此服务,以便它也可以通过http访问。 我检查了碳管理控制台中的服务配置,并确认已启用https和http端点: https://10.20.0.20:8245/services/<service_name> http://10.20.0.20:8282/services/<service_name>

此外,ESB_HOME} / repository / conf / axis2 /中的axis2.xml文件似乎配置得很好。

<!-- ================================================= -->
<!--             Transport Ins (Listeners)             -->
<!-- ================================================= -->

<!-- the non blocking http transport based on HttpCore + NIO extensions -->
<transportReceiver name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOListener">
    <parameter name="port" locked="false">8280</parameter>
    <parameter name="non-blocking" locked="false">true</parameter>
    <!--parameter name="bind-address" locked="false">hostname or IP address</parameter-->
    <!--parameter name="WSDLEPRPrefix" locked="false">https://apachehost:port/somepath</parameter-->
    <parameter name="httpGetProcessor" locked="false">org.wso2.carbon.transport.nhttp.api.NHttpGetProcessor</parameter>
    <!--<parameter name="priorityConfigFile" locked="false">location of priority configuration file</parameter>-->
    <parameter name="disableRestServiceDispatching" locked="false">true</parameter>
</transportReceiver>

<!-- the non blocking https transport based on HttpCore + SSL-NIO extensions -->
<transportReceiver name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLListener">
    <parameter name="port" locked="false">8243</parameter>
    <parameter name="non-blocking" locked="false">true</parameter>
    <!--parameter name="bind-address" locked="false">hostname or IP address</parameter-->
    <!--parameter name="WSDLEPRPrefix" locked="false">https://apachehost:port/somepath</parameter-->
    <!--<parameter name="priorityConfigFile" locked="false">location of priority configuration file</parameter>-->
    <parameter name="httpGetProcessor" locked="false">org.wso2.carbon.transport.nhttp.api.NHttpGetProcessor</parameter>
    <parameter name="disableRestServiceDispatching" locked="false">true</parameter>
    <parameter name="keystore" locked="false">
        <KeyStore>
            <Location>repository/resources/security/iaascol.jks</Location>
            <Type>JKS</Type>
            <Password>***</Password>
            <KeyPassword>rotcelloc</KeyPassword>
        </KeyStore>
    </parameter>
    <parameter name="truststore" locked="false">
        <TrustStore>
            <Location>repository/resources/security/client-truststore.jks</Location>
            <Type>JKS</Type>
            <Password>***</Password>
        </TrustStore>
    </parameter>
    <!--<parameter name="SSLVerifyClient">require</parameter>
        supports optional|require or defaults to none -->
</transportReceiver>

ESB_HOME中的端口偏移量} /repository/conf/carbon.xml设置为2。

<Offset>2</Offset>

我似乎无法通过其http端点URL访问此代理服务。 WSO2 ESB的版本是4.5.0。请让我知道我必须检查/设置哪种配置。提前谢谢。

编辑:下面是代理服务配置以及netstat结果。

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
  name="disbursement" statistics="disable"
  trace="enable" transports="https,http">
 <target>
    <inSequence>
        <property action="set" name="EXECUTION_CONTEXT"
            scope="default" type="STRING" value="disbursement"/>
        <property action="set"
            expression="fn:concat(//*[local-name()='Header']/*[local-name()='TrackingID'], '.xml')"
            name="DumpFileName" scope="default" type="STRING"/>
        <log category="INFO" level="full" separator=",">
            <property name="EVENT_TYPE" value="PROCESSING_STARTED"/>
            <property expression="get-property('DumpFileName')" name="FILENAME"/>
        </log>
        <property action="set" name="DumpFilePath" scope="default"
            type="STRING" value="/home/user1/data/disbursement/incoming"/>
        <class name="se.seman.wso2.mediator.WriteFile"/>
        <property action="set" name="TopicName" scope="default"
            type="STRING" value="VirtualTopic.seman.iaas.user1.topic.disbursement.out"/>
        <property action="set" name="ResultCode" scope="default"
            type="STRING" value="0"/>
        <!--
        TODO correct problem with xpath
        validate source="/default/xpath">
            <on-fail>
                <property action="set" name="ResultCode"
                    scope="default" type="STRING" value="100"/>
                <property action="set"
                    expression="get-property('ERROR_MESSAGE')"
                    name="ResultMessage" scope="default"
                    type="STRING"
                    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Namespaces.user1.se:Cmf:InfoModel:FinancialManagement:Payment:Disbursment:0002"/>
                <log category="INFO" level="full" separator=",">
                    <property name="MESSAGE" value="Schema validation failed"/>
                    <property
                        expression="get-property('ERROR_CODE')"
                        name="ERROR_CODE"
                        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Namespaces.user1.se:Cmf:InfoModel:FinancialManagement:Payment:Disbursment:0002"/>
                    <property
                        expression="get-property('ERROR_MESSAGE')"
                        name="ERROR_MESSAGE"
                        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Namespaces.user1.se:Cmf:InfoModel:FinancialManagement:Payment:Disbursment:0002"/>
                </log>
                <property action="set" name="RESPONSE"
                    scope="default" type="STRING" value="true"/>
            </on-fail>
            <schema key="conf:user1/ESBConfig/Common/NetPosti/resources/Disbursement_0002.xsd"/>
        </validate -->
        <log category="INFO" level="headers" separator=",">
            <property name="MESSAGE" value="Before Topic"/>
            <property expression="get-property('ERROR')" name="ERROR"/>
        </log>
        <filter xpath="get-property('ResultCode') = '0'">
            <then>
                <property action="set" name="ResultMessage"
                    scope="default" type="STRING" value="OK"/>
                <class name="se.seman.wso2.mediator.WriteActiveMQTopic"/>
            </then>
            <else/>
        </filter>
        <header action="remove" name="To"/>
        <property action="remove" name="NO_ENTITY_BODY" scope="axis2"/>
        <property action="set" name="RESPONSE" scope="default"
            type="STRING" value="true"/>
        <payloadFactory>
            <format>
                <disr:DisbursementResponse xmlns:disr="urn:Namespaces.user1.se:Service:FinancialManagement:Payment:Disbursement:Response:0001">
                    <disr:ResponseCode>$1</disr:ResponseCode>
                    <disr:Message>$2</disr:Message>
                </disr:DisbursementResponse>
            </format>
            <args>
                <arg expression="get-property('ResultCode')"/>
                <arg expression="get-property('ResultMessage')"/>
            </args>
        </payloadFactory>
        <log category="INFO" level="full" separator=","/>
        <send/>
    </inSequence>
    <outSequence>
        <log category="INFO" level="full" separator=",">
            <property name="MESSAGE" value="On the way back.."/>
        </log>
        <send/>
    </outSequence>
    <faultSequence>
        <log category="INFO" level="full" separator=",">
            <property name="MESSAGE" value="Error in Call!"/>
        </log>
        <property action="set" name="RESPONSE" scope="default"
            type="STRING" value="true"/>
        <enrich>
            <source clone="true" type="inline">
                <disr:DisbursementResponse xmlns:disr="urn:Namespaces.user1.se:Service:FinancialManagement:Payment:Disbursement:0001">
                    <disr:ResponseCode>900</disr:ResponseCode>
                    <disr:Message>General error</disr:Message>
                </disr:DisbursementResponse>
            </source>
            <target action="replace" type="body"/>
        </enrich>
    </faultSequence>
</target>
<publishWSDL key="conf:user1/ESBConfig/Common/NetPosti/resources/DisbursementService0002.wsdl">
    <resource
        key="conf:user1/ESBConfig/Common/NetPosti/resources/Disbursement_0002.xsd" location="Disbursement_0002.xsd"/>
</publishWSDL>

[user1@ip-10-20-0-20 ~]$ netstat -pnlt
Proto Recv-Q Send-Q Local Address               Foreign Address             
State       PID/Program name
tcp        0      0 :::8245                     :::*                        
LISTEN      2454/java
tcp        0      0 :::8282                     :::*                        
LISTEN      2454/java

1 个答案:

答案 0 :(得分:0)

原来这只是一个防火墙问题。端口8282在wso2防火墙(iptables)中被阻止。谢谢你的所有答案!