[ 
https://issues.apache.org/jira/browse/SYNAPSE-905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13461378#comment-13461378
 ] 

Hudson commented on SYNAPSE-905:
--------------------------------

Integrated in Synapse - Trunk #4449 (See 
[https://builds.apache.org/job/Synapse%20-%20Trunk/4449/])
    SYNAPSE-905: Changed the stock quote sample service so that it uses a 
single namespace again. Also fixed the samples to be compatible with the 
changed service and to produce messages that conform to the schema. This change 
corresponds to solution (2) in the issue description. (Revision 1389008)

     Result = FAILURE
veithen : 
Files : 
* /synapse/trunk/java
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/quick_start.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample101.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample152.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample156.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample157.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample252.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample256.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample300.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample352.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample361.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample362.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample363.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample364.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample380.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample390.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample410.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample851.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample852.xml
* 
/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample853.xml
* 
/synapse/trunk/java/modules/samples/services/JAXWSStockQuoteService/src/samples/services/GetQuoteResponse.java
* 
/synapse/trunk/java/modules/samples/services/JAXWSStockQuoteService/src/samples/services/GetQuoteResponseWrapper.java
* 
/synapse/trunk/java/modules/samples/services/JAXWSStockQuoteService/src/samples/services/GetQuoteWrapper.java
* 
/synapse/trunk/java/modules/samples/services/JAXWSStockQuoteService/src/samples/services/PlaceOrder.java
* 
/synapse/trunk/java/modules/samples/services/JAXWSStockQuoteService/src/samples/services/PlaceOrderWrapper.java
* 
/synapse/trunk/java/modules/samples/services/JAXWSStockQuoteService/src/samples/services/StockQuoteService.java
* 
/synapse/trunk/java/modules/samples/services/JAXWSStockQuoteService/src/samples/services/package-info.java
* 
/synapse/trunk/java/modules/samples/services/JAXWSStockQuoteService/src/samples/services/wrapper
* 
/synapse/trunk/java/modules/samples/services/ReliableStockQuoteService/conf/services.xml
* 
/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/conf/services.xml
* 
/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/conf/services.xml
* 
/synapse/trunk/java/modules/samples/src/main/java/samples/common/StockQuoteHandler.java
* 
/synapse/trunk/java/modules/samples/src/main/java/samples/mediators/DiscountQuoteMediator.java
* /synapse/trunk/java/repository/conf/sample/resources/proxy/sample_proxy_1.wsdl
* 
/synapse/trunk/java/repository/conf/sample/resources/transform/transform_back.xslt
* 
/synapse/trunk/java/repository/conf/sample/resources/xquery/xquery_commisson.xq
* /synapse/trunk/java/repository/conf/sample/synapse_sample_15.xml
* /synapse/trunk/java/repository/conf/sample/synapse_sample_156.xml
* /synapse/trunk/java/repository/conf/sample/synapse_sample_17.xml
* /synapse/trunk/java/repository/conf/sample/synapse_sample_252.xml
* /synapse/trunk/java/repository/conf/sample/synapse_sample_300.xml
* /synapse/trunk/java/repository/conf/sample/synapse_sample_352.xml
* /synapse/trunk/java/repository/conf/sample/synapse_sample_361.xml
* /synapse/trunk/java/repository/conf/sample/synapse_sample_362.xml
* /synapse/trunk/java/repository/conf/sample/synapse_sample_363.xml
* /synapse/trunk/java/repository/conf/sample/synapse_sample_364.xml
* /synapse/trunk/java/repository/conf/sample/synapse_sample_390.xml
* /synapse/trunk/java/repository/conf/sample/synapse_sample_410.xml
* /synapse/trunk/java/repository/conf/sample/synapse_sample_851.xml
* /synapse/trunk/java/repository/conf/sample/synapse_sample_852.xml
* /synapse/trunk/java/repository/conf/sample/synapse_sample_853.xml

                
> Namespace mismatch in samples that use SimpleStockQuoteService
> --------------------------------------------------------------
>
>                 Key: SYNAPSE-905
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-905
>             Project: Synapse
>          Issue Type: Bug
>          Components: Documentation
>            Reporter: Andreas Veithen
>            Priority: Minor
>
> According to the WSDL generated by Axis2, SimpleStockQuoteService uses two 
> namespaces (i.e. wsdl:types contains two xs:schema elements): 
> http://services.samples and http://services.samples/xsd. Responses from 
> SimpleStockQuoteService use these two namespaces as expected. Unfortunately 
> SimpleStockQuoteService is a POJO service and for this type of services, 
> Axis2 doesn't check the namespaces used in request messages.
> There are multiple samples that send messages to SimpleStockQuoteService that 
> don't conform to the WSDL. E.g. sample 158 sends the following SOAP request: 
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";> 
>   <soapenv:Body> 
>     <ns0:getQuote xmlns:ns0="http://services.samples";> 
>       <ns1:request xmlns:ns1="http://services.samples";> 
>         <ns2:symbol xmlns:ns2="http://services.samples";>IBM</ns2:symbol> 
>       </ns1:request> 
>     </ns0:getQuote> 
>   </soapenv:Body> 
> </soapenv:Envelope> 
> This message doesn't conform to the WSDL of SimpleStockQuoteService because 
> the "symbol" element is expected to be in the http://services.samples/xsd 
> namespace, not in http://services.samples.
> Even the code of the test client (see the StockQuoteHandler class) uses the 
> wrong namespaces, as shown in the following piece of code:
>     /**
>      * Create a new quote request with a body as follows
>      *  <m:GetQuote xmlns:m="http://services.samples";>
>      *      <m:request>
>      *          <m:symbol>IBM</m:symbol>
>      *      </m:request>
>      *  </m:GetQuote>
>      * @param symbol the stock symbol
>      * @return OMElement for SOAP body
>      */
>     public static OMElement createStandardQuoteRequest(String symbol, int 
> itrCount) {
>         OMFactory factory   = OMAbstractFactory.getOMFactory();
>         OMNamespace ns      = 
> factory.createOMNamespace("http://services.samples";, "m0");
>         OMElement getQuote  = factory.createOMElement("getQuote", ns);
>         for (int i =0; i<itrCount; i++) {
>             OMElement request   = factory.createOMElement("request", ns);
>             OMElement symb      = factory.createOMElement("symbol", ns);
>             request.addChild(symb);
>             getQuote.addChild(request);
>             symb.setText(symbol);
>         }
>         return getQuote;
>     }
> Sample 15 is also interesting:
>         <in>
>             <enrich>
>                 <source type="custom"
>                         xpath="//m0:getQuote/m0:request/m0:symbol/text()"
>                         xmlns:m0="http://services.samples"/>
>                 ...
>             </enrich>
>             ...
>         </in>
>         <out>
>             ...
>             <enrich>
>                 <source type="custom"
>                         
> xpath="//ns:getQuoteResponse/ns:return/ax21:lastTradeTimestamp"
>                         xmlns:ns="http://services.samples";
>                         xmlns:ax21="http://services.samples/xsd"/>
>                 ...
>             </enrich>
>             …
>         </out>
> One can see that the sample uses incorrect namespaces to extract data from 
> the request message (because the test client uses the wrong namespace for the 
> "symbol" element), but uses the correct ones to extract data from the 
> response message (because the response is produced by Axis2 and conforms to 
> the WSDL).
> Although these namespace mismatches don't trigger any errors when executing 
> the samples (because as noted above, Axis2 doesn't check namespaces for POJO 
> services), we still need to fix them:
> * Obviously, distributing samples that use messages not conforming to the 
> WSDL of the target service doesn't give a good impression to end users.
> * There is a permanent risk that correcting the namespaces at one place will 
> breaks things in other places.
> The root cause of the issue seems to be that between Axis2 1.4 and 1.5, the 
> default conventions for namespaces used by POJO services have changed. In 
> fact, in Synapse 1.2, the WSDL for SimpleStockQuoteService still used a 
> single namespace (although that was http://services.samples/xsd and not 
> http://services.samples).
> There are two solutions for this issue:
> (1) Leave the SimpleStockQuoteService as is and change the samples. Since 
> most of the samples were originally written for the old conventions, this 
> will require significant work. In addition, it will not be easy to identify 
> the samples that need to be fixed.
> (2) Change the configuration of SimpleStockQuoteService so that it uses a 
> single namespace again by adding the following to the services.xml file:
>     <schema>
>         <mapping package="samples.services" 
> namespace="http://services.samples"/>
>     </schema>
> This makes it significantly easier to fix the samples (it is easier to go 
> from two namespaces to one namespace than the other way round). It will also 
> be easy to identify the samples that need to be fixed, simply by looking for 
> occurrences of http://services.samples/xsd.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to