Hi .. I tried the AccountService.wsdl again with the version of the code
that I pulled down from the SVN today, i made two modifications in the wsdl
file as below
<xsd:element name="getAccountReportWrapped1">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="customerID" type="anyType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getAccountReportWrapped1Response">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="accountReport"
type="xsd:anyType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
The generated output is this
public interface AccountService {
/**
* Auto generated method signatures
* @param param0
*/
public commonj.sdo.DataObject getAccountReportWrapped1(
java.lang.Object param0) throws java.rmi.RemoteException;
There are couple of things to be noted here, "xsd:anyType" in the wsdl is
mapped to "commonj.sdo.DataObject" (This was failing with NPE before
applying the patch) and "anyType" is mapped to java.lang.Object (this was
happening even before the patch was applied)
This is also similar to the way XSD2Java Generator in the tuscany sdo
tools is working.
If you are still facing this problem, please provide some hints on how I
could replicate it... thanks.
On 5/22/06, Sreelatha S <[EMAIL PROTECTED]> wrote:
Hi... I tried the AccountService.wsdl and here is what I get for ...
<xsd:element name="getAccountReportWrapped1Response">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="accountReport" type="anyType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
The generated output:
public interface AccountService {
/**
* Auto generated method signatures
* @param param0
*/
public java.lang.Object getAccountReportWrapped1(
java.lang.String param0) throws java.rmi.RemoteException;
If you note the return type is java.lang.Object and not 'void'.
This test was done over the version of the code that I pulled down from
the SVN on Friday 19th May 2006. I shall give it one more try with the
latest codebase and post the findings. Thanks.
On 5/19/06, Fuhwei Lwo (JIRA) < [email protected]> wrote:
> [
http://issues.apache.org/jira/browse/TUSCANY-394?page=comments#action_12412514
> ]
>
> Fuhwei Lwo commented on TUSCANY-394:
> ------------------------------------
>
> Although your patch would get rid of NPE, it won't generate the right
> interface method. Take AccountService.wsdl under
> Tuscany/java/sca/tools/src/test/resources for example, if you changed
> accountReport element's type to "xsd:anyType", with your patch the return
> type of the generated interface method would become "void" which is wrong.
>
> <xsd:element name="getAccountReportResponse">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="accountReport"
> type="xsd:anyType"/> <<==
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
>
> Generated result:
> public interface AccountService {
>
> /**
> * Auto generated method signatures
> * @param param0
> */
> public void getAccountReport(
> java.lang.String param0) throws java.rmi.RemoteException;
>
> //
> }
>
>
> > NPE when running wsdl2java tool with "xsd:anyType" in the schema
> > ----------------------------------------------------------------
> >
> > Key: TUSCANY-394
> > URL: http://issues.apache.org/jira/browse/TUSCANY-394
> > Project: Tuscany
> > Type: Bug
>
> > Components: Java SCA Tools
> > Versions: Java-Mx
> > Reporter: Fuhwei Lwo
> > Fix For: Java-Mx
> > Attachments: patch.txt
> >
> > In the <wsdl:types><xsd:schema> section, if there is an element with
> xsd:anyType defined, running wsdl2java to generate the service interface
> would get a null pointer exception as below. Note: The SDO codegen tool is
> running fine with anyType.
> > java.lang.NullPointerException
> > at
> org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator.genera
> > teFromWSDL(WSDL2JavaGenerator.java:194)
> > at
> org.apache.tuscany.tools.wsdl2java.plugin.WSDL2JavaGeneratorMojo.exec
> > ute(WSDL2JavaGeneratorMojo.java:82)
> > at org.apache.maven.plugin.DefaultPluginManager.executeMojo
> (DefaultPlugi
> > nManager.java:432)
> > at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (Defa
> > ultLifecycleExecutor.java:530)
> > at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
> > fecycle(DefaultLifecycleExecutor.java:472)
> > at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (Defau
> > ltLifecycleExecutor.java:451)
> > at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> > dleFailures(DefaultLifecycleExecutor.java:303)
> > at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> > ts(DefaultLifecycleExecutor.java:270)
> > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
> (DefaultLi
> > fecycleExecutor.java:139)
> > at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java
> :322)
> > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java
> :115)
> > at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native
> Method)
> > at sun.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.
> > java:64)
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAcces
> > sorImpl.java :43)
> > at java.lang.reflect.Method.invoke(Method.java:615)
> > at org.codehaus.classworlds.Launcher.launchEnhanced(
> Launcher.java:315)
> > at org.codehaus.classworlds.Launcher.launch( Launcher.java:255)
> > at org.codehaus.classworlds.Launcher.mainWithExitCode(
> Launcher.java:430)
> > at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
> http://issues.apache.org/jira/secure/Administrators.jspa
> -
> 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]
>
>
--
____________________________________________________
God always gives His best to those who leave the choice with Him.
--
____________________________________________________
God always gives His best to those who leave the choice with Him.