parameters of first method might have been simple/native types like int etc. which the Axis runtime could have intelligently (un)marshalled, and those of second might not have been so easy ones for which reason extra ParameterDesc object would have helped axis find the proper ser/deser factories to marshall/unmarshall the object.
 
Jaya
 
On 1/6/06, Harbarth, Juliane <[EMAIL PROTECTED]> wrote:


Hi,

I have made sure that none of the other jars implements the javax.xml.rpc
package. But, never mind, it is now working. I have no idea why. There is
still one thing that bothers me though.
One of the services I am calling can be invoked by using just four lines
of code, i.e.

Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new URL(wsEndpoint));
call.setOperationName( new javax.xml.namespace.QName(wsNamespace,wsMethod));
ret = call.invoke(val);

For another service this simple approach did not work. The invoked service
complained that it did not correctly receive the input value. I needed
additional code as such:

oper = new org.apache.axis.description.OperationDesc();
org.apache.axis.description.ParameterDesc param = new ...
oper.addParameter(param);
oper.setReturnType(...
call.setOperation (oper);

Why is this ?

Regards & thanks,
Juliane.

________________________________

From: jayachandra [mailto:[EMAIL PROTECTED]]
Sent: Mittwoch, 4. Januar 2006 11:10
To: [email protected]
Subject: Re: Can't call a Web Service from a Servlet


Looks like there is another jar implementing the javax.xml.rpc package in the classpath.
If you copied jaxrpc and axis jars in your webapps context classpath (i.e. WEB-INF/lib) folder, do check what other jars you have and see if any of them have implementation of this package.

Hope that helps,
Jayachandra

On 1/4/06, Harbarth, Juliane <[EMAIL PROTECTED]> wrote:



       Hi Johann,

       but I do have jaxrpc.jar in the lib directory.

       Regards,
       Juliane.

       -----Original Message-----
       From: Johann RENEL [mailto:[EMAIL PROTECTED]]
       Sent: Dienstag, 3. Januar 2006 18:12
       To: [email protected]
       Subject: Re: Can't call a Web Service from a Servlet

       Hi,

       Your import are correct, just the jaxrpc.jar is a dependance for Axis.
       jaxrpc.jar must be in the same directory as axis.jar etc.

       BR,

       Johann

       Harbarth, Juliane a écrit :
       >
       >
       > Hi Johann,
       >
       > that is strange indeed.
       > I do have jaxrpc.jar and it does contain a class Service,
       > javax.xml.rpc.Service to be precise.
       > But may be here is the problem, my Servlet contains the following
       > imports:
       >
       > import java.io.*;
       > import javax.servlet.*;
       > import javax.servlet.http.*;
       > import java.net.URL ;
       > import org.apache.axis.client.Call ;
       > import org.apache.axis.client.Service;
       >
       > Doesn't that mean that it interprets the Service in the code as being
       > of class org.apache.axis.client.Service instead of
       > javax.xml.rpc.Service as I intended (though in these details I am not
       > completely sure what I really intend) ?
       > The axis Service class is also there (in axis.jar).
       >
       > Thanks & regards,
       > Juliane.
       >
       >
       >
       > -----Original Message-----
       > From: Johann RENEL [mailto: [EMAIL PROTECTED]]
       > Sent: Dienstag, 3. Januar 2006 12:19
       > To: [email protected]
       > Subject: Re: Can't call a Web Service from a Servlet
       >
       > Hello,
       >
       > Harbarth, Juliane a écrit :
       >
       >>
       >>
       >>Hi all,
       >>
       >>I am trying to invoke a Web service from a servlet. Since the servlet
       >>is supposed to be able to be dynamic w.r.t. the Web service's name, I
       >>am using a generic way to invoke the service as follows:
       >>
       >>      Service service = new Service();
       >>      Object ret;
       >>      try
       >>      {
       >>          Call    call    = (Call)service.createCall();
       >>          call.setTargetEndpointAddress (new URL(wsEndpoint));
       >>          call.setOperationName( new
       >>javax.xml.namespace.QName(wsNamespace,wsMethod));
       >>          ret = call.invoke(val);
       >>
       >>The service is deployed and accessible by a Java application using the
       >>same invoke method.
       >>When running the servlet, I am getting an NoClassDefFoundError error
       >>pointing to the line that contains the new Service() statement (the
       >>full error report is attached below).
       >
       >
       > This message indicates the jaxrpc jar is missing. Axis needs the Service interface (of jaxrpc) to implement the Service class.
       >
       >
       >>have failed to understand how to make archives known to a servlet.
       >>Isn't it enough to get the servlet compiled and provide the jars in
       >>the Web application's lib sub-directory ?
       >
       >
       > yes, generaly that's the way
       >
       > BR,
       >
       > Johann
       >





--
-- Jaya



--
-- Jaya

Reply via email to