You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Bharath Ganesh <bh...@pramati.com> on 2006/12/26 13:28:38 UTC

JAX-WS Handler Support

Hello

I could see that the JAX-WS handlers are not working with cxf-2.0-incubator-M1 release. Is this expected in the CXF 2.0 RC? If so when is this release scheduled? Is there an M2 release also? 

Thanks
Bharath

Re: JAX-WS Handler Support

Posted by Bharath Ganesh <bh...@pramati.com>.
Hi James, 

I tried the same with verbose mode.

 java.lang.NoSuchMethodException: com.pramati.rs.ws.AddException.getFaultInfo()
        at java.lang.Class.getMethod(Class.java:1581)
        at org.apache.cxf.tools.java2wsdl.processor.internal.RPCMethodProcessor.processExceptions(RPCMethodProcessor.java:196)

So the issue was my Service specific exception did not contain the getFaultInfo() method and was not a RemoteException. 

Thanks
Bharath

--- 
  From: James Mao 
  To: Bharath Ganesh 
  Cc: cxf-user@incubator.apache.org ; jliu@iona.com 
  Sent: Wednesday, December 27, 2006 6:01 PM
  Subject: Re: JAX-WS Handler Support


  Hi Bharath,

  By default
  > Hi
  >  
  > The issue has been logged at the bug database.
  >  
  > Please check https://issues.apache.org/jira/browse/CXF-336
  >  
  > Also https://issues.apache.org/jira/browse/CXF-335

  Thanks

  >  
  > I could also see the java2wsdl tool is buggy for a number of cases. 
  > For exampple I have a POJO annotated with JSR 181 annotations to be 
  > exposed as a WS.
  >  
  > import javax.jws.*;
  >  
  > @WebService
  > public class Calculator
  > {
  >     public int add (int a, int b) throws AddException{
  >         if(a<0 || b<0){
  >             throw new AddException("No negetive please");
  >         }
  >         return a+b;
  >     }
  > }
  >  
  > When I run the java2wsdl tool by providing the above class, I get the 
  > following error.
  >  
  > Error : Can not load the request wrapper class 
  > com.pramati.rs.ws.jaxws.Add,  please check the @Reque
  > stWrapper annotation and see if the class is in your classpath
  >  
  > The @RequestWrapper annotation is not mandatory. The container could 
  > have well used RPC/Literal.

  By default java2wsdl assume that the class is in DOC-LIT-WRAPPER style, 
  that's why you will get the error message. maybe we can improve this by 
  adding more suggestion/hits in the error message.
  >  
  > Later when I annotated the Service with @SOAPBinding(style= 
  > SOAPBinding.Style.RPC, use= SOAPBinding.Use.LITERAL) , the problem I 
  > faced was:

  Right, this is the correct way when you want to generate the RPC-LIT style

  >  
  > Error : com.pramati.rs.ws.AddException.getFaultInfo()

  Do you have the AddException class in your classpath, i guess the 
  problem is java2wsdl is tring to load the exception class, but it can 
  not find it in the classpath. 
  My suggestion is check if the exception class is in your classpath, and 
  try again.
  If still not work, then turn the verbose on by "-v" or "-verbose". and 
  then send the exception to this mail list or add the exception message 
  into the corresponding jira issue.
  >  
  > Is this a known issue?

  No, this is the first time i see the issue ;)

  BTW, you can find tons of excellent tutorial/documentation from 
  http://www.iona.com/products/celtix/

  Enjoy!
  James.
  >  
  > Thanks
  > Bharath
  >
  >  
  >  
  > ----- Original Message -----
  >
  >     *From:* James Mao <ma...@iona.com>
  >     *To:* cxf-user@incubator.apache.org
  >     <ma...@incubator.apache.org>
  >     *Sent:* Wednesday, December 27, 2006 7:41 AM
  >     *Subject:* Re: JAX-WS Handler Support
  >
  >     Hi Bharath,
  >
  >     What do you mean not working? it should work from my
  >     understanding, can
  >     you provide your testcase, ideally fire a jira issue if it's
  >     possible [1]
  >
  >     [1]https://issues.apache.org/jira/browse/CXF
  >
  >     Thanks,
  >     James.
  >     > Hello
  >     >
  >     > I could see that the JAX-WS handlers are not working with
  >     cxf-2.0-incubator-M1 release. Is this expected in the CXF 2.0 RC?
  >     If so when is this release scheduled? Is there an M2 release also?
  >     >
  >     > Thanks
  >     > Bharath
  >     >
  >

Re: JAX-WS Handler Support

Posted by James Mao <ja...@iona.com>.
Hi Bharath,

By default
> Hi
>  
> The issue has been logged at the bug database.
>  
> Please check https://issues.apache.org/jira/browse/CXF-336
>  
> Also https://issues.apache.org/jira/browse/CXF-335

Thanks

