XSLT transformation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

XSLT transformation

Walser Benoit

Hi, I was wondering if you could give me some help for a XSLT transformation by using a transformer proxy.

I’ve a SOAP flow in input which I would like transform in standard XML to interface to my CRM solution :

INPUT FLOW :

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

       xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">

       <SOAP-ENV:Body>

             <root>

                    <user>machin</user>

                    <password>machin</password>

             </root>

       </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

 

OUTPUT FLOW:

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

- <<novae-user xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">

  < <user>machin</user>

  < <password>machin</password>

 </novae-user>

 

 

 

So, I use a the WSO2 ESB solution with the proxy service: “Custom Proxy”.

I create a sequence :

 

<sequence xmlns="http://ws.apache.org/ns/synapse" name="MySeqTest" trace="disable">

   <in>

      <xslt key="<a href="conf://users/MyXSLTTest">conf:/users/MyXSLTTest" />

      <send />

   </in>

   <out />

</sequence>

 

Where MyXSLTTest is like :

 

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" version="1.0">

  <xsl:output method="xml" media-type="text/xml"></xsl:output>

  <xsl:template match="/">

    <novae-user>

      <user>

       

      <xsl:value-of select="ns1:Envelope/ns1:Body/root/user"></xsl:value-of></user>

      <password>

       

      <xsl:value-of select="ns1:Envelope/ns1:Body/root/password"></xsl:value-of></password>

    </novae-user>

  </xsl:template>

</xsl:stylesheet>

 

I configure my custom proxy :

 

Step 1 : basic settings

-I named it transformtest

-I selected only http

Step 2:

-I used a existing sequence named myseqtest

-I defined a endpoint which is a j2ee application that logs all access to the url

Step 3:

-I leaved all information by default.

 

So I’ve this configuration :

 

<proxy xmlns="http://ws.apache.org/ns/synapse" name="TransformTest" transports="http" statistics="disable" trace="disable" startOnLoad="true">

   <target inSequence="MySeqTest">

      <outSequence>

         <send />

      </outSequence>

      <endpoint>

         <address uri="http://localhost:8080/EchoApplication/echoServlet?" />

      </endpoint>

   </target>

</proxy>                           

 

Next, after to save all configuration , iwanted to test if the proxy works but I fall into the same error  in the SOAP GUI software or the Test service provided by wso2 :

 

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

                xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">

                <SOAP-ENV:Body>

                               <root>

                                               <user>machin</user>

                                               <password>machin</password>

                               </root>

                </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

I’ve this reponse :

 

<TryitClient xmlns="http://tryit.carbon.wso2.org">

   <Reason>Error connecting to the Tryit ajax proxy</Reason>

</TryitClient>

 

Or in log :

 

[2012-02-20 16:57:01,550] ERROR - Axis2Sender Unexpected error during sending message out

org.apache.axis2.AxisFault: The system cannot infer the transport information from the /services/TransformTest.TransformTestHttpSoap11Endpoint URL.

        at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81)

        at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:123)

        at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

        at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:441)

        at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:57)

        at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:281)

        at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:84)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)

        at org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:55)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)

        at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)

        at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:144)

        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)

        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)

        at org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:409)

        at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:261)

        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:173)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

        at java.lang.Thread.run(Thread.java:662)

 

Could you give me some help for this proxy ??? Thanks you

 

Description : sign_benoit

 


_______________________________________________
Esb-java-user mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/esb-java-user
Reply | Threaded
Open this post in threaded view
|

Re: XSLT transformation

Vijayaratha Vijayasingam-2
Hi,
What is the service endpoint you are invoking? Check like this;(using soapui, send request to the following proxy url)
http://localhost:8280/services/TransformTest

-Ratha

On 20 February 2012 21:32, Walser Benoit <[hidden email]> wrote:

Hi, I was wondering if you could give me some help for a XSLT transformation by using a transformer proxy.

I’ve a SOAP flow in input which I would like transform in standard XML to interface to my CRM solution :

INPUT FLOW :

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

       xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">

       <SOAP-ENV:Body>

             <root>

                    <user>machin</user>

                    <password>machin</password>

             </root>

       </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

 

