You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Carlos Rodríguez Fernández <ca...@live.com> on 2012/03/22 21:47:33 UTC

Fixing WSDLValidator Tool

Hello everyone,This is Carlos. I'm having some free time and I'm trying to contribute to this project fixing some bugs.Well, the first thing I did was downloading the whole trunk and running some test. I found that the Command Line Tools Validator module does not pass one test related to the detection of the error WSI-BP-1.0 R2726 because the validator detects another error before (R2205).
The problem is because of the inputted wsdl. The fault messages should be defined with an element instead of a type because their style is "document" by default. I fixed that creating another WSDL without that issue and now the test passes and the validator detects the R2726 error successfully. Attached you can find the new wsdl to put in resources dir and below the needed change in the code of the WSDLValidationTest file.
 @Test    public void testWSIBPR2726() throws Exception {        String[] args = new String[] {"-verbose",                                      getLocation("/validator_wsdl/jms_test_R2726.wsdl")};     // <-- the new file.        WSDLValidator.main(args);        assertTrue(getStdErr().indexOf("WSI-BP-1.0 R2726") > -1);    }
Do you want me guys to open an issue for this and attach a patch?
By the way, a minor spelling mistake in the Architecture Guide "can used" -> "can be used"?? :).
Regards,C. 		 	   		  

RE: Fixing WSDLValidator Tool

Posted by Carlos Rodríguez Fernández <ca...@live.com>.
Hello,I see that the list does not admit attachment. Here is then the new wsdl as a text (sorry for double message presenting the issue):
<?xml version="1.0" encoding="UTF-8"?><!--  Licensed to the Apache Software Foundation (ASF) under one  or more contributor license agreements. See the NOTICE file  distributed with this work for additional information  regarding copyright ownership. The ASF licenses this file  to you under the Apache License, Version 2.0 (the  "License"); you may not use this file except in compliance  with the License. You may obtain a copy of the License at   http://www.apache.org/licenses/LICENSE-2.0   Unless required by applicable law or agreed to in writing,  software distributed under the License is distributed on an  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY  KIND, either express or implied. See the License for the  specific language governing permissions and limitations  under the License.--><definitions name="HelloWorldService"     targetNamespace="http://cxf.apache.org/hello_world_jms"     xmlns="http://schemas.xmlsoap.org/wsdl/"     xmlns:jms="http://cxf.apache.org/transports/jms"     xmlns:x1="http://cxf.apache.org/hello_world_jms/types"    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"     xmlns:tns="http://cxf.apache.org/hello_world_jms"     xmlns:xsd="http://www.w3.org/2001/XMLSchema">    <types>        <schema targetNamespace="http://cxf.apache.org/hello_world_jms/types"      		xmlns="http://www.w3.org/2001/XMLSchema" 		xmlns:x1="http://cxf.apache.org/hello_world_jms/types" 		elementFormDefault="qualified">            <complexType name="ErrorCode">                 <sequence>                    <element name="minor" type="short"/>                    <element name="major" type="short"/>                </sequence>            </complexType>                <complexType name="testRpcLitFault">                    <sequence>                        <element name="faultType" type="string"/>                    </sequence>                </complexType>                <complexType name="testRpcLitFaultResponse">                    <sequence/>                </complexType>
                <complexType name="NoSuchCodeLit">                    <sequence>                        <element name="code" type="x1:ErrorCode"/>                    </sequence>                </complexType>            <complexType name="BadRecord">                <sequence>                    <element name="reason" type="string"/>                    <element name="code" type="short"/>                </sequence>            </complexType>           <element name="noSuchCodeLit" type="x1:NoSuchCodeLit"/>           <element name="badRecordLit" type="x1:BadRecord"/>        </schema>    </types>
    <message name="greetMe">        <part name="stringParam0" type="xsd:string"/>    </message>    <message name="greetMeResponse">        <part name="return" type="xsd:string"/>    </message>    <message name="sayHi"/>    <message name="sayHiResponse">        <part name="return" type="xsd:string"/>    </message>    <message name="greetMeOneWay">        <part name="stringParam0" type="xsd:string"/>    </message>        <message name="testRpcLitFaultRequest">        <part name="in" type="xsd:string"/>    </message>    <message name="testRpcLitFaultResponse">        <part name="out" type="x1:testRpcLitFaultResponse"/>    </message>    <message name="NoSuchCodeLitFault">        <part name="NoSuchCodeLit" element="x1:noSuchCodeLit"/>    </message>    <message name="BadRecordLitFault">        <part name="BadRecordLit" element="x1:badRecordLit"/>    </message>        <portType name="HelloWorldPortType">        <operation name="greetMe">            <input message="tns:greetMe" name="greetMe"/>            <output message="tns:greetMeResponse" name="greetMeResponse"/>        </operation>        <operation name="sayHi">            <input message="tns:sayHi" name="sayHi"/>            <output message="tns:sayHiResponse" name="sayHiResponse"/>        </operation>        <operation name="greetMeOneWay">            <input message="tns:greetMeOneWay" name="greetMeOneWay"/>        </operation>        <operation name="testRpcLitFault">            <input name="testRpcLitFaultRequest" message="tns:testRpcLitFaultRequest"/>            <output name="testRpcLitFaultResponse" message="tns:testRpcLitFaultResponse"/>            <fault name="NoSuchCodeLitFault" message="tns:NoSuchCodeLitFault"/>            <fault name="BadRecordLitFault" message="tns:BadRecordLitFault"/>        </operation>    </portType>
    <binding name="HelloWorldPortBinding" type="tns:HelloWorldPortType">        <soap:binding style="rpc" transport="http://cxf.apache.org/transports/jms"/>        <operation name="greetMe">            <soap:operation soapAction="" style="rpc"/>            <input name="greetMe">                <soap:body                     namespace="http://cxf.apache.org/hello_world_jms" use="literal"/>            </input>            <output name="greetMeResponse">                <soap:body                      namespace="http://cxf.apache.org/hello_world_jms" use="literal"/>            </output>        </operation>        <operation name="sayHi">            <soap:operation soapAction="" style="rpc"/>            <input name="sayHi">                <soap:body                     namespace="http://cxf.apache.org/hello_world_jms" use="literal"/>            </input>            <output name="sayHiResponse">                <soap:body                     namespace="http://cxf.apache.org/hello_world_jms" use="literal"/>            </output>        </operation>        <operation name="greetMeOneWay">            <soap:operation style="rpc"/>            <input name="greetMeOneWay">                <soap:body                     namespace="http://cxf.apache.org/hello_world_jms" use="literal"/>            </input>        </operation>
         <operation name="testRpcLitFault">            <soap:operation style="rpc"/>            <input>                <soap:body namespace="http://cxf.apache.org/hello_world_jms"  use="literal"/>            </input>            <output>                <soap:body namespace="http://cxf.apache.org/hello_world_jms"  use="literal"/>            </output>            <fault name="NoSuchCodeLitFault">                <soap:fault name="NoSuchCodeLitFault" namespace="http://cxf.apache.org/hello_world_jms" use="literal"/>            </fault>            <fault name="BadRecordLitFault">                <soap:fault name="BadRecordLitFault" namespace="http://cxf.apache.org/hello_world_jms" use="literal"/>            </fault>        </operation>    </binding>
    <service name="HelloWorldService">           <port binding="tns:HelloWorldPortBinding" name="HelloWorldPort">               <jms:address                   jndiConnectionFactoryName="ConnectionFactory"                    jndiDestinationName="dynamicQueues/test.jmstransport.text">                   <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>                   <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61500"/>               </jms:address>                           <jms:server durableSubscriberName="CXF_subscriber"/>           </port>    </service></definitions>


