You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Mike Klein <mi...@sbcglobal.net> on 2003/10/26 23:20:16 UTC

Nested classpath element needed for wsdl2java...due to junit test case parameter

Besides the ant tasks missing some key parameters available in the 
commandline version of wsdl2java/java2wsdl (as I mentioned in an earlier 
post)...it appears wsdl2java IS missing support for classpath 
element...unlike java2wsdl which does have this element.

When using wsdl2java ant task and the "testcase=true" attribute 
(generates jUnit test case which needs filling in) it attempts to find 
jUnit on the classpath. Since this cannot be specified using Ant, it 
requires you have it in your OS environment.

Generally it's not a good idea to put anything in your default classpath 
(i.e. jre/lib/ext or classpath env var) as it screws too many things 
up...classpaths s/be set explicitly by the requiring application.

Below is an example of java2wsdl axis ant task which works with nested 
classpath element and wsdl2java task which doesn't:


    <target depends="compile source" description="Generate wsdl" 
name="java2wsdl">
        <!-- The below classname (actually intf) is used by wsdl2java to 
generate <Name>Service, and <Name>ServiceLocator classes.
            It will also regenerate like-named interface, but with each 
method throwing RMIExceptions... -->
        <!-- The service name at the end of the url specifies the 
className prefix for *SoapBinding{Impl|Stub}.java classes that are 
generated -->
        <axis-java2wsdl
                classname="com.vxappliance.quotations.Quotations" 
namespace="urn:QuotationsService"
                
location="http://${tomcat.host}:${tomcat.port}/axis/services/QuotationsService"
                output="${build}/generated/QuotationsService.wsdl" 
bindingname="Quotations" serviceportname="QuotationsService">
            <classpath>
                <pathelement location="${build}/classes"/>
            </classpath>
        </axis-java2wsdl>
    </target>

    <target depends="java2wsdl" description="Generate server/client 
stubs, wsdd" name="wsdl2java">
        <!-- Generate stubs/skeletons and deploy/undeploy wsdd -->
        <axis-wsdl2java debug="true" verbose="true" 
output="${build}/generated" serverside="true" skeletondeploy="true"
                url="${build}/generated/QuotationsService.wsdl" 
testcase="true">
            <mapping namespace="urn:QuotationsService" 
package="com.vxappliance.quotations"/>
        </axis-wsdl2java>
    </target>



Re: Nested classpath element needed for wsdl2java...due to junit test case parameter

Posted by Mike Klein <mi...@sbcglobal.net>.
An ant task for publishing your web service via uddi/juddi/jaxr might be 
nice too...


mike

Mike Klein wrote:

> I'm trying to finish up the uddi/registry portion of my soap 
> tests...hopefully by tomorrow...then I'll pull axis source and look at 
> the ant tasks.
>
> I <should> be able to fix the discrepancies myself in less than a day 
> and check it back in...will get on the dev list to see if this is 
> required/desired, and see if latest src build doesn't have this fix 
> already.
>
>
> mike
>
> Stephen Gordon wrote:
>
>> Mike,
>>
>> I think you should submit this as a bug.
>> Then it won't be forgotten or lost.
>> Make sure to search for similar bugs first though.
>>
>> stephen
>>
>> Mike Klein wrote:
>>
>>> Besides the ant tasks missing some key parameters available in the 
>>> commandline version of wsdl2java/java2wsdl (as I mentioned in an 
>>> earlier post)...it appears wsdl2java IS missing support for 
>>> classpath element...unlike java2wsdl which does have this element.
>>>
>>> When using wsdl2java ant task and the "testcase=true" attribute 
>>> (generates jUnit test case which needs filling in) it attempts to 
>>> find jUnit on the classpath. Since this cannot be specified using 
>>> Ant, it requires you have it in your OS environment.
>>>
>>> Generally it's not a good idea to put anything in your default 
>>> classpath (i.e. jre/lib/ext or classpath env var) as it screws too 
>>> many things up...classpaths s/be set explicitly by the requiring 
>>> application.
>>>
>>> Below is an example of java2wsdl axis ant task which works with 
>>> nested classpath element and wsdl2java task which doesn't:
>>>
>>>
>>>    <target depends="compile source" description="Generate wsdl" 
>>> name="java2wsdl">
>>>        <!-- The below classname (actually intf) is used by wsdl2java 
>>> to generate <Name>Service, and <Name>ServiceLocator classes.
>>>            It will also regenerate like-named interface, but with 
>>> each method throwing RMIExceptions... -->
>>>        <!-- The service name at the end of the url specifies the 
>>> className prefix for *SoapBinding{Impl|Stub}.java classes that are 
>>> generated -->
>>>        <axis-java2wsdl
>>>                classname="com.vxappliance.quotations.Quotations" 
>>> namespace="urn:QuotationsService"
>>>                
>>> location="http://${tomcat.host}:${tomcat.port}/axis/services/QuotationsService" 
>>>
>>>                output="${build}/generated/QuotationsService.wsdl" 
>>> bindingname="Quotations" serviceportname="QuotationsService">
>>>            <classpath>
>>>                <pathelement location="${build}/classes"/>
>>>            </classpath>
>>>        </axis-java2wsdl>
>>>    </target>
>>>
>>>    <target depends="java2wsdl" description="Generate server/client 
>>> stubs, wsdd" name="wsdl2java">
>>>        <!-- Generate stubs/skeletons and deploy/undeploy wsdd -->
>>>        <axis-wsdl2java debug="true" verbose="true" 
>>> output="${build}/generated" serverside="true" skeletondeploy="true"
>>>                url="${build}/generated/QuotationsService.wsdl" 
>>> testcase="true">
>>>            <mapping namespace="urn:QuotationsService" 
>>> package="com.vxappliance.quotations"/>
>>>        </axis-wsdl2java>
>>>    </target>
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>



