eyebag21
eyebag21

Reputation: 11

Can't access WSO2 ESB proxy service thru its http endpoint URL

We have this WSO2 ESB proxy service that's accessible thru its https endpoint. I want to configure this service so that it will also be accessible via http. I checked the service configuration in the carbon management console and confirmed that both https and http endpoint were already enabled: https://10.20.0.20:8245/services/<service_name> http://10.20.0.20:8282/services/<service_name>

Also, the axis2.xml file in ESB_HOME}/repository/conf/axis2/ seems to be configured just fine.

<!-- ================================================= -->
<!--             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>

Port offset in ESB_HOME}/repository/conf/carbon.xml is set to 2.

<Offset>2</Offset>

I can't seem to access this proxy service thru its http endpoint URL. The version of WSO2 ESB is 4.5.0. Please let me know which configuration do I have to check / set. Thanks in advance.

Edit: Below is the proxy service config as well as netstat result.

<?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

Upvotes: 1

Views: 508

Answers (1)

eyebag21
eyebag21

Reputation: 11

turned out this was only a firewall issue. port 8282 was blocked in wso2 firewall (iptables). thanks for all answers!

Upvotes: 0

Related Questions