Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8821141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:46:46+00:00 2026-06-14T05:46:46+00:00

I am using tomcat7 and axis2 to deploy java web services. In server.xml I

  • 0

I am using tomcat7 and axis2 to deploy java web services.

In server.xml I configured three connectors (http, https wich server and client side certificates, https with server side certificate only):

<Connector port="8181" protocol="HTTP/1.1" />
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" scheme="https" clientAuth="true"  keystoreFile=... truststoreFile=... />
<Connector port="8444" protocol="HTTP/1.1" SSLEnabled="true" scheme="https" clientAuth="false" keystoreFile=...  />

In axis2.xml I configured three transportReceivers:

<transportReceiver name="http" class="org.apache.axis2.transport.http.AxisServletListener">
    <parameter name="port">8181</parameter>
    <parameter name="c1">none</parameter>
</transportReceiver>

<transportReceiver name="https" class="org.apache.axis2.transport.http.AxisServletListener">
    <parameter name="port">8443</parameter>
    <parameter name="c2">serverAndClient</parameter>
</transportReceiver>

<transportReceiver name="https" class="org.apache.axis2.transport.http.AxisServletListener">
    <parameter name="port">8444</parameter>
    <parameter name="c3">serverOnly</parameter>
</transportReceiver>

That works fine ! All my web services are accessible on all ports as expected.

Unfortunately I would like to allow “login without password service” on 8443 only (because client will have certificate), and “login with password” on 8444.

In Java I tried:

MessageContext msg = MessageContext.getCurrentMessageContext();
TransportInDescription tin = msg.getTransportIn();
String str = tin.getParameters().toString();

but I always get:

[Parameter : port=8444, Parameter : c3=serverOnly]

It seems that one transport receiver always handles my messages. Is there a way to detect which transport receiver (or port) is really used for current invocation ?

BR,
Jacek

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:46:47+00:00Added an answer on June 14, 2026 at 5:46 am

    Finally I found a solution.

    I was wrong that only one transport receiver handles all messages. There are two (one for http and one for https). Unfortunately you can not define second https transport because axis2 holds all transport descriptors in hash map and name is a key so there will be always only one entry for “https” and you will get 8181 or 8444.

    To solve this you can create your own servlet and store port number in MessageContext when message arrives. That is very easy:

    public class MyServlet extends AxisServlet
    {   
        protected MessageContext createMessageContext( HttpServletRequest request, HttpServletResponse response, boolean invocationType ) throws IOException
        {
            MessageContext mc = super.createMessageContext( request, response, invocationType );
            URL url = new URL( request.getRequestURL().toString() );
            mc.setProperty( "myPort", url.getPort() );
            return mc;      
        }
    }
    

    Of course you must put your class name in axis2/…/web.xml and restart tomcat.
    Then you can check port number inside any axis2 invocation:

    MessageContext mc = MessageContext.getCurrentMessageContext();
    int port = ( Integer ) mc.getProperty( "myPort" );
    

    Now I really get 8181, 8443 or 8444 :).

    BR, Jacek

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a Java Project in Eclipse using the Web services Top down approach
I am trying to learn how to implement Web Services using Axis2 and Tomcat,
I have written a Web Service in Java using axis2 and the POJO deployment
I have made an Axis2 Web Service in Java. I am using Apache Tomcat
I am using Tomcat7 on Windows Server 2008. I have the following two lines
I recently migrated my JSF app(using primefaces) from glassfish 3.1 to tomcat7 server. Previously
I am using tomcat6 and java on Debian server. Does anyone know of some
I am using Tomcat server for my java based Application . My question is
I try to deploy web service using axis1 and use in my web service
I'm using Axis2 with Apache Tomcat. I need the clients of the web service

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.