Re: Nested classpath element needed for wsdl2java...due to junit test case parameter

Posted by Mike Klein <mi...@sbcglobal.net>.
I'm trying to finish up the uddi/registry portion of my soap 
tests...hopefully by tomorrow...then I'll pull axis source and look at 
the ant tasks.

I <should> be able to fix the discrepancies myself in less than a day 
and check it back in...will get on the dev list to see if this is 
required/desired, and see if latest src build doesn't have this fix already.


mike

Stephen Gordon wrote:

> Mike,
>
> I think you should submit this as a bug.
> Then it won't be forgotten or lost.
> Make sure to search for similar bugs first though.
>
> stephen
>
> Mike Klein wrote:
>
>> Besides the ant tasks missing some key parameters available in the 
>> commandline version of wsdl2java/java2wsdl (as I mentioned in an 
>> earlier post)...it appears wsdl2java IS missing support for classpath 
>> element...unlike java2wsdl which does have this element.
>>
>> When using wsdl2java ant task and the "testcase=true" attribute 
>> (generates jUnit test case which needs filling in) it attempts to 
>> find jUnit on the classpath. Since this cannot be specified using 
>> Ant, it requires you have it in your OS environment.
>>
>> Generally it's not a good idea to put anything in your default 
>> classpath (i.e. jre/lib/ext or classpath env var) as it screws too 
>> many things up...classpaths s/be set explicitly by the requiring 
>> application.
>>
>> Below is an example of java2wsdl axis ant task which works with 
>> nested classpath element and wsdl2java task which doesn't:
>>
>>
>>    <target depends="compile source" description="Generate wsdl" 
>> name="java2wsdl">
>>        <!-- The below classname (actually intf) is used by wsdl2java 
>> to generate <Name>Service, and <Name>ServiceLocator classes.
>>            It will also regenerate like-named interface, but with 
>> each method throwing RMIExceptions... -->
>>        <!-- The service name at the end of the url specifies the 
>> className prefix for *SoapBinding{Impl|Stub}.java classes that are 
>> generated -->
>>        <axis-java2wsdl
>>                classname="com.vxappliance.quotations.Quotations" 
>> namespace="urn:QuotationsService"
>>                
>> location="http://${tomcat.host}:${tomcat.port}/axis/services/QuotationsService" 
>>
>>                output="${build}/generated/QuotationsService.wsdl" 
>> bindingname="Quotations" serviceportname="QuotationsService">
>>            <classpath>
>>                <pathelement location="${build}/classes"/>
>>            </classpath>
>>        </axis-java2wsdl>
>>    </target>
>>
>>    <target depends="java2wsdl" description="Generate server/client 
>> stubs, wsdd" name="wsdl2java">
>>        <!-- Generate stubs/skeletons and deploy/undeploy wsdd -->
>>        <axis-wsdl2java debug="true" verbose="true" 
>> output="${build}/generated" serverside="true" skeletondeploy="true"
>>                url="${build}/generated/QuotationsService.wsdl" 
>> testcase="true">
>>            <mapping namespace="urn:QuotationsService" 
>> package="com.vxappliance.quotations"/>
>>        </axis-wsdl2java>
>>    </target>
>>
>>
>>
>>
>
>
>



Re: Nested classpath element needed for wsdl2java...due to junit test case parameter

Posted by Stephen Gordon <st...@student.usyd.edu.au>.
Mike,

I think you should submit this as a bug.
Then it won't be forgotten or lost.
Make sure to search for similar bugs first though.

stephen

Mike Klein wrote:

