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 Rhimbo <rh...@yahoo.com> on 2006/03/15 03:55:33 UTC

How to use "long" for parameter type?

Hi folks,

Tomcat 5.5.15, AXIS 1.3, Linux fedora core 4....

Java2WSDL does not generate the correct method signature in the 
*SoapBindingImpl.java file.  Here is the scenario.

I have the following method declaration in my Family.java file, which
defines one interface.

public interface Family 
{
  public int register(String email, 
		      String password, 
		      long birthDate, 
		      String affiliateName)
      throws RemoteException;

...
}

I execute:

$ java org.apache.axis.wsdl.Java2WSDL -o family.wsdl \
  -l"http://localhost:8080/axis/services/family-accounts" \
  -n urn:family-accounts \
  -p"family-accounts" urn:disney.dis.family \
  disney.dis.family.Family 

to produce the family.wsdl file, which I've attached to this email.


I execute:

$ 
$ java org.apache.axis.wsdl.WSDL2Java -o . -d Session -s \
  -p disney.dis.family family.wsdl

to produce the auto-generated files.  The file that contains the
SOAP binding implementation has the following signature
corresponding to the interface method declaration above:

    public int register(java.lang.String in0, 
                        java.lang.String in1, 
                         java.lang.String in2) 
             throws java.rmi.RemoteException 
    {
        return -3;
    }

It should be like this:

    public int register(java.lang.String in0, 
                        java.lang.String in1, 
                        long in2,
                        java.lang.String in3) 
             throws java.rmi.RemoteException 
    {
        return -3;
    }


Can anyone tell me what's wrong?  How can I specify "long" 
type parameters?

Many thanks,

Vartan

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: How to use "long" for parameter type?

Posted by Rhimbo <rh...@yahoo.com>.
Hmm, now I'm really confused.  :-)

I went to look up the command line args to try setting style to 
"wrapped". 

I did

$ java org.apache.axis.wsdl.Java2WSDL -h

and got this (abbreviated) output.

   -y, --style <argument>
        The style of binding in the WSDL, either DOCUMENT, RPC, 
        or WRAPPED.

So I added this to my Java2WSDL command

$ java org.apache.axis.wsdl.Java2WSDL -o family.wsdl \
  -l"http://localhost:8080/axis/services/family-accounts" \
  -n urn:family-accounts \
  -p"family-accounts" urn:disney.dis.family \
  --style wrapped  disney.dis.family.Family

I also tried the
   -y wrapped

option.  I got the following trace back spit back at me!!  
If I remove the 
   --style wrapped 

option it completes without error (but still the parameter
problem).  

Might I have a bad version of Java2WSDL?  Any ideas?  





AxisFault
 faultCode: {http://xml.apache.org/axis/}Server.generalException
 faultSubcode:
 faultString: Attempted to write duplicate schema element :
{urn:family-accounts}isRegistered
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace:Attempted to write
duplicate schema element : {urn:family-accounts}isRegistered
        at
org.apache.axis.wsdl.fromJava.Types.writeSchemaElementDecl(Types.java:865)
        at
org.apache.axis.wsdl.fromJava.Types.writeWrapperElement(Types.java:566)
        at
org.apache.axis.wsdl.fromJava.Emitter.writeWrapperPart(Emitter.java:1651)
        at
org.apache.axis.wsdl.fromJava.Emitter.writeRequestMessage(Emitter.java:1467)
        at
org.apache.axis.wsdl.fromJava.Emitter.writeMessages(Emitter.java:1106)
        at
org.apache.axis.wsdl.fromJava.Emitter.writePortType(Emitter.java:1075)
        at
org.apache.axis.wsdl.fromJava.Emitter.getWSDL(Emitter.java:484)
        at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:331)
        at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:430)
        at org.apache.axis.wsdl.Java2WSDL.run(Java2WSDL.java:588)
        at org.apache.axis.wsdl.Java2WSDL.main(Java2WSDL.java:682)

        {http://xml.apache.org/axis/}hostname:NH-VPIROUMI-DT1

Attempted to write duplicate schema element :
{urn:family-accounts}isRegistered
        at
org.apache.axis.wsdl.fromJava.Types.writeSchemaElementDecl(Types.java:865)
        at
org.apache.axis.wsdl.fromJava.Types.writeWrapperElement(Types.java:566)
        at
org.apache.axis.wsdl.fromJava.Emitter.writeWrapperPart(Emitter.java:1651)
        at
org.apache.axis.wsdl.fromJava.Emitter.writeRequestMessage(Emitter.java:1467)
        at
org.apache.axis.wsdl.fromJava.Emitter.writeMessages(Emitter.java:1106)
        at
org.apache.axis.wsdl.fromJava.Emitter.writePortType(Emitter.java:1075)
        at
org.apache.axis.wsdl.fromJava.Emitter.getWSDL(Emitter.java:484)
        at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:331)
        at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:430)
        at org.apache.axis.wsdl.Java2WSDL.run(Java2WSDL.java:588)
        at org.apache.axis.wsdl.Java2WSDL.main(Java2WSDL.java:682)
