Hi,

I'm trying to add a Spring mediator to my synapse configuration and i don't
find examples to help me.

 

It tried different things.

 

Here is my application-context.xml

 

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="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-2.0.xsd";>

 

      <bean id="mbeanServer"
class="org.springframework.jmx.support.MBeanServerFactoryBean">

          <property name="locateExistingServerIfPossible" value="true"/>

      </bean>

      

      <bean id="exporter"
class="org.springframework.jmx.export.MBeanExporter">

          <property name="beans">

            <map>

              <entry key="bean:name=infombean1" value-ref="infombean"/>

            </map>

          </property>

          <property name="server" ref="mbeanServer"/>

    </bean>

 

  <bean id="b" class="fr.msa.agora.synapse.mediator.TestMediator">    

  </bean>

  

 <bean id="infombean" class="fr.msa.agora.synapse.mediator.InfoMBean">

   <property name="name" value="xebia"></property>

   <property name="age" value="2"></property>

 </bean>

  

  

 

</beans>

 

And my synapse.xml

 

<definitions xmlns="http://ws.apache.org/ns/synapse";>

 

  <!--spring:config name="spring_config"
src="file:repository/conf/application-context.xml"
xmlns:spring="http://ws.apache.org/ns/synapse/spring"/-->

  

  <sequence name="frontal-in">

                          <spring:spring bean="b"
key="file:repository/conf/application-context.xml"
xmlns:spring="http://ws.apache.org/ns/synapse/spring"/>           

                                    <send>

                                                <endpoint >

                                                            <address
uri="http://localhost:8080/BouchonXMLRPC/XMLRPCStockQuote"; format="pox"/>

                                                </endpoint>

                                    </send>

    </sequence>

            

            <sequence name="frontal-out">

                                    <class
name="fr.msa.agora.synapse.mediator.TransformMediator"></class>

                                    <send/>

    </sequence>

            

            <sequence name="proxy-in">

                                    <send>

                                                <endpoint >

                                                            <address
uri="http://localhost:8080/BouchonXMLRPC/SOAPStockQuote"; format="pox"/>

                                                </endpoint>

                                    </send>

    </sequence>

            

            <sequence name="proxy-out">

                        <send/>

    </sequence>

            

            <proxy name="StockQuoteProxy">

        <target inSequence="frontal-in" outSequence="frontal-out"/>

        <publishWSDL
uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>

    </proxy>

            

            <proxy name="StockQuoteProxy2">

        <target inSequence="proxy-in" outSequence="proxy-out"/>

        <publishWSDL
uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>

    </proxy>

</definitions>

 

I tried to put the application-context.xml either in my jar file and in the
conf directory.

 

I've always got the same error in the synapse console :

[HttpServerWorker-3] ERROR Util - Cannot convert object to a StreamSource

 

Thanks in advance for your help,

Regards,

Jeremy

Reply via email to