OUTPUT FLOW:

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

- <<novae-user xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">

  < <user>machin</user>

  < <password>machin</password>

 </novae-user>

 

 

 

So, I use a the WSO2 ESB solution with the proxy service: “Custom Proxy”.

I create a sequence :

 

<sequence xmlns="http://ws.apache.org/ns/synapse" name="MySeqTest" trace="disable">

   <in>

      <xslt key="conf:/users/MyXSLTTest" />

      <send />

   </in>

   <out />

</sequence>

 

Where MyXSLTTest is like :

 

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" version="1.0">

  <xsl:output method="xml" media-type="text/xml"></xsl:output>

  <xsl:template match="/">

    <novae-user>

      <user>

       

      <xsl:value-of select="ns1:Envelope/ns1:Body/root/user"></xsl:value-of></user>

      <password>

       

      <xsl:value-of select="ns1:Envelope/ns1:Body/root/password"></xsl:value-of></password>

    </novae-user>

  </xsl:template>

</xsl:stylesheet>

 

I configure my custom proxy :

 

Step 1 : basic settings

-I named it transformtest

-I selected only http

Step 2:

-I used a existing sequence named myseqtest

-I defined a endpoint which is a j2ee application that logs all access to the url

Step 3:

-I leaved all information by default.

 

So I’ve this configuration :

 

<proxy xmlns="http://ws.apache.org/ns/synapse" name="TransformTest" transports="http" statistics="disable" trace="disable" startOnLoad="true">

   <target inSequence="MySeqTest">

      <outSequence>

         <send />

      </outSequence>

      <endpoint>

         <address uri="http://localhost:8080/EchoApplication/echoServlet?" />

      </endpoint>

   </target>

</proxy>                           

 

Next, after to save all configuration , iwanted to test if the proxy works but I fall into the same error  in the SOAP GUI software or the Test service provided by wso2 :

 

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

                xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">

                <SOAP-ENV:Body>

                               <root>

                                               <user>machin</user>

                                               <password>machin</password>

                               </root>

                </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

I’ve this reponse :

 

<TryitClient xmlns="http://tryit.carbon.wso2.org">

   <Reason>Error connecting to the Tryit ajax proxy</Reason>

</TryitClient>

 

Or in log :

 

[2012-02-20 16:57:01,550] ERROR - Axis2Sender Unexpected error during sending message out

org.apache.axis2.AxisFault: The system cannot infer the transport information from the /services/TransformTest.TransformTestHttpSoap11Endpoint URL.

        at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81)

        at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:123)

        at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

        at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:441)

        at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:57)

        at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:281)

        at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:84)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)

        at org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:55)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)

        at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)

        at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:144)

        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)

        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)

        at org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:409)

        at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:261)

        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:173)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

        at java.lang.Thread.run(Thread.java:662)

 

Could you give me some help for this proxy ??? Thanks you

 

Description : sign_benoit

 


_______________________________________________
Esb-java-user mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/esb-java-user



_______________________________________________
Esb-java-user mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/esb-java-user
Reply | Threaded
Open this post in threaded view
|

Re: XSLT transformation

Walser Benoit

I made many test in soap ui , in input, I’ve tried this test :

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

   <soapenv:Body>

                               <root>

                                               <user>machin</user>

                                               <password>machin</password>

                               </root>

</soapenv:Body>

</soapenv:Envelope>

 

Or this test :

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

   <soapenv:Body>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

                xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">

                <SOAP-ENV:Body>

                               <root>

                                               <user>machin</user>

                                               <password>machin</password>

                               </root>

                </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

</soapenv:Body>

</soapenv:Envelope>

 

 

In each time I’ve this response  on the log :

 

org.apache.axis2.AxisFault: The system cannot infer the transport information from the /services/TransformTest.TransformTestHttpSoap11Endpoint URL.

        at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81)

        at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:123)

        at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

        at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:441)

        at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:57)

        at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:281)

        at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:84)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)

        at org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:55)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)

        at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)

        at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:144)

        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)

        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)

        at org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:409)

        at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:261)

        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:173)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

        at java.lang.Thread.run(Thread.java:662)

 

 

