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 9173613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:36:57+00:00 2026-06-17T16:36:57+00:00

I have created a web service in my machine. Its URL is http://localhost:8080/aaa/test?wsdl I

  • 0

I have created a web service in my machine. Its URL is

http://localhost:8080/aaa/test?wsdl

I want to enable one feature to it. As soon as the user enters the url in browser, it should ask for the credentials. Can it be done in web services.

If yes, can some one guide how to achieve it.

Thanks.

  • 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-17T16:36:58+00:00Added an answer on June 17, 2026 at 4:36 pm

    If you’re already using Spring, you can easily apply basic authentication to a specific URL pattern with Spring Security. In your applicationContext.xml, just add:

    <beans:beans xmlns="http://www.springframework.org/schema/security"
    xmlns:beans="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/security
    http://www.springframework.org/schema/security/spring-security-3.0.3.xsd">
    
    <!-- HTTP basic authentication in Spring Security -->
    <http>
        <intercept-url pattern="/*wsdl?" access="ROLE_USER" />
        <http-basic />
    </http>
    
    <authentication-manager>
       <authentication-provider>
           <user-service>
           <user name="someUser" password="somePassword" authorities="ROLE_USER" />
           </user-service>
       </authentication-provider>
    </authentication-manager>
    
    </beans:beans>
    

    Example taken from Mkyong’s Spring Security HTTP Basic Authentication Example.

    If you’d like to lookup users in a database, you’d need to use a different authentication provider. The Spring Security reference mentions data-source-ref if you’d like to query the standard Spring Security user data tables. If you’ve already got your own structure, you might be interested in using user-service-ref instead, in which you can lookup the users yourself.

    <authentication-manager>
      <authentication-provider user-service-ref='myUserDetailsService'/>
    </authentication-manager>
    
    <beans:bean id="myUserDetailsService"
        class="mypackage.MyUserDetailsService">
      <beans:property name="dataSource" ref="dataSource"/>
    </beans:bean>
    

    And code mypackage.MyUserDetailsService extending JdbcDaoImpl and implementing UserDetailsService.

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

Sidebar

Related Questions

I have created Web-Service in asp.net with c# . Now i want to pass
I have created a simple web-service using Java. i want to load jars related
Good Day, I have created an asp.net web service on my local machine, and
I have a web service that I created in C# and a test harness
I have created Restful web service in jomsocial environment. It's on the local machine.
I have created a web service in django and its hosted on a shared
I have created a web service via WCF. Then I exposed it as a
I have created a web service which is saving some data into to db.
I have created a web service which takes a username and password as parameters
I have created a web service which returns some data and am trying to

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.