From: carlosrodrifernandez@live.com
To: dev@cxf.apache.org
Subject: Fixing WSDLValidator Tool
Date: Thu, 22 Mar 2012 13:47:33 -0700







Hello everyone,This is Carlos. I'm having some free time and I'm trying to contribute to this project fixing some bugs.Well, the first thing I did was downloading the whole trunk and running some test. I found that the Command Line Tools Validator module does not pass one test related to the detection of the error WSI-BP-1.0 R2726 because the validator detects another error before (R2205).
The problem is because of the inputted wsdl. The fault messages should be defined with an element instead of a type because their style is "document" by default. I fixed that creating another WSDL without that issue and now the test passes and the validator detects the R2726 error successfully. Attached you can find the new wsdl to put in resources dir and below the needed change in the code of the WSDLValidationTest file.
 @Test    public void testWSIBPR2726() throws Exception {        String[] args = new String[] {"-verbose",                                      getLocation("/validator_wsdl/jms_test_R2726.wsdl")};     // <-- the new file.        WSDLValidator.main(args);        assertTrue(getStdErr().indexOf("WSI-BP-1.0 R2726") > -1);    }
Do you want me guys to open an issue for this and attach a patch?
By the way, a minor spelling mistake in the Architecture Guide "can used" -> "can be used"?? :).
Regards,C. 		 	   		   		 	   		  

Re: Fixing WSDLValidator Tool

Posted by Daniel Kulp <dk...@apache.org>.
Please file an issue and attach a patch with the "grant to apache" box 
checked.   That's the best path to take.

Major thanks for looking into it!

Dan


On Thursday, March 22, 2012 01:47:33 PM Carlos Rodríguez Fernández wrote:
> Hello everyone,This is Carlos. I'm having some free time and I'm trying to
> contribute to this project fixing some bugs.Well, the first thing I did
> was downloading the whole trunk and running some test. I found that the
> Command Line Tools Validator module does not pass one test related to the
> detection of the error WSI-BP-1.0 R2726 because the validator detects
> another error before (R2205). The problem is because of the inputted
> wsdl. The fault messages should be defined with an element instead of a
> type because their style is "document" by default. I fixed that creating
> another WSDL without that issue and now the test passes and the validator
> detects the R2726 error successfully. Attached you can find the new wsdl
> to put in resources dir and below the needed change in the code of the
> WSDLValidationTest file. @Test    public void testWSIBPR2726() throws
> Exception {        String[] args = new String[] {"-verbose",             
>                        
> getLocation("/validator_wsdl/jms_test_R2726.wsdl")};     // <-- the new
> file.        WSDLValidator.main(args);       
> assertTrue(getStdErr().indexOf("WSI-BP-1.0 R2726") > -1);    } Do you
> want me guys to open an issue for this and attach a patch? By the way, a
> minor spelling mistake in the Architecture Guide "can used" -> "can be
> used"?? :). Regards,C.
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com