> Besides the ant tasks missing some key parameters available in the 
> commandline version of wsdl2java/java2wsdl (as I mentioned in an earlier 
> post)...it appears wsdl2java IS missing support for classpath 
> element...unlike java2wsdl which does have this element.
> 
> When using wsdl2java ant task and the "testcase=true" attribute 
> (generates jUnit test case which needs filling in) it attempts to find 
> jUnit on the classpath. Since this cannot be specified using Ant, it 
> requires you have it in your OS environment.
> 
> Generally it's not a good idea to put anything in your default classpath 
> (i.e. jre/lib/ext or classpath env var) as it screws too many things 
> up...classpaths s/be set explicitly by the requiring application.
> 
> Below is an example of java2wsdl axis ant task which works with nested 
> classpath element and wsdl2java task which doesn't:
> 
> 
>    <target depends="compile source" description="Generate wsdl" 
> name="java2wsdl">
>        <!-- The below classname (actually intf) is used by wsdl2java to 
> generate <Name>Service, and <Name>ServiceLocator classes.
>            It will also regenerate like-named interface, but with each 
> method throwing RMIExceptions... -->
>        <!-- The service name at the end of the url specifies the 
> className prefix for *SoapBinding{Impl|Stub}.java classes that are 
> generated -->
>        <axis-java2wsdl
>                classname="com.vxappliance.quotations.Quotations" 
> namespace="urn:QuotationsService"
>                
> location="http://${tomcat.host}:${tomcat.port}/axis/services/QuotationsService" 
> 
>                output="${build}/generated/QuotationsService.wsdl" 
> bindingname="Quotations" serviceportname="QuotationsService">
>            <classpath>
>                <pathelement location="${build}/classes"/>
>            </classpath>
>        </axis-java2wsdl>
>    </target>
> 
>    <target depends="java2wsdl" description="Generate server/client 
> stubs, wsdd" name="wsdl2java">
>        <!-- Generate stubs/skeletons and deploy/undeploy wsdd -->
>        <axis-wsdl2java debug="true" verbose="true" 
> output="${build}/generated" serverside="true" skeletondeploy="true"
>                url="${build}/generated/QuotationsService.wsdl" 
> testcase="true">
>            <mapping namespace="urn:QuotationsService" 
> package="com.vxappliance.quotations"/>
>        </axis-wsdl2java>
>    </target>
> 
> 
> 
> 



Re: Nested classpath element needed for wsdl2java...due to junit test case parameter

Posted by Matthew Pocock <ma...@yahoo.co.uk>.
Hi,

I have a patch for this & for adding typeMapping elements to the ant 
tasks. I'm still working on getting wsdl2java to dump out custom type 
mapping info. Let me know the bug ID

Matthew

Mike Klein wrote:

> Besides the ant tasks missing some key parameters available in the 
> commandline version of wsdl2java/java2wsdl (as I mentioned in an 
> earlier post)...it appears wsdl2java IS missing support for classpath 
> element...unlike java2wsdl which does have this element.
>
> When using wsdl2java ant task and the "testcase=true" attribute 
> (generates jUnit test case which needs filling in) it attempts to find 
> jUnit on the classpath. Since this cannot be specified using Ant, it 
> requires you have it in your OS environment.
>
> Generally it's not a good idea to put anything in your default 
> classpath (i.e. jre/lib/ext or classpath env var) as it screws too 
> many things up...classpaths s/be set explicitly by the requiring 
> application.
>
> Below is an example of java2wsdl axis ant task which works with nested 
> classpath element and wsdl2java task which doesn't:
>
>
>    <target depends="compile source" description="Generate wsdl" 
> name="java2wsdl">
>        <!-- The below classname (actually intf) is used by wsdl2java 
> to generate <Name>Service, and <Name>ServiceLocator classes.
>            It will also regenerate like-named interface, but with each 
> method throwing RMIExceptions... -->
>        <!-- The service name at the end of the url specifies the 
> className prefix for *SoapBinding{Impl|Stub}.java classes that are 
> generated -->
>        <axis-java2wsdl
>                classname="com.vxappliance.quotations.Quotations" 
> namespace="urn:QuotationsService"
>                
> location="http://${tomcat.host}:${tomcat.port}/axis/services/QuotationsService" 
>
>                output="${build}/generated/QuotationsService.wsdl" 
> bindingname="Quotations" serviceportname="QuotationsService">
>            <classpath>
>                <pathelement location="${build}/classes"/>
>            </classpath>
>        </axis-java2wsdl>
>    </target>
>
>    <target depends="java2wsdl" description="Generate server/client 
> stubs, wsdd" name="wsdl2java">
>        <!-- Generate stubs/skeletons and deploy/undeploy wsdd -->
>        <axis-wsdl2java debug="true" verbose="true" 
> output="${build}/generated" serverside="true" skeletondeploy="true"
>                url="${build}/generated/QuotationsService.wsdl" 
> testcase="true">
>            <mapping namespace="urn:QuotationsService" 
> package="com.vxappliance.quotations"/>
>        </axis-wsdl2java>
>    </target>
>
>