$








--- Anne Thomas Manes <at...@gmail.com> wrote:

> Is there a reason why you have to use rpc/encoded?
> Try generating style="wrapped" and see if that fixes the problem.
> 
> Anne
> 
> On 3/14/06, Rhimbo <rh...@yahoo.com> wrote:
> >
> > Hi folks,
> >
> > Tomcat 5.5.15, AXIS 1.3, Linux fedora core 4....
> >
> > Java2WSDL does not generate the correct method signature in the
> > *SoapBindingImpl.java file.  Here is the scenario.
> >
> > I have the following method declaration in my Family.java file, which
> > defines one interface.
> >
> > public interface Family
> > {
> >   public int register(String email,
> >                       String password,
> >                       long birthDate,
> >                       String affiliateName)
> >       throws RemoteException;
> >
> > ...
> > }
> >
> > I execute:
> >
> > $ java org.apache.axis.wsdl.Java2WSDL -o family.wsdl \
> >   -l"http://localhost:8080/axis/services/family-accounts" \
> >   -n urn:family-accounts \
> >   -p"family-accounts" urn:disney.dis.family \
> >   disney.dis.family.Family
> >
> > to produce the family.wsdl file, which I've attached to this email.
> >
> >
> > I execute:
> >
> > $
> > $ java org.apache.axis.wsdl.WSDL2Java -o . -d Session -s \
> >   -p disney.dis.family family.wsdl
> >
> > to produce the auto-generated files.  The file that contains the
> > SOAP binding implementation has the following signature
> > corresponding to the interface method declaration above:
> >
> >     public int register(java.lang.String in0,
> >                         java.lang.String in1,
> >                          java.lang.String in2)
> >              throws java.rmi.RemoteException
> >     {
> >         return -3;
> >     }
> >
> > It should be like this:
> >
> >     public int register(java.lang.String in0,
> >                         java.lang.String in1,
> >                         long in2,
> >                         java.lang.String in3)
> >              throws java.rmi.RemoteException
> >     {
> >         return -3;
> >     }
> >
> >
> > Can anyone tell me what's wrong?  How can I specify "long"
> > type parameters?
> >
> > Many thanks,
> >
> > Vartan
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> >
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: How to use "long" for parameter type?

Posted by Anne Thomas Manes <at...@gmail.com>.
Is there a reason why you have to use rpc/encoded?
Try generating style="wrapped" and see if that fixes the problem.

Anne

On 3/14/06, Rhimbo <rh...@yahoo.com> wrote:
>
> Hi folks,
>
> Tomcat 5.5.15, AXIS 1.3, Linux fedora core 4....
>
> Java2WSDL does not generate the correct method signature in the
> *SoapBindingImpl.java file.  Here is the scenario.
>
> I have the following method declaration in my Family.java file, which
> defines one interface.
>
> public interface Family
> {
>   public int register(String email,
>                       String password,
>                       long birthDate,
>                       String affiliateName)
>       throws RemoteException;
>
> ...
> }
>
> I execute:
>
> $ java org.apache.axis.wsdl.Java2WSDL -o family.wsdl \
>   -l"http://localhost:8080/axis/services/family-accounts" \
>   -n urn:family-accounts \
>   -p"family-accounts" urn:disney.dis.family \
>   disney.dis.family.Family
>
> to produce the family.wsdl file, which I've attached to this email.
>
>
> I execute:
>
> $
> $ java org.apache.axis.wsdl.WSDL2Java -o . -d Session -s \
>   -p disney.dis.family family.wsdl
>
> to produce the auto-generated files.  The file that contains the
> SOAP binding implementation has the following signature
> corresponding to the interface method declaration above:
>
>     public int register(java.lang.String in0,
>                         java.lang.String in1,
>                          java.lang.String in2)
>              throws java.rmi.RemoteException
>     {
>         return -3;
>     }
>
> It should be like this:
>
>     public int register(java.lang.String in0,
>                         java.lang.String in1,
>                         long in2,
>                         java.lang.String in3)
>              throws java.rmi.RemoteException
>     {
>         return -3;
>     }
>
>
> Can anyone tell me what's wrong?  How can I specify "long"
> type parameters?
>
> Many thanks,
>
> Vartan
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>