I'm performing XSD validation using SMX Light Weight component. Flow is as
follow:

servicemix-http(Consumer) ---> LWComponent

Configuration is given at last for both.

Validation is happening without error when scheme is hard coded but I want
to change my schema at runtime. Just because if I have 100s type of request,
i can have 100s schema but not 100s LWComponent. Simply because I don't want
to create a new component whenever I have a new kind of request requirement
comes. So I want to create only one component with some business logic to
change schemaResource property at run time. Is it possible, if yes, can
someone please let me to how to do it.

xbean for servicemix-http(Consumer)
--------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:http="http://servicemix.apache.org/http/1.0";
       xmlns:hello="http://test";>
  <http:endpoint service="hello:service"
                 endpoint="endpoint"
                 targetService="hello:MyService"
                 role="consumer" 
                 locationURI="http://localhost:8192/example/";
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"/>
</beans>
--------------------------------------------------------------------------------------------------------

servicemix.xml for LWComponent
--------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
   <beans xmlns:sm="http://servicemix.apache.org/config/1.0";
       xmlns:hello="http://test";>
  <classpath>
    <location>.</location>
  </classpath>
  <sm:serviceunit id="jbi">
      <sm:activationSpecs>
      <!-- Put lw components here -->
          <sm:activationSpec componentName="mycomponent" 
service="hello:MyService"
endpoint="endpoint">
              <sm:component>
                  <bean
class="org.apache.servicemix.components.validation.ValidateComponent">
                      <property name="schemaResource"
value="classpath:updatepassword.xsd"/>
<!-- I want to change value of that property(schemaResource) at runtime, if
possible, without touching SMX code (say from classpath:updatepassword.xsd
to classpath:updateaddress.xsd) -->
                  </bean>
              </sm:component>
         </sm:activationSpec> 
        </sm:activationSpecs>
    </sm:serviceunit>
</beans>
--------------------------------------------------------------------------------------------------------

Again, I don't want to (and even not allowed to) change service mix code. If
there is some plugable code like pojo or else (Not part of actual SMX code),
we can change it.
Or else is there any better way available to perform validation.
-- 
View this message in context: 
http://www.nabble.com/Is-dynamic-schemaResource-in-light-weight-component-possible--tp17270759p17270759.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to