Re: Can't call a Web Service from a Servlet

2006-01-08 Thread jayachandra
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.rpcpackage. 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 linesof 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 servicecomplained 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: axis-user@ws.apache.orgSubject: Re: Can't call a Web Service from a ServletLooks 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,
JayachandraOn 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: axis-user@ws.apache.org   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: axis-user@ws.apache.org   > 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   >>  {   >>  Callcall= (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,   >   > Joh

Re: Re: Deserialization(?) Error on String Array

2006-01-08 Thread chinmoy chakraborty

  
hii,

im not an expert, but just add following custome serializer and deserializer like following, i guess it'll work.

public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType)
    {
        return new BeanSerializer(_javaType, _xmlType, typeDesc);
    }

    public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType)
    {
        return new BeanDeserializer(_javaType, _xmlType, typeDesc);
    }

private static TypeDesc typeDesc;




On Sat, 07 Jan 2006 iksrazal wrote :
>Shelli,
>
>I'm not a big fan of soap encoded arrays, but I used to use them alot and I
>may be able to help. Doc / Lit is the way things are going. Nevertheless, try
>posting your original wsdl, and mention where you want to put your String
>array. Chances are though, your wsdl may be fine.
>
>Your Deserialization Error may just mean that your client can't find the wsdl
>or its mapping. It can be a tricky problem. Try searching for
>org.apache.axis.encoding.ser.BeanSerializerFactory and
>org.apache.axis.encoding.ser.BeanDeserializerFactory .
>
>HTH,
>iksrazal
>
>Em Sexta 06 Janeiro 2006 21:09, o Shelli D. Orton escreveu:
> > I should have mentioned in the original post, that with the second WSDL,
> > there is no SOCArray class.  The Java methods receive/pass a String[]
> > array. I was hoping by changing to that I wouldn't have the deserialization
> > error I'm getting.
> >
> > Thanks again,
> > Shelli
> >
> > -Original Message-
> > From: Shelli D. Orton [mailto:[EMAIL PROTECTED]
> > Sent: Friday, January 06, 2006 3:57 PM
> > To: axis-user@ws.apache.org
> > Subject: Deserialization(?) Error on String Array
> >
> >
> > Hi,
> >
> > I have to make some modifications to an existing (working) webservice.  We
> > needed to add a new parameter to one of the existing methods, an array of
> > strings.  I originall created a a new type as follows in the WSDL:
> >
> >     
> >         
> > targetNamespace="http://clearmode.com:80/ws/ConsumerProvision"
> >           xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> >
> >             
> >                 
> >                     
> >                         
> > maxOccurs="unbounded"/>
> >                     
> >                 
> >             
> >
> >         
> >     
> >
> > and added it to the message definiton:
> >
> >     
> >         
> >         
> >         ...
> >         
> >         
> >         
> >         
> >     
> >
> > When I ran WSDL2Java, it created an SOCArray class.  During testing of the
> > modified service, I get the following error when I try to call the
> > addRequest:
> >
> >
> > Exception caught: java.lang.reflect.InvocationTargetException
> > AxisFault
> >  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
> >  faultSubcode:
> >  faultString: java.lang.reflect.InvocationTargetException
> >  faultActor:
> >  faultNode:
> >  faultDetail:
> >      {http://xml.apache.org/axis/}hostname:localhost
> >
> > java.lang.reflect.InvocationTargetException
> >      at
> > org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:
> >2 21)
> >      at
> > org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:1
> >2 8)
> >      at
> > org.apache.axis.encoding.DeserializationContext.endElement(DeserializationC
> >o ntext.java:1087)
> >      at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
> >      at org.apache.crimson.parser.Parser2.content(Unknown Source)
> >      at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
> >      at org.apache.crimson.parser.Parser2.content(Unknown Source)
> >      at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
> >      at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
> >      at org.apache.crimson.parser.Parser2.parse(Unknown Source)
> >      at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
> >      at javax.xml.parsers.SAXParser.parse(Unknown Source)
> >      at
> > org.apache.axis.encoding.DeserializationContext.parse(DeserializationContex
> >t .java:227)
> >      at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> >      at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> >      at
> > org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandCh
> >e cker.java:62)
> >      at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> >      at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> >      at org.apache.axis.client.Call.invoke(Call.java:2748)
> >      at org.apache.axis.client.Call.invoke(Call.java:2424)
> >      at org.apache.axis.client.Call.invoke(Call.java:2347)
> >      at org.apache.axis.client.Call.invoke(Call.java:1804)
> >      at
> > com.wmode.clearmode.applications.provisioningengine..ConsumerProvisionSoapB
> >i ndingStub.add(ConsumerProvisionSoapBindingStub.java:119)
> >      at
> > com.wmode.clearmode.applications.provisioningengine.ClientTest.main(ClientT
>

Re: web service style

2006-01-08 Thread Dink
Hi Dies,

I have noticed your answer does not include the "Message" style and the most
confusing thing is about it. I can not realize what the message
style means since it is not defined in WSDL spec.  Can you point me some
directions or any document? Besides, I have found the axis user
guide define the service provider can be either RPC or MSG. However, there
is no clear definition of RPC and MSG in the axis user guide.
Do the MSG mean the service style is "Message" described above? Is there any
relationship between "service provider" and "use/style"?

Thanks for your reply,
Dink Lo

Dies wrote:
> Hello Dink,
>
> The JAX-RPC 1.1 spec describes the "wrapped" style briefly. It is a
> variation of Document/literal, and is the recommended style/use to use.
>
> With Axis, you have:
> Document/literal(wrapped): -s WRAPPED -y literal
> Document/literal: -s DOCUMENT -y literal
> RPC/literal: -s RPC -y literal
> RPC/encoded: -s RPC -y encoded
>
> I have never seen Document/encoded, maybe Axis doesn't even support it.
>
> #In case of Document/literal(wrapped), the WSDL says style="document",
> but SOAP engines use some criteria to recognize that they are "wrapped".
> The WSDD says "wrapped" if it recognized a Document/literal port as
> being Document/literal(wrapped).
>
> Regards,
> Dies



Custom Serializer

2006-01-08 Thread Todd Orr
Does anyone know of any tutorials on custom serialization? I've been hacking through the BeanSerializer, but my results are not encouraging. Thanks.-T


axis 1.3 empty arrays

2006-01-08 Thread stefan freyhult
 Hi!    I am currently experiencing problems with Axis 1.3. It seems that 1.3 does not handle arrays properly when used in conjuction with .Net.
Code that works fine with Axis 1.2.1 returns empty arrays in when usedwith a .Net client, the code does however work fine when the service is consumed by java clients.   This is a major flaw, has this been looked into? 
   Thanks,    Stefan