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

  • Home
  • SEARCH
  • 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 7831105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:34:26+00:00 2026-06-02T11:34:26+00:00

I developed web services using CXF. Today i added the simple user name token

  • 0

I developed web services using CXF. Today i added the simple user name token security for the web service. After that when i try to deploy the web service i am getting following exception

javax.xml.ws.WebServiceException: java.lang.RuntimeException: Incorrect inclusion value: null
Failed to build the policy 'UsernameToken':Incorrect inclusion value: null

I am using Jboss 6 . The following is my policy snippet i have added in the wsdl file.

<wsp:Policy wsu:Id="UsernameToken"
        xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
        xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
        <wsp:ExactlyOne>
            <wsp:All>
                <!-- Empty <TransportBinding/> element required due to bug in CXF 2.2.6 -->
                <sp:TransportBinding />
                <sp:SupportingTokens>
                    <wsp:Policy>
                        <sp:UsernameToken sp:IncludeToken=".../IncludeToken/AlwaysToRecipient" />
                    </wsp:Policy>
                </sp:SupportingTokens>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>

The following is my cxf.xml file

<jaxws:endpoint id="UpcLineOfBusinessServiceImpl"
        address="/upcLineOfBusinessService" wsdlLocation="../wsdl/upclineofbusinessserviceimpl.wsdl">
        <jaxws:implementor>
            <ref bean="upcLineOfBusinessService"></ref>
        </jaxws:implementor>
        <jaxws:inInterceptors>
            <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
            <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
                <constructor-arg>
                    <map>
                        <entry key="action" value="UsernameToken" />
                        <entry key="passwordType" value="PasswordText" />
                        <entry key="passwordCallbackClass" value="com.tecnotree.upc.security.PasswordCallBack" />
                    </map>
                </constructor-arg>
            </bean>
        </jaxws:inInterceptors>
    </jaxws:endpoint>

Please help me . Thanks in advance

  • 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-02T11:34:27+00:00Added an answer on June 2, 2026 at 11:34 am

    I’ve recently come across the same exception. The problem was incorrect sp:IncludeToken value. After I changed it to http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient everything worked fine.

    Available values are defined in org.apache.cxf.ws.security.policy.SP12Constants (for WS-SecurityPolicy 1.2) or in org.apache.cxf.ws.security.policy.SP11Constants (for 1.1)

    Complete policy definition looks like this:

    <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy">
        <wsp:ExactlyOne>    
            <wsp:All>
                <sp:SupportingTokens xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
                    <wsp:Policy>
                        <sp:UsernameToken
                            sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
                            <wsp:Policy>
                                <sp:WssUsernameToken10 />
                                <sp:HashPassword />
                            </wsp:Policy>
                        </sp:UsernameToken>
                    </wsp:Policy>
                </sp:SupportingTokens>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi We developed web service using WCF service and hosted on Windows 2003 server
I have developed a Web service using WCF Service Application. This service application is
I have created a web service which has a couple of methods developed using
i have developed a web servcies in my local system with name (inbox service).
I am developing a web application that calls web services developed by a third
I have developed webservices using CXF framework. We are exposing all our Database operation(Service
I have developed a web service using netbeans. It's currently being hosted locally(localhost). I
I developed a Custom application that is able to consume the CRM Web services
I developed a Custom application that is able to consume the CRM Web services
We are using ASP.Net Web services. The architecture is Desktop Based Application developed in

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.