Could you test in your side , with my test … it’s a easy short test.

 

Description : sign_benoit

 

De : [hidden email] [mailto:[hidden email]] De la part de Vijayaratha Vijayasingam
Envoyé : lundi 20 février 2012 17:44
À : [hidden email]
Objet : Re: [esb-java-user] XSLT transformation

 

Hi,
What is the service endpoint you are invoking? Check like this;(using soapui, send request to the following proxy url)
http://localhost:8280/services/TransformTest

-Ratha

On 20 February 2012 21:32, Walser Benoit <[hidden email]> wrote:

Hi, I was wondering if you could give me some help for a XSLT transformation by using a transformer proxy.

I’ve a SOAP flow in input which I would like transform in standard XML to interface to my CRM solution :

INPUT FLOW :

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

       xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">

       <SOAP-ENV:Body>

             <root>

                    <user>machin</user>

                    <password>machin</password>

             </root>

       </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

 

OUTPUT FLOW:

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

- <<novae-user xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">

  < <user>machin</user>

  < <password>machin</password>

 </novae-user>

 

 

 

So, I use a the WSO2 ESB solution with the proxy service: “Custom Proxy”.

I create a sequence :

 

<sequence xmlns="http://ws.apache.org/ns/synapse" name="MySeqTest" trace="disable">

   <in>

      <xslt key="<a href="conf://users/MyXSLTTest">conf:/users/MyXSLTTest" />

      <send />

   </in>

   <out />

</sequence>

 

Where MyXSLTTest is like :

 

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" version="1.0">

  <xsl:output method="xml" media-type="text/xml"></xsl:output>

  <xsl:template match="/">

    <novae-user>

      <user>

       

      <xsl:value-of select="ns1:Envelope/ns1:Body/root/user"></xsl:value-of></user>

      <password>

       

      <xsl:value-of select="ns1:Envelope/ns1:Body/root/password"></xsl:value-of></password>

    </novae-user>

  </xsl:template>

</xsl:stylesheet>

 

I configure my custom proxy :

 

Step 1 : basic settings

-I named it transformtest

-I selected only http

Step 2:

-I used a existing sequence named myseqtest

-I defined a endpoint which is a j2ee application that logs all access to the url

Step 3:

-I leaved all information by default.

 

So I’ve this configuration :

 

<proxy xmlns="http://ws.apache.org/ns/synapse" name="TransformTest" transports="http" statistics="disable" trace="disable" startOnLoad="true">

   <target inSequence="MySeqTest">

      <outSequence>

         <send />

      </outSequence>

      <endpoint>

         <address uri="http://localhost:8080/EchoApplication/echoServlet?" />

      </endpoint>

   </target>

</proxy>                           

 

Next, after to save all configuration , iwanted to test if the proxy works but I fall into the same error  in the SOAP GUI software or the Test service provided by wso2 :

 

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

                xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">

                <SOAP-ENV:Body>

                               <root>

                                               <user>machin</user>

                                               <password>machin</password>

                               </root>

                </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

I’ve this reponse :

 

<TryitClient xmlns="http://tryit.carbon.wso2.org">

   <Reason>Error connecting to the Tryit ajax proxy</Reason>

</TryitClient>

 

Or in log :

 

[2012-02-20 16:57:01,550] ERROR - Axis2Sender Unexpected error during sending message out

org.apache.axis2.AxisFault: The system cannot infer the transport information from the /services/TransformTest.TransformTestHttpSoap11Endpoint URL.

        at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81)

        at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:123)

        at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

        at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:441)

        at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:57)

        at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:281)

        at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:84)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)

        at org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:55)

        at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)

        at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)

        at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:144)

        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)

        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)

        at org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:409)

        at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:261)

        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:173)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

        at java.lang.Thread.run(Thread.java:662)

 

Could you give me some help for this proxy ??? Thanks you

 

Description : sign_benoit

 


_______________________________________________
Esb-java-user mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/esb-java-user

 


_______________________________________________
Esb-java-user mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/esb-java-user