Hi Suhan, Dilan, SOAP request of example 3 in the documentation [1] <https://docs.wso2.com/display/ESB481/XSLT+Mediator#XSLTMediator-Example3-AddingXSLTimportsasresources> (which Suhan followed) is out of order. Since this request contains nothing in its header, it can be removed. So it has to be like this
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/ "> <soapenv:Body> <people> <person> <firstname>Isuru</firstname> <lastname>Udana</lastname> <gender>Male</gender> <age>26</age> <country>SriLanka</country> </person> <person> <firstname>Ishan</firstname> <lastname>Jayawardena</lastname> <gender>Male</gender> <age>26</age> <country>SriLanka</country> </person> </people> </soapenv:Body> </soapenv:Envelope> [1] https://docs.wso2.com/display/ESB481/XSLT+Mediator#XSLTMediator-Example3-AddingXSLTimportsasresources On Tue, Mar 10, 2015 at 11:59 AM, Dilan Udara Ariyaratne <[email protected]> wrote: > Hi Suhan, > > It seems that your SOAP message is out of order. Message body should > basically come outside the header element as follows. > > > > > > > *<soapenv:Envelope <soapenv:Header> </soapenv:Header> <soapenv:Body> > </soapenv:Body></soapenv:Envelope>* > > Can you double check and verify? > > Regards, > Dilan. > > > > *Dilan U. Ariyaratne* > Software Engineer > WSO2 Inc. <http://wso2.com/> > Mobile: +94775149066 > lean . enterprise . middleware > > On Tue, Mar 10, 2015 at 11:52 AM, Dilan Udara Ariyaratne <[email protected]> > wrote: > >> Hi Suhan, >> >> Can you check the same flow with having the SOAP Message in following >> order? >> >> <soapenv:Envelope >> <soapenv:Header> >> </soapenv:Header> >> <soapenv:Body> >> </soapenv:Body> >> </soapenv:Envelope> >> >> >> >> >> >> *Dilan U. Ariyaratne* >> Software Engineer >> WSO2 Inc. <http://wso2.com/> >> Mobile: +94775149066 >> lean . enterprise . middleware >> >> On Tue, Mar 10, 2015 at 10:09 AM, Suhan Dharmasuriya <[email protected]> >> wrote: >> >>> Hi, >>> >>> I'm following the documentation [1] with WSO2 ESB 4.8.0. >>> I have enabled the wire logs and response attached herewith [2]. >>> >>> My XSLT files are as follows. >>> I have uploaded them to /_system/config registry (conf:/). >>> >>> *xslt1.xslt* >>> >>> <xsl:stylesheet version="1.0" xmlns:xsl=" >>> http://www.w3.org/1999/XSL/Transform"> >>> <xsl:template match="//people/person" name="FILL_PPL"> >>> <client> >>> <firstname> >>> <xsl:value-of select="firstname"> >>> </xsl:value-of></firstname> >>> <lastname> >>> <xsl:value-of select="lastname"> >>> </xsl:value-of></lastname> >>> <age> >>> <xsl:value-of select="age"> >>> </xsl:value-of></age> >>> <country> >>> <xsl:value-of select="country"> >>> </xsl:value-of></country> >>> </client> >>> </xsl:template> >>> </xsl:stylesheet> >>> >>> *xslt2.xslt* >>> >>> <xsl:stylesheet version="1.0" xmlns:xsl=" >>> http://www.w3.org/1999/XSL/Transform"> >>> <xsl:include href="xslt1.xslt"> >>> <xsl:template match="/"> >>> <clients> >>> <xsl:for-each select="//people/person"> >>> <xsl:call-template name="FILL_PPL"> >>> </xsl:call-template></xsl:for-each> >>> </clients> >>> </xsl:template> >>> </xsl:include></xsl:stylesheet> >>> >>> *XSLIncludeTestProxy* *proxy* configuration is as follows. >>> >>> <?xml version="1.0" encoding="UTF-8"?> >>> <proxy xmlns="http://ws.apache.org/ns/synapse" >>> name="XSLIncludeTestProxy" >>> transports="https,http" >>> statistics="disable" >>> trace="disable" >>> startOnLoad="true"> >>> <target> >>> <inSequence> >>> <xslt key="conf:/xslt2.xslt"> >>> <resource location="xslt1.xslt" key="conf:/xslt1.xslt"/> >>> </xslt> >>> <property name="RESPONSE" value="true"/> >>> </inSequence> >>> </target> >>> <description/> >>> </proxy> >>> >>> *SOAP request* sending to proxy service is as follows. >>> >>> <soapenv:Envelope xmlns:soapenv=" >>> http://schemas.xmlsoap.org/soap/envelope/"> >>> <soapenv:Header> >>> <soapenv:Body> >>> <people> >>> <person> >>> <firstname>Isuru</firstname> >>> <lastname>Udana</lastname> >>> <gender>Male</gender> >>> <age>26</age> >>> <country>SriLanka</country> >>> </person> >>> <person> >>> <firstname>Ishan</firstname> >>> <lastname>Jayawardena</lastname> >>> <gender>Male</gender> >>> <age>26</age> >>> <country>SriLanka</country> >>> </person> >>> </people> >>> </soapenv:Body> >>> </soapenv:Header></soapenv:Envelope> >>> >>> I'm getting the following NullPointerException [2]. >>> And after some time connection timeout occurs [3]. >>> >>> Am I missing any required configurations? >>> >>> [1] >>> https://docs.wso2.com/display/ESB481/XSLT+Mediator#XSLTMediator-Example3-AddingXSLTimportsasresources >>> [2] >>> [2015-03-10 10:00:41,452] DEBUG - wire >> "POST >>> /services/XSLIncludeTestProxy.XSLIncludeTestProxyHttpSoap11Endpoint >>> HTTP/1.1[\r][\n]" >>> [2015-03-10 10:00:41,453] DEBUG - wire >> "Accept-Encoding: >>> gzip,deflate[\r][\n]" >>> [2015-03-10 10:00:41,454] DEBUG - wire >> "Content-Type: >>> text/xml;charset=UTF-8[\r][\n]" >>> [2015-03-10 10:00:41,454] DEBUG - wire >> "SOAPAction: >>> "urn:mediate"[\r][\n]" >>> [2015-03-10 10:00:41,454] DEBUG - wire >> "Content-Length: 720[\r][\n]" >>> [2015-03-10 10:00:41,454] DEBUG - wire >> "Host: >>> Suhans-MacBook-Pro.local:8280[\r][\n]" >>> [2015-03-10 10:00:41,454] DEBUG - wire >> "Connection: >>> Keep-Alive[\r][\n]" >>> [2015-03-10 10:00:41,454] DEBUG - wire >> "User-Agent: >>> Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]" >>> [2015-03-10 10:00:41,454] DEBUG - wire >> "[\r][\n]" >>> [2015-03-10 10:00:41,454] DEBUG - wire >> "<soapenv:Envelope >>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> [\n]" >>> [2015-03-10 10:00:41,455] DEBUG - wire >> " <soapenv:Header> [\n]" >>> [2015-03-10 10:00:41,455] DEBUG - wire >> " <soapenv:Body> [\n]" >>> [2015-03-10 10:00:41,455] DEBUG - wire >> " <people> [\n]" >>> [2015-03-10 10:00:41,455] DEBUG - wire >> " <person> [\n]" >>> [2015-03-10 10:00:41,455] DEBUG - wire >> " >>> <firstname>Isuru</firstname> [\n]" >>> [2015-03-10 10:00:41,456] DEBUG - wire >> " >>> <lastname>Udana</lastname> [\n]" >>> [2015-03-10 10:00:41,456] DEBUG - wire >> " >>> <gender>Male</gender> [\n]" >>> [2015-03-10 10:00:41,456] DEBUG - wire >> " <age>26</age> >>> [\n]" >>> [2015-03-10 10:00:41,456] DEBUG - wire >> " >>> <country>SriLanka</country> [\n]" >>> [2015-03-10 10:00:41,457] DEBUG - wire >> " </person> [\n]" >>> [2015-03-10 10:00:41,457] DEBUG - wire >> " <person> [\n]" >>> [2015-03-10 10:00:41,457] DEBUG - wire >> " >>> <firstname>Ishan</firstname> [\n]" >>> [2015-03-10 10:00:41,457] DEBUG - wire >> " >>> <lastname>Jayawardena</lastname> [\n]" >>> [2015-03-10 10:00:41,457] DEBUG - wire >> " >>> <gender>Male</gender> [\n]" >>> [2015-03-10 10:00:41,457] DEBUG - wire >> " <age>26</age> >>> [\n]" >>> [2015-03-10 10:00:41,458] DEBUG - wire >> " >>> <country>SriLanka</country> [\n]" >>> [2015-03-10 10:00:41,458] DEBUG - wire >> " </person> [\n]" >>> [2015-03-10 10:00:41,458] DEBUG - wire >> " </people> [\n]" >>> [2015-03-10 10:00:41,459] DEBUG - wire >> " </soapenv:Body> [\n]" >>> [2015-03-10 10:00:41,459] DEBUG - wire >> >>> "</soapenv:Header></soapenv:Envelope>" >>> [2015-03-10 10:00:41,540] ERROR - XSLTMediator Unable to perform XSLT >>> transformation using : Value {name ='null', keyValue ='conf:/xslt2.xslt'} >>> against source XPath : s11:Body/child::*[position()=1] | >>> s12:Body/child::*[position()=1] reason : null >>> java.lang.NullPointerException >>> at >>> org.apache.synapse.util.xpath.SourceXPathSupport.selectOMNode(SourceXPathSupport.java:87) >>> at >>> org.apache.synapse.mediators.transform.XSLTMediator.performXSLT(XSLTMediator.java:211) >>> at >>> org.apache.synapse.mediators.transform.XSLTMediator.mediate(XSLTMediator.java:191) >>> at >>> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77) >>> at >>> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47) >>> at >>> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131) >>> at >>> org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:166) >>> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) >>> at >>> org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:403) >>> at >>> org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:183) >>> at >>> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) >>> at >>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) >>> at java.lang.Thread.run(Thread.java:745) >>> [2015-03-10 10:00:41,548] ERROR - NativeWorkerPool Uncaught exception >>> java.lang.NullPointerException >>> at >>> org.apache.synapse.transport.passthru.util.PassThroughTransportUtils.determineHttpStatusCode(PassThroughTransportUtils.java:170) >>> at >>> org.apache.synapse.transport.passthru.util.SourceResponseFactory.create(SourceResponseFactory.java:46) >>> at >>> org.apache.synapse.transport.passthru.ServerWorker.sendAck(ServerWorker.java:288) >>> at >>> org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:192) >>> at >>> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) >>> at >>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) >>> at java.lang.Thread.run(Thread.java:745) >>> >>> [3] >>> [2015-03-10 10:01:41,644] WARN - SourceHandler Connection time out >>> after request is read: http-incoming-1 >>> >>> Thanks, >>> Suhan >>> >>> -- >>> Suhan Dharmasuriya >>> Software Engineer - Test Automation >>> >>> *WSO2, Inc. * >>> >>> lean . enterprise . middleware >>> Tel: +94 112 145345 >>> Mob: +94 779 869138 >>> Blog: http://suhan-opensource.blogspot.com/ >>> >>> _______________________________________________ >>> Dev mailing list >>> [email protected] >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Milan Harindu Perera Software Engineer *WSO2, Inc* (+94) 77 309 7088 lean . enterprise . middleware <http://lk.linkedin.com/in/milanharinduperera>
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