>  
> I could also see the java2wsdl tool is buggy for a number of cases. 
> For exampple I have a POJO annotated with JSR 181 annotations to be 
> exposed as a WS.
>  
> import javax.jws.*;
>  
> @WebService
> public class Calculator
> {
>     public int add (int a, int b) throws AddException{
>         if(a<0 || b<0){
>             throw new AddException("No negetive please");
>         }
>         return a+b;
>     }
> }
>  
> When I run the java2wsdl tool by providing the above class, I get the 
> following error.
>  
> Error : Can not load the request wrapper class 
> com.pramati.rs.ws.jaxws.Add,  please check the @Reque
> stWrapper annotation and see if the class is in your classpath
>  
> The @RequestWrapper annotation is not mandatory. The container could 
> have well used RPC/Literal.

By default java2wsdl assume that the class is in DOC-LIT-WRAPPER style, 
that's why you will get the error message. maybe we can improve this by 
adding more suggestion/hits in the error message.
>  
> Later when I annotated the Service with @SOAPBinding(style= 
> SOAPBinding.Style.RPC, use= SOAPBinding.Use.LITERAL) , the problem I 
> faced was:

Right, this is the correct way when you want to generate the RPC-LIT style

>  
> Error : com.pramati.rs.ws.AddException.getFaultInfo()

Do you have the AddException class in your classpath, i guess the 
problem is java2wsdl is tring to load the exception class, but it can 
not find it in the classpath. 
My suggestion is check if the exception class is in your classpath, and 
try again.
If still not work, then turn the verbose on by "-v" or "-verbose". and 
then send the exception to this mail list or add the exception message 
into the corresponding jira issue.
>  
> Is this a known issue?

No, this is the first time i see the issue ;)

BTW, you can find tons of excellent tutorial/documentation from 
http://www.iona.com/products/celtix/

Enjoy!
James.
>  
> Thanks
> Bharath
>
>  
>  
> ----- Original Message -----
>
>     *From:* James Mao <ma...@iona.com>
>     *To:* cxf-user@incubator.apache.org
>     <ma...@incubator.apache.org>
>     *Sent:* Wednesday, December 27, 2006 7:41 AM
>     *Subject:* Re: JAX-WS Handler Support
>
>     Hi Bharath,
>
>     What do you mean not working? it should work from my
>     understanding, can
>     you provide your testcase, ideally fire a jira issue if it's
>     possible [1]
>
>     [1]https://issues.apache.org/jira/browse/CXF
>
>     Thanks,
>     James.
>     > Hello
>     >
>     > I could see that the JAX-WS handlers are not working with
>     cxf-2.0-incubator-M1 release. Is this expected in the CXF 2.0 RC?
>     If so when is this release scheduled? Is there an M2 release also?
>     >
>     > Thanks
>     > Bharath
>     >
>


Re: JAX-WS Handler Support

Posted by Bharath Ganesh <bh...@pramati.com>.
Hi

The issue has been logged at the bug database. 

Please check https://issues.apache.org/jira/browse/CXF-336

Also https://issues.apache.org/jira/browse/CXF-335

I could also see the java2wsdl tool is buggy for a number of cases. For exampple I have a POJO annotated with JSR 181 annotations to be exposed as a WS. 

import javax.jws.*;

@WebService
public class Calculator
{
    public int add (int a, int b) throws AddException{
        if(a<0 || b<0){
            throw new AddException("No negetive please");
        }
        return a+b;
    }
}

When I run the java2wsdl tool by providing the above class, I get the following error. 

Error : Can not load the request wrapper class com.pramati.rs.ws.jaxws.Add,  please check the @Reque
stWrapper annotation and see if the class is in your classpath

The @RequestWrapper annotation is not mandatory. The container could have well used RPC/Literal. 

Later when I annotated the Service with @SOAPBinding(style= SOAPBinding.Style.RPC, use= SOAPBinding.Use.LITERAL) , the problem I faced was: 

Error : com.pramati.rs.ws.AddException.getFaultInfo()

Is this a known issue? 

Thanks
Bharath



----- Original Message ----- 
  From: James Mao 
  To: cxf-user@incubator.apache.org 
  Sent: Wednesday, December 27, 2006 7:41 AM
  Subject: Re: JAX-WS Handler Support


  Hi Bharath,

  What do you mean not working? it should work from my understanding, can 
  you provide your testcase, ideally fire a jira issue if it's possible [1]

  [1]https://issues.apache.org/jira/browse/CXF

  Thanks,
  James.
  > Hello
  >
  > I could see that the JAX-WS handlers are not working with cxf-2.0-incubator-M1 release. Is this expected in the CXF 2.0 RC? If so when is this release scheduled? Is there an M2 release also? 
  >
  > Thanks
  > Bharath
  >

Re: JAX-WS Handler Support

Posted by James Mao <ja...@iona.com>.
Hi Bharath,

What do you mean not working? it should work from my understanding, can 
you provide your testcase, ideally fire a jira issue if it's possible [1]

[1]https://issues.apache.org/jira/browse/CXF

Thanks,
James.
> Hello
>
> I could see that the JAX-WS handlers are not working with cxf-2.0-incubator-M1 release. Is this expected in the CXF 2.0 RC? If so when is this release scheduled? Is there an M2 release also? 
>
> Thanks
> Bharath
>