1 Reply Latest reply on Aug 24, 2012 9:34 PM by Mike P

    jboss-webservices.xml

    Mike P Newbie

      https://docs.jboss.org/author/display/JBWS/Apache+CXF+integration#ApacheCXFintegration-Policyalternativeselector

       

      "

      Policy alternative selector

      The Apache CXF policy engine supports different strategies to deal with policy alternatives. JBossWS-CXF integration currently defaults to the MaximalAlternativeSelector, but still allows for setting different selector implementation using the cxf.policy.alternativeSelector property in jboss-webservices.xml.

      "

       

      How? Googling for "cxf.policy.alternativeSelector" reveals a single link to the article above. Seems noone in the world has ever talked about this on the internet.

       

      Looking at random jboss-webservices.xml files doesn't give me any hints as to how I would specificy this property.

        • 1. Re: jboss-webservices.xml
          Mike P Newbie

          Never mind...

          https://docs.jboss.org/author/display/JBWS/Advanced+User+Guide#AdvancedUserGuide-Configurationthroughdeploymentdescriptor

           

          Didn't work, but someone commented that itsn't not supported until 7.2.0. So I'm bound to a nightly build now... hope it's really "stable".

           

          Quick observation though. jbossws-cxf-server-4.1.0.Beta1.jar in org/jboss/wsf/stack/cxf/configuration/BusHolder.java (i'm looking at the code after decompiling mind you), I'm seeing this method:

           

              private static AlternativeSelector getAlternativeSelector(Map props)

              {

                  AlternativeSelector selector = new MaximalAlternativeSelector();

                  if(props != null && !props.isEmpty())

                  {

                      String className = (String)props.get("cxf.policy.alternativeSelector");

                      if(className != null)

                          try

                          {

                              Class clazz = Class.forName(className);

                              selector = (AlternativeSelector)clazz.newInstance();

                          }

                          catch(Exception e) { }

                  }

                  return selector;

              }

           

          I tried to add this to jboss-webserver.xml:



          <property>



          <name>cxf.policy.alternativeSelector</name>



          <value>XYZXYZ</value>


          </property>

           

          with the intent to make purposely cause an exception, so that I have some feedback that tells me that indeed this property is the right one and is doing something.

          After if doing nothing, I looking at the source, and saw how it absorbed the exception into nothingness. Someone should fix that.