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 Younsoo <sh...@tmax.co.kr> on 2002/05/03 04:08:10 UTC

A problem in Axis Beta2 when the EJB is called

  I implemented a webservice with EJB in the Axis beta1. There is a problem in Axis beta2.
When the EJB webservice is called, the axis returns a error message. My EJB webservice
has 4 operations ( deposit, withdraw, getBalance, and getFormattedBalance )
Here is the error message :

AXIS error
Sorry, something seems to have gone wrong... here are the details:
No such operation 'getBalance'



  I read the Axis beta2 source code and found the reason why the error occurred. The error position
is RPCProvider.java , "processMessage" method.

                .    .    .    .    .
                .    .    .    .    .
                .    .    .    .    .
// This may have changed, so get it again...
// FIXME (there should be a cleaner way to do this)
operation = msgContext.getOperation();

if (operation == null) {
    QName qname = new QName(body.getNamespaceURI(),
                           body.getName());
    operation = serviceDesc.getOperationByElementQName(qname);
}

if (operation == null) {
   throw new AxisFault(JavaUtils.getMessage("noSuchOperation",
                                            methodName));  <<<== Error occurs in this place.
}

// Create the array we'll use to hold the actual parameter
// values.  We know how big to make it from the metadata.
Object[]     argValues  =  new Object [operation.getNumParams()];
                .    .    .    .    .
                .    .    .    .    .
                .    .    .    .    .

  I think that "server-config.wsdd" file is parsed in WSDDDeployment's constructor, and <service> element's
contents are parsed into WSDDService class.

public WSDDDeployment(Element e)
    throws WSDDException
{
    super(e);

    Element [] elements = getChildElements(e, "handler");
    int i;
                .    .    .    .    .
                .    .    .    .    .
                .    .    .    .    .
    elements = getChildElements(e, "service");
    for (i = 0; i < elements.length; i++) {
        WSDDService service = new WSDDService(elements[i]);
        deployService(service);
    }
                .    .    .    .    .
                .    .    .    .    .
                .    .    .    .    .
}

  When WSDDService instance created, WSDDService constructor parses <service> element and calls validateDescriptors () method. A <service> element's subelement, <parameter name="className" value="xxx"/>'s value, java class is loaded.

public void validateDescriptors()
{
    String className = this.getParameter("className");
    if (className != null) {
        try {
            // Will this always be the right classloader?
            ClassLoader cl = Thread.currentThread().getContextClassLoader();
            Class cls = cl.loadClass(className); <<== <parameter name="className" value="xxx">'s xxx class is loaded.
            desc.setImplClass(cls);
            initTMR();
            String encStyle = (desc.getStyle() == ServiceDesc.STYLE_RPC) ?
                Constants.URI_CURRENT_SOAP_ENC : "";
            desc.setTypeMapping((TypeMapping)tmr.getTypeMapping(encStyle));
        } catch (Exception ex) {
        }
    }
                .    .    .    .    .
                .    .    .    .    .
                .    .    .    .    .
}

  As you can see above source, the loaded class, cls is set into ServiceDesc.( desc.setImplClass(cls); ) In setImplClass ()
method operations(xxx class's methods) are instantiated into OperationDesc class.

public void setImplClass(Class implClass) {
    if (this.implClass != null)
        throw new IllegalArgumentException(
                JavaUtils.getMessage("implAlreadySet"));

    this.implClass = implClass;
    if (Skeleton.class.isAssignableFrom(implClass)) {
        isSkeletonClass = true;
        loadSkeletonOperations(); <<== OperationDesc instances are set.
    }
}

  Here is my "server-config.wsdd" file's part . There is no <parameter name="className"> subelement in EJB <service>.
Therefore OperationDesc instances couldn't be created.
msgContext.getOperation() and serviceDesc.getOperationByElementQName(qname) in RPCProvider.java ,
"processMessage" method couldn't retrieve OperationDesc instance.
So AxisFault(JavaUtils.getMessage("noSuchOperation", methodName)) is thrown.

<!-- As you can see, this is a webservice using general java class -->
 <service name="Add" provider="java:RPC">
  <parameter name="allowedMethods" value="*"/>
  <parameter name="scope" value="Request"/>
  <parameter name="className" value="samples.TestWS.WebServiceTest"/>
 </service>
<!-- a webservice using EJB -->
 <service name="MyAccount" provider="java:EJB">
  <parameter name="allowedMethods" value="*"/>
  <parameter name="jndiURL" value="localhost"/>
  <parameter name="scope" value="request"/>
  <parameter name="beanJndiName" value="TestAccount"/>
  <parameter name="homeInterfaceName" value="testaccount.TestAccountHome"/>
 </service>

How can I make a webservice using EJB?

Re: A problem in Axis Beta2 when the EJB is called

Posted by Vaishakhi Ajmera <va...@ardec.com>.
I have the same problem.
Were you able to solve it?

Vaishakhi
----- Original Message -----
From: "Younsoo" <sh...@tmax.co.kr>
To: <ax...@xml.apache.org>
Sent: Thursday, May 02, 2002 9:08 PM
Subject: A problem in Axis Beta2 when the EJB is called


>   I implemented a webservice with EJB in the Axis beta1. There is a
problem in Axis beta2.
> When the EJB webservice is called, the axis returns a error message. My
EJB webservice
> has 4 operations ( deposit, withdraw, getBalance, and
getFormattedBalance )
> Here is the error message :
>
> AXIS error
> Sorry, something seems to have gone wrong... here are the details:
> No such operation 'getBalance'
>
>
>
>   I read the Axis beta2 source code and found the reason why the error
occurred. The error position
> is RPCProvider.java , "processMessage" method.
>
>                 .    .    .    .    .
>                 .    .    .    .    .
>                 .    .    .    .    .
> // This may have changed, so get it again...
> // FIXME (there should be a cleaner way to do this)
> operation = msgContext.getOperation();
>
> if (operation == null) {
>     QName qname = new QName(body.getNamespaceURI(),
>                            body.getName());
>     operation = serviceDesc.getOperationByElementQName(qname);
> }
>
> if (operation == null) {
>    throw new AxisFault(JavaUtils.getMessage("noSuchOperation",
>                                             methodName));  <<<== Error
occurs in this place.
> }
>
> // Create the array we'll use to hold the actual parameter
> // values.  We know how big to make it from the metadata.
> Object[]     argValues  =  new Object [operation.getNumParams()];
>                 .    .    .    .    .
>                 .    .    .    .    .
>                 .    .    .    .    .
>
>   I think that "server-config.wsdd" file is parsed in WSDDDeployment's
constructor, and <service> element's
> contents are parsed into WSDDService class.
>
> public WSDDDeployment(Element e)
>     throws WSDDException
> {
>     super(e);
>
>     Element [] elements = getChildElements(e, "handler");
>     int i;
>                 .    .    .    .    .
>                 .    .    .    .    .
>                 .    .    .    .    .
>     elements = getChildElements(e, "service");
>     for (i = 0; i < elements.length; i++) {
>         WSDDService service = new WSDDService(elements[i]);
>         deployService(service);
>     }
>                 .    .    .    .    .
>                 .    .    .    .    .
>                 .    .    .    .    .
> }
>
>   When WSDDService instance created, WSDDService constructor parses
<service> element and calls validateDescriptors () method. A <service>
element's subelement, <parameter name="className" value="xxx"/>'s value,
java class is loaded.
>
> public void validateDescriptors()
> {
>     String className = this.getParameter("className");
>     if (className != null) {
>         try {
>             // Will this always be the right classloader?
>             ClassLoader cl =
Thread.currentThread().getContextClassLoader();
>             Class cls = cl.loadClass(className); <<== <parameter
name="className" value="xxx">'s xxx class is loaded.
>             desc.setImplClass(cls);
>             initTMR();
>             String encStyle = (desc.getStyle() == ServiceDesc.STYLE_RPC) ?
>                 Constants.URI_CURRENT_SOAP_ENC : "";
>
desc.setTypeMapping((TypeMapping)tmr.getTypeMapping(encStyle));
>         } catch (Exception ex) {
>         }
>     }
>                 .    .    .    .    .
>                 .    .    .    .    .
>                 .    .    .    .    .
> }
>
>   As you can see above source, the loaded class, cls is set into
ServiceDesc.( desc.setImplClass(cls); ) In setImplClass ()
> method operations(xxx class's methods) are instantiated into OperationDesc
class.
>
> public void setImplClass(Class implClass) {
>     if (this.implClass != null)
>         throw new IllegalArgumentException(
>                 JavaUtils.getMessage("implAlreadySet"));
>
>     this.implClass = implClass;
>     if (Skeleton.class.isAssignableFrom(implClass)) {
>         isSkeletonClass = true;
>         loadSkeletonOperations(); <<== OperationDesc instances are set.
>     }
> }
>
>   Here is my "server-config.wsdd" file's part . There is no <parameter
name="className"> subelement in EJB <service>.
> Therefore OperationDesc instances couldn't be created.
> msgContext.getOperation() and
serviceDesc.getOperationByElementQName(qname) in RPCProvider.java ,
> "processMessage" method couldn't retrieve OperationDesc instance.
> So AxisFault(JavaUtils.getMessage("noSuchOperation", methodName)) is
thrown.
>
> <!-- As you can see, this is a webservice using general java class -->
>  <service name="Add" provider="java:RPC">
>   <parameter name="allowedMethods" value="*"/>
>   <parameter name="scope" value="Request"/>
>   <parameter name="className" value="samples.TestWS.WebServiceTest"/>
>  </service>
> <!-- a webservice using EJB -->
>  <service name="MyAccount" provider="java:EJB">
>   <parameter name="allowedMethods" value="*"/>
>   <parameter name="jndiURL" value="localhost"/>
>   <parameter name="scope" value="request"/>
>   <parameter name="beanJndiName" value="TestAccount"/>
>   <parameter name="homeInterfaceName"
value="testaccount.TestAccountHome"/>
>  </service>
>
> How can I make a webservice using EJB?


Re: A problem in Axis Beta2 when the EJB is called

Posted by Vaishakhi Ajmera <va...@ardec.com>.
Upon sending the message below, I got this message from the System Attendant

----------------------------------------------------------
Trend SMEX Content Filter has detected sensitive content.

Place = axis-user@xml.apache.org; ; ; axis-user@xml.apache.org
Sender = Vaishakhi Ajmera
Subject = Re: A problem in Axis Beta2 when the EJB is called
Delivery Time = May 06, 2002 (Monday) 15:48:37
Policy = Delinea
Action on this mail = Quarantine message

Warning message from administrator:
Content filter has detected a sensitive e-mail.

---------------------------------------------------------
I am unable to understand what was sensitive in my email.
Below is the message I had sent.
----- Original Message -----
From: "Vaishakhi Ajmera" <va...@ardec.com>
To: <ax...@xml.apache.org>
Sent: Monday, May 06, 2002 3:46 PM
Subject: Re: A problem in Axis Beta2 when the EJB is called


> Hi Younsoo,
> I am also using axis beta 2 and trying to call an ejb as a webservice and
I
> am getting the same error as yours.
> No such operation 'getRoles'
>
> Were you able to find a resolution to your problem. Have the axis
developers
> already fixed this and will it work if I get the latest build.
>
> Please do reply
>
> Thanks
> Vaishakhi
>
> ----- Original Message -----
> From: "Younsoo" <sh...@tmax.co.kr>
> To: <ax...@xml.apache.org>
> Sent: Thursday, May 02, 2002 9:08 PM
> Subject: A problem in Axis Beta2 when the EJB is called
>
>
> >   I implemented a webservice with EJB in the Axis beta1. There is a
> problem in Axis beta2.
> > When the EJB webservice is called, the axis returns a error message. My
> EJB webservice
> > has 4 operations ( deposit, withdraw, getBalance, and
> getFormattedBalance )
> > Here is the error message :
> >
> > AXIS error
> > Sorry, something seems to have gone wrong... here are the details:
> > No such operation 'getBalance'
> >
> >
> >
> >   I read the Axis beta2 source code and found the reason why the error
> occurred. The error position
> > is RPCProvider.java , "processMessage" method.
> >
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> > // This may have changed, so get it again...
> > // FIXME (there should be a cleaner way to do this)
> > operation = msgContext.getOperation();
> >
> > if (operation == null) {
> >     QName qname = new QName(body.getNamespaceURI(),
> >                            body.getName());
> >     operation = serviceDesc.getOperationByElementQName(qname);
> > }
> >
> > if (operation == null) {
> >    throw new AxisFault(JavaUtils.getMessage("noSuchOperation",
> >                                             methodName));  <<<== Error
> occurs in this place.
> > }
> >
> > // Create the array we'll use to hold the actual parameter
> > // values.  We know how big to make it from the metadata.
> > Object[]     argValues  =  new Object [operation.getNumParams()];
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> >
> >   I think that "server-config.wsdd" file is parsed in WSDDDeployment's
> constructor, and <service> element's
> > contents are parsed into WSDDService class.
> >
> > public WSDDDeployment(Element e)
> >     throws WSDDException
> > {
> >     super(e);
> >
> >     Element [] elements = getChildElements(e, "handler");
> >     int i;
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> >     elements = getChildElements(e, "service");
> >     for (i = 0; i < elements.length; i++) {
> >         WSDDService service = new WSDDService(elements[i]);
> >         deployService(service);
> >     }
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> > }
> >
> >   When WSDDService instance created, WSDDService constructor parses
> <service> element and calls validateDescriptors () method. A <service>
> element's subelement, <parameter name="className" value="xxx"/>'s value,
> java class is loaded.
> >
> > public void validateDescriptors()
> > {
> >     String className = this.getParameter("className");
> >     if (className != null) {
> >         try {
> >             // Will this always be the right classloader?
> >             ClassLoader cl =
> Thread.currentThread().getContextClassLoader();
> >             Class cls = cl.loadClass(className); <<== <parameter
> name="className" value="xxx">'s xxx class is loaded.
> >             desc.setImplClass(cls);
> >             initTMR();
> >             String encStyle = (desc.getStyle() == ServiceDesc.STYLE_RPC)
?
> >                 Constants.URI_CURRENT_SOAP_ENC : "";
> >
> desc.setTypeMapping((TypeMapping)tmr.getTypeMapping(encStyle));
> >         } catch (Exception ex) {
> >         }
> >     }
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> > }
> >
> >   As you can see above source, the loaded class, cls is set into
> ServiceDesc.( desc.setImplClass(cls); ) In setImplClass ()
> > method operations(xxx class's methods) are instantiated into
OperationDesc
> class.
> >
> > public void setImplClass(Class implClass) {
> >     if (this.implClass != null)
> >         throw new IllegalArgumentException(
> >                 JavaUtils.getMessage("implAlreadySet"));
> >
> >     this.implClass = implClass;
> >     if (Skeleton.class.isAssignableFrom(implClass)) {
> >         isSkeletonClass = true;
> >         loadSkeletonOperations(); <<== OperationDesc instances are set.
> >     }
> > }
> >
> >   Here is my "server-config.wsdd" file's part . There is no <parameter
> name="className"> subelement in EJB <service>.
> > Therefore OperationDesc instances couldn't be created.
> > msgContext.getOperation() and
> serviceDesc.getOperationByElementQName(qname) in RPCProvider.java ,
> > "processMessage" method couldn't retrieve OperationDesc instance.
> > So AxisFault(JavaUtils.getMessage("noSuchOperation", methodName)) is
> thrown.
> >
> > <!-- As you can see, this is a webservice using general java class -->
> >  <service name="Add" provider="java:RPC">
> >   <parameter name="allowedMethods" value="*"/>
> >   <parameter name="scope" value="Request"/>
> >   <parameter name="className" value="samples.TestWS.WebServiceTest"/>
> >  </service>
> > <!-- a webservice using EJB -->
> >  <service name="MyAccount" provider="java:EJB">
> >   <parameter name="allowedMethods" value="*"/>
> >   <parameter name="jndiURL" value="localhost"/>
> >   <parameter name="scope" value="request"/>
> >   <parameter name="beanJndiName" value="TestAccount"/>
> >   <parameter name="homeInterfaceName"
> value="testaccount.TestAccountHome"/>
> >  </service>
> >
> > How can I make a webservice using EJB?


Re: A problem in Axis Beta2 when the EJB is called

Posted by Vaishakhi Ajmera <va...@ardec.com>.
 Hi Younsoo,
 I am also using axis beta 2 and trying to call an ejb as a webservice and I
am getting the same error as yours.
No such operation 'operationName

Were you able to find a resolution to your problem. Is this already fixed
and will it work if I get the latest build.

Please do reply

Thanks
Vaishakhi
> >
> > ----- Original Message -----
> > From: "Younsoo" <sh...@tmax.co.kr>
> > To: <ax...@xml.apache.org>
> > Sent: Thursday, May 02, 2002 9:08 PM
> > Subject: A problem in Axis Beta2 when the EJB is called
> >
> >
> > >   I implemented a webservice with EJB in the Axis beta1. There is a
> > problem in Axis beta2.
> > > When the EJB webservice is called, the axis returns a error message.
My
> > EJB webservice
> > > has 4 operations ( deposit, withdraw, getBalance, and
> > getFormattedBalance )
> > > Here is the error message :
> > >
> > > AXIS error
> > > Sorry, something seems to have gone wrong... here are the details:
> > > No such operation 'getBalance'
> > >
> > >
> > >
> > >   I read the Axis beta2 source code and found the reason why the error
> > occurred. The error position
> > > is RPCProvider.java , "processMessage" method.
> > >
> > >                 .    .    .    .    .
> > >                 .    .    .    .    .
> > >                 .    .    .    .    .
> > > // This may have changed, so get it again...
> > > // FIXME (there should be a cleaner way to do this)
> > > operation = msgContext.getOperation();
> > >
> > > if (operation == null) {
> > >     QName qname = new QName(body.getNamespaceURI(),
> > >                            body.getName());
> > >     operation = serviceDesc.getOperationByElementQName(qname);
> > > }
> > >
> > > if (operation == null) {
> > >    throw new AxisFault(JavaUtils.getMessage("noSuchOperation",
> > >                                             methodName));  <<<== Error
> > occurs in this place.
> > > }
> > >
> > > // Create the array we'll use to hold the actual parameter
> > > // values.  We know how big to make it from the metadata.
> > > Object[]     argValues  =  new Object [operation.getNumParams()];
> > >                 .    .    .    .    .
> > >                 .    .    .    .    .
> > >                 .    .    .    .    .
> > >
> > >   I think that "server-config.wsdd" file is parsed in WSDDDeployment's
> > constructor, and <service> element's
> > > contents are parsed into WSDDService class.
> > >
> > > public WSDDDeployment(Element e)
> > >     throws WSDDException
> > > {
> > >     super(e);
> > >
> > >     Element [] elements = getChildElements(e, "handler");
> > >     int i;
> > >                 .    .    .    .    .
> > >                 .    .    .    .    .
> > >                 .    .    .    .    .
> > >     elements = getChildElements(e, "service");
> > >     for (i = 0; i < elements.length; i++) {
> > >         WSDDService service = new WSDDService(elements[i]);
> > >         deployService(service);
> > >     }
> > >                 .    .    .    .    .
> > >                 .    .    .    .    .
> > >                 .    .    .    .    .
> > > }
> > >
> > >   When WSDDService instance created, WSDDService constructor parses
> > <service> element and calls validateDescriptors () method. A <service>
> > element's subelement, <parameter name="className" value="xxx"/>'s value,
> > java class is loaded.
> > >
> > > public void validateDescriptors()
> > > {
> > >     String className = this.getParameter("className");
> > >     if (className != null) {
> > >         try {
> > >             // Will this always be the right classloader?
> > >             ClassLoader cl =
> > Thread.currentThread().getContextClassLoader();
> > >             Class cls = cl.loadClass(className); <<== <parameter
> > name="className" value="xxx">'s xxx class is loaded.
> > >             desc.setImplClass(cls);
> > >             initTMR();
> > >             String encStyle = (desc.getStyle() ==
ServiceDesc.STYLE_RPC)
> ?
> > >                 Constants.URI_CURRENT_SOAP_ENC : "";
> > >
> > desc.setTypeMapping((TypeMapping)tmr.getTypeMapping(encStyle));
> > >         } catch (Exception ex) {
> > >         }
> > >     }
> > >                 .    .    .    .    .
> > >                 .    .    .    .    .
> > >                 .    .    .    .    .
> > > }
> > >
> > >   As you can see above source, the loaded class, cls is set into
> > ServiceDesc.( desc.setImplClass(cls); ) In setImplClass ()
> > > method operations(xxx class's methods) are instantiated into
> OperationDesc
> > class.
> > >
> > > public void setImplClass(Class implClass) {
> > >     if (this.implClass != null)
> > >         throw new IllegalArgumentException(
> > >                 JavaUtils.getMessage("implAlreadySet"));
> > >
> > >     this.implClass = implClass;
> > >     if (Skeleton.class.isAssignableFrom(implClass)) {
> > >         isSkeletonClass = true;
> > >         loadSkeletonOperations(); <<== OperationDesc instances are
set.
> > >     }
> > > }
> > >
> > >   Here is my "server-config.wsdd" file's part . There is no <parameter
> > name="className"> subelement in EJB <service>.
> > > Therefore OperationDesc instances couldn't be created.
> > > msgContext.getOperation() and
> > serviceDesc.getOperationByElementQName(qname) in RPCProvider.java ,
> > > "processMessage" method couldn't retrieve OperationDesc instance.
> > > So AxisFault(JavaUtils.getMessage("noSuchOperation", methodName)) is
> > thrown.
> > >
> > > <!-- As you can see, this is a webservice using general java class -->
> > >  <service name="Add" provider="java:RPC">
> > >   <parameter name="allowedMethods" value="*"/>
> > >   <parameter name="scope" value="Request"/>
> > >   <parameter name="className" value="samples.TestWS.WebServiceTest"/>
> > >  </service>
> > > <!-- a webservice using EJB -->
> > >  <service name="MyAccount" provider="java:EJB">
> > >   <parameter name="allowedMethods" value="*"/>
> > >   <parameter name="jndiURL" value="localhost"/>
> > >   <parameter name="scope" value="request"/>
> > >   <parameter name="beanJndiName" value="TestAccount"/>
> > >   <parameter name="homeInterfaceName"
> > value="testaccount.TestAccountHome"/>
> > >  </service>
> > >
> > > How can I make a webservice using EJB?


Re: A problem in Axis Beta2 when the EJB is called

Posted by Vaishakhi Ajmera <va...@ardec.com>.
 Hi Younsoo,
 I am also using axis beta 2 and trying to call an ejb as a webservice and I
 am getting the same error as yours.
 No such operation 'operationName

 Were you able to find a resolution to your problem. Have the axis
developers
already fixed this and will it work if I get the latest build.

 Please do reply

 Thanks
Vaishakhi
>
> ----- Original Message -----
> From: "Younsoo" <sh...@tmax.co.kr>
> To: <ax...@xml.apache.org>
> Sent: Thursday, May 02, 2002 9:08 PM
> Subject: A problem in Axis Beta2 when the EJB is called
>
>
> >   I implemented a webservice with EJB in the Axis beta1. There is a
> problem in Axis beta2.
> > When the EJB webservice is called, the axis returns a error message. My
> EJB webservice
> > has 4 operations ( deposit, withdraw, getBalance, and
> getFormattedBalance )
> > Here is the error message :
> >
> > AXIS error
> > Sorry, something seems to have gone wrong... here are the details:
> > No such operation 'getBalance'
> >
> >
> >
> >   I read the Axis beta2 source code and found the reason why the error
> occurred. The error position
> > is RPCProvider.java , "processMessage" method.
> >
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> > // This may have changed, so get it again...
> > // FIXME (there should be a cleaner way to do this)
> > operation = msgContext.getOperation();
> >
> > if (operation == null) {
> >     QName qname = new QName(body.getNamespaceURI(),
> >                            body.getName());
> >     operation = serviceDesc.getOperationByElementQName(qname);
> > }
> >
> > if (operation == null) {
> >    throw new AxisFault(JavaUtils.getMessage("noSuchOperation",
> >                                             methodName));  <<<== Error
> occurs in this place.
> > }
> >
> > // Create the array we'll use to hold the actual parameter
> > // values.  We know how big to make it from the metadata.
> > Object[]     argValues  =  new Object [operation.getNumParams()];
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> >
> >   I think that "server-config.wsdd" file is parsed in WSDDDeployment's
> constructor, and <service> element's
> > contents are parsed into WSDDService class.
> >
> > public WSDDDeployment(Element e)
> >     throws WSDDException
> > {
> >     super(e);
> >
> >     Element [] elements = getChildElements(e, "handler");
> >     int i;
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> >     elements = getChildElements(e, "service");
> >     for (i = 0; i < elements.length; i++) {
> >         WSDDService service = new WSDDService(elements[i]);
> >         deployService(service);
> >     }
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> > }
> >
> >   When WSDDService instance created, WSDDService constructor parses
> <service> element and calls validateDescriptors () method. A <service>
> element's subelement, <parameter name="className" value="xxx"/>'s value,
> java class is loaded.
> >
> > public void validateDescriptors()
> > {
> >     String className = this.getParameter("className");
> >     if (className != null) {
> >         try {
> >             // Will this always be the right classloader?
> >             ClassLoader cl =
> Thread.currentThread().getContextClassLoader();
> >             Class cls = cl.loadClass(className); <<== <parameter
> name="className" value="xxx">'s xxx class is loaded.
> >             desc.setImplClass(cls);
> >             initTMR();
> >             String encStyle = (desc.getStyle() == ServiceDesc.STYLE_RPC)
?
> >                 Constants.URI_CURRENT_SOAP_ENC : "";
> >
> desc.setTypeMapping((TypeMapping)tmr.getTypeMapping(encStyle));
> >         } catch (Exception ex) {
> >         }
> >     }
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> >                 .    .    .    .    .
> > }
> >
> >   As you can see above source, the loaded class, cls is set into
> ServiceDesc.( desc.setImplClass(cls); ) In setImplClass ()
> > method operations(xxx class's methods) are instantiated into
OperationDesc
> class.
> >
> > public void setImplClass(Class implClass) {
> >     if (this.implClass != null)
> >         throw new IllegalArgumentException(
> >                 JavaUtils.getMessage("implAlreadySet"));
> >
> >     this.implClass = implClass;
> >     if (Skeleton.class.isAssignableFrom(implClass)) {
> >         isSkeletonClass = true;
> >         loadSkeletonOperations(); <<== OperationDesc instances are set.
> >     }
> > }
> >
> >   Here is my "server-config.wsdd" file's part . There is no <parameter
> name="className"> subelement in EJB <service>.
> > Therefore OperationDesc instances couldn't be created.
> > msgContext.getOperation() and
> serviceDesc.getOperationByElementQName(qname) in RPCProvider.java ,
> > "processMessage" method couldn't retrieve OperationDesc instance.
> > So AxisFault(JavaUtils.getMessage("noSuchOperation", methodName)) is
> thrown.
> >
> > <!-- As you can see, this is a webservice using general java class -->
> >  <service name="Add" provider="java:RPC">
> >   <parameter name="allowedMethods" value="*"/>
> >   <parameter name="scope" value="Request"/>
> >   <parameter name="className" value="samples.TestWS.WebServiceTest"/>
> >  </service>
> > <!-- a webservice using EJB -->
> >  <service name="MyAccount" provider="java:EJB">
> >   <parameter name="allowedMethods" value="*"/>
> >   <parameter name="jndiURL" value="localhost"/>
> >   <parameter name="scope" value="request"/>
> >   <parameter name="beanJndiName" value="TestAccount"/>
> >   <parameter name="homeInterfaceName"
> value="testaccount.TestAccountHome"/>
> >  </service>
> >
> > How can I make a webservice using EJB?


Re: A problem in Axis Beta2 when the EJB is called

Posted by Vaishakhi Ajmera <va...@ardec.com>.
Hi Younsoo,
I am also using axis beta 2 and trying to call an ejb as a webservice and I
am getting the same error as yours.
No such operation 'getRoles'

Were you able to find a resolution to your problem. Have the axis developers
already fixed this and will it work if I get the latest build.

Please do reply

Thanks
Vaishakhi

----- Original Message -----
From: "Younsoo" <sh...@tmax.co.kr>
To: <ax...@xml.apache.org>
Sent: Thursday, May 02, 2002 9:08 PM
Subject: A problem in Axis Beta2 when the EJB is called


>   I implemented a webservice with EJB in the Axis beta1. There is a
problem in Axis beta2.
> When the EJB webservice is called, the axis returns a error message. My
EJB webservice
> has 4 operations ( deposit, withdraw, getBalance, and
getFormattedBalance )
> Here is the error message :
>
> AXIS error
> Sorry, something seems to have gone wrong... here are the details:
> No such operation 'getBalance'
>
>
>
>   I read the Axis beta2 source code and found the reason why the error
occurred. The error position
> is RPCProvider.java , "processMessage" method.
>
>                 .    .    .    .    .
>                 .    .    .    .    .
>                 .    .    .    .    .
> // This may have changed, so get it again...
> // FIXME (there should be a cleaner way to do this)
> operation = msgContext.getOperation();
>
> if (operation == null) {
>     QName qname = new QName(body.getNamespaceURI(),
>                            body.getName());
>     operation = serviceDesc.getOperationByElementQName(qname);
> }
>
> if (operation == null) {
>    throw new AxisFault(JavaUtils.getMessage("noSuchOperation",
>                                             methodName));  <<<== Error
occurs in this place.
> }
>
> // Create the array we'll use to hold the actual parameter
> // values.  We know how big to make it from the metadata.
> Object[]     argValues  =  new Object [operation.getNumParams()];
>                 .    .    .    .    .
>                 .    .    .    .    .
>                 .    .    .    .    .
>
>   I think that "server-config.wsdd" file is parsed in WSDDDeployment's
constructor, and <service> element's
> contents are parsed into WSDDService class.
>
> public WSDDDeployment(Element e)
>     throws WSDDException
> {
>     super(e);
>
>     Element [] elements = getChildElements(e, "handler");
>     int i;
>                 .    .    .    .    .
>                 .    .    .    .    .
>                 .    .    .    .    .
>     elements = getChildElements(e, "service");
>     for (i = 0; i < elements.length; i++) {
>         WSDDService service = new WSDDService(elements[i]);
>         deployService(service);
>     }
>                 .    .    .    .    .
>                 .    .    .    .    .
>                 .    .    .    .    .
> }
>
>   When WSDDService instance created, WSDDService constructor parses
<service> element and calls validateDescriptors () method. A <service>
element's subelement, <parameter name="className" value="xxx"/>'s value,
java class is loaded.
>
> public void validateDescriptors()
> {
>     String className = this.getParameter("className");
>     if (className != null) {
>         try {
>             // Will this always be the right classloader?
>             ClassLoader cl =
Thread.currentThread().getContextClassLoader();
>             Class cls = cl.loadClass(className); <<== <parameter
name="className" value="xxx">'s xxx class is loaded.
>             desc.setImplClass(cls);
>             initTMR();
>             String encStyle = (desc.getStyle() == ServiceDesc.STYLE_RPC) ?
>                 Constants.URI_CURRENT_SOAP_ENC : "";
>
desc.setTypeMapping((TypeMapping)tmr.getTypeMapping(encStyle));
>         } catch (Exception ex) {
>         }
>     }
>                 .    .    .    .    .
>                 .    .    .    .    .
>                 .    .    .    .    .
> }
>
>   As you can see above source, the loaded class, cls is set into
ServiceDesc.( desc.setImplClass(cls); ) In setImplClass ()
> method operations(xxx class's methods) are instantiated into OperationDesc
class.
>
> public void setImplClass(Class implClass) {
>     if (this.implClass != null)
>         throw new IllegalArgumentException(
>                 JavaUtils.getMessage("implAlreadySet"));
>
>     this.implClass = implClass;
>     if (Skeleton.class.isAssignableFrom(implClass)) {
>         isSkeletonClass = true;
>         loadSkeletonOperations(); <<== OperationDesc instances are set.
>     }
> }
>
>   Here is my "server-config.wsdd" file's part . There is no <parameter
name="className"> subelement in EJB <service>.
> Therefore OperationDesc instances couldn't be created.
> msgContext.getOperation() and
serviceDesc.getOperationByElementQName(qname) in RPCProvider.java ,
> "processMessage" method couldn't retrieve OperationDesc instance.
> So AxisFault(JavaUtils.getMessage("noSuchOperation", methodName)) is
thrown.
>
> <!-- As you can see, this is a webservice using general java class -->
>  <service name="Add" provider="java:RPC">
>   <parameter name="allowedMethods" value="*"/>
>   <parameter name="scope" value="Request"/>
>   <parameter name="className" value="samples.TestWS.WebServiceTest"/>
>  </service>
> <!-- a webservice using EJB -->
>  <service name="MyAccount" provider="java:EJB">
>   <parameter name="allowedMethods" value="*"/>
>   <parameter name="jndiURL" value="localhost"/>
>   <parameter name="scope" value="request"/>
>   <parameter name="beanJndiName" value="TestAccount"/>
>   <parameter name="homeInterfaceName"
value="testaccount.TestAccountHome"/>
>  </service>
>
> How can I make a webservice using EJB?