IC SunsetThe developerWorks Connections Platform is now in read-only mode and content is only available for viewing. No new wiki pages, posts, or messages may be added. Please see our FAQ for more information. The developerWorks Connections platform will officially shut down on March 31, 2020 and content will no longer be available. More details available on our FAQ. (Read in Japanese.)
Topic
  • 7 replies
  • Latest Post - ‏2017-02-01T09:59:45Z by Alan Hollingshead
JibinJacob
JibinJacob
30 Posts

Pinned topic How to configure 2 ports (for http requests) in server.xml?

‏2017-01-30T14:43:38Z |

Hi,

 

Is it possible to configure two or more ports for http requests in server.xml?

Business Use: Three API's are there. First API has to go to port '9001', second has to go to '9002' and third has to go to '9003'. Is that achievable?   

 

Thanks,

Jibin

  • Alan Hollingshead
    Alan Hollingshead
    58 Posts
    ACCEPTED ANSWER

    Re: How to configure 2 ports (for http requests) in server.xml?

    ‏2017-02-01T09:59:45Z  

    Hi Alan,

    Thanks for the reply.

    I understood this concept. But business requirement (specifically looking for) is to have two different ports for teh API's. second port number is populated from the system as a response parameter of the API-1.

    API-1 is the Login API. if Login process is successful, then second port number will be populated from the RACF as a response parameter of Login API. So i need to configure two ports in server.xml.

     

    Could you please explain me how to configure two different ports in server.xml as the httpEndpoint?

     

    Thanks,

    Jibin

     

    Hi Jibin,

    Thank you for explaining your business requirement.

    It is possible to configure two http endpoints. You should each one a different id and port number, as shown in the example below:

     

    <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
        <httpEndpoint id="defaultHttpEndpoint"
                      host="*"
                      httpPort="9080"/>

       <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
        <httpEndpoint id="secondHttpEndpoint"
                      host="*"
                      httpPort="9081"/>    

    Further information is available in the Liberty Knowledge Center:

    https://www.ibm.com/support/knowledgecenter/SSEQTP_9.0.0/com.ibm.websphere.wlp.doc/ae/rwlp_config_httpEndpoint.html

    Thanks, Alan.

  • Alan Hollingshead
    Alan Hollingshead
    58 Posts

    Re: How to configure 2 ports (for http requests) in server.xml?

    ‏2017-01-30T17:54:17Z  

    Hello Jibin,

    Please can you provide more explanation of your business requirement?

    Although it is possible to have multiple http endpoints, it is not generally good practice.

    Typically a z/OS Connect EE server will be configured to use a single http endpoint.

    Even if you have multiple http endpoints, once in z/OS Connect EE all services/APIs are processed in the same way regardless of which port they arrive on.

    It might be that you want z/OS Connect EE to process services/APIs in different ways, for example, for your APIs to use different levels of security, in which case you add some appropriate configuration parameters to your server.xml to override any defaults.

    Thanks,

    Alan

  • JibinJacob
    JibinJacob
    30 Posts

    Re: How to configure 2 ports (for http requests) in server.xml?

    ‏2017-01-31T06:29:46Z  

    Hello Jibin,

    Please can you provide more explanation of your business requirement?

    Although it is possible to have multiple http endpoints, it is not generally good practice.

    Typically a z/OS Connect EE server will be configured to use a single http endpoint.

    Even if you have multiple http endpoints, once in z/OS Connect EE all services/APIs are processed in the same way regardless of which port they arrive on.

    It might be that you want z/OS Connect EE to process services/APIs in different ways, for example, for your APIs to use different levels of security, in which case you add some appropriate configuration parameters to your server.xml to override any defaults.

    Thanks,

    Alan

    Hi Alan,

    Thanks for the reply.

    As per the business requirement, we need to have one set of API's (Login/Logout) has to go to one port and other API's which are doing the actual business processing has to go to different port.

     

    Thanks,

    Jibin

  • Alan Hollingshead
    Alan Hollingshead
    58 Posts

    Re: How to configure 2 ports (for http requests) in server.xml?

    ‏2017-01-31T09:37:34Z  

    Hi Alan,

    Thanks for the reply.

    As per the business requirement, we need to have one set of API's (Login/Logout) has to go to one port and other API's which are doing the actual business processing has to go to different port.

     

    Thanks,

    Jibin

    Hi Jibin,

    Is your business requirement to have different security applied to different APIs? For example, API-1 has basic authentication, whereas API-2 does not require any authentication?

    Thanks,

    Alan.

  • JibinJacob
    JibinJacob
    30 Posts

    Re: How to configure 2 ports (for http requests) in server.xml?

    ‏2017-01-31T10:19:07Z  

    Hi Jibin,

    Is your business requirement to have different security applied to different APIs? For example, API-1 has basic authentication, whereas API-2 does not require any authentication?

    Thanks,

    Alan.

    Yes.. Once the logon is successful, i will be getting an output response with another Port number  which i need to access for other API's.

     

    Thanks,

    Jibin

  • Alan Hollingshead
    Alan Hollingshead
    58 Posts

    Re: How to configure 2 ports (for http requests) in server.xml?

    ‏2017-01-31T10:55:54Z  

    Yes.. Once the logon is successful, i will be getting an output response with another Port number  which i need to access for other API's.

     

    Thanks,

    Jibin

    Hi Jibin.

    The http port does not control whether authentication of an API request occurs, it is the attributes on the <zosconnect_zosConnectAPIs> element that controls the authentication of an API request.

    For example, in your server.xml configuration file:

    <httpEndpoint id="defaultHttpEndpoint"  host="*" httpPort="1234" />
    
    <zosconnect_zosConnectAPIs>
        <zosConnectAPI name="API-1 requireAuth="true" />
        <zosConnectAPI name="API-2 requireAuth="false"  />
    </zosconnect_zosConnectAPIs>
    

    In this example all requests arrive on http port 1234. Those requests for API-1 will require basic authentication whereas those for API-2 will not.

    Would this meet your business requirement?

    Thanks, Alan.

  • JibinJacob
    JibinJacob
    30 Posts

    Re: How to configure 2 ports (for http requests) in server.xml?

    ‏2017-02-01T04:31:55Z  

    Hi Jibin.

    The http port does not control whether authentication of an API request occurs, it is the attributes on the <zosconnect_zosConnectAPIs> element that controls the authentication of an API request.

    For example, in your server.xml configuration file:

    <httpEndpoint id="defaultHttpEndpoint"  host="*" httpPort="1234" />
    
    <zosconnect_zosConnectAPIs>
        <zosConnectAPI name="API-1 requireAuth="true" />
        <zosConnectAPI name="API-2 requireAuth="false"  />
    </zosconnect_zosConnectAPIs>
    

    In this example all requests arrive on http port 1234. Those requests for API-1 will require basic authentication whereas those for API-2 will not.

    Would this meet your business requirement?

    Thanks, Alan.

    Hi Alan,

    Thanks for the reply.

    I understood this concept. But business requirement (specifically looking for) is to have two different ports for teh API's. second port number is populated from the system as a response parameter of the API-1.

    API-1 is the Login API. if Login process is successful, then second port number will be populated from the RACF as a response parameter of Login API. So i need to configure two ports in server.xml.

     

    Could you please explain me how to configure two different ports in server.xml as the httpEndpoint?

     

    Thanks,

    Jibin

     

  • Alan Hollingshead
    Alan Hollingshead
    58 Posts

    Re: How to configure 2 ports (for http requests) in server.xml?

    ‏2017-02-01T09:59:45Z  

    Hi Alan,

    Thanks for the reply.

    I understood this concept. But business requirement (specifically looking for) is to have two different ports for teh API's. second port number is populated from the system as a response parameter of the API-1.

    API-1 is the Login API. if Login process is successful, then second port number will be populated from the RACF as a response parameter of Login API. So i need to configure two ports in server.xml.

     

    Could you please explain me how to configure two different ports in server.xml as the httpEndpoint?

     

    Thanks,

    Jibin

     

    Hi Jibin,

    Thank you for explaining your business requirement.

    It is possible to configure two http endpoints. You should each one a different id and port number, as shown in the example below:

     

    <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
        <httpEndpoint id="defaultHttpEndpoint"
                      host="*"
                      httpPort="9080"/>

       <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
        <httpEndpoint id="secondHttpEndpoint"
                      host="*"
                      httpPort="9081"/>    

    Further information is available in the Liberty Knowledge Center:

    https://www.ibm.com/support/knowledgecenter/SSEQTP_9.0.0/com.ibm.websphere.wlp.doc/ae/rwlp_config_httpEndpoint.html

    Thanks, Alan.