axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsri <jay...@gmail.com>
Subject Re: axis1.3-ClassCast Exception at call.invoke
Date Wed, 23 Nov 2005 17:23:13 GMT
Ketan, I guess, axis source  is attached.Pls find the attached
SOAPBIindingStub. Pls go throught and let me know.

jsri

On 11/23/05, Ketan Deshpande <deshpande_ketan@yahoo.com> wrote:
>
> If you are running Windows, You can use Ethereal or other n/w analyzers to
> look
> at the traffic going to/from the server. You can also use other SOAP
> analyzers
> - see Mindreef Soapscope and other such programs. http://www.soapui.org/
>
> You can still debug the client side - you need to attach the axis source
> when
> you want to step into _call.invoke.
>
> If you want to test whether the SOAP service is coded properly - you can
> try
> other tools that can independently test the web service.
>
> This may be overkill for the problem you are facing - but that's what I
> can
> think of, right now... :-)
>
> -K
>
> --- jsri <jayskm@gmail.com> wrote:
>
> > Hi Ketan,
> >
> > Thanks for responding. I generated the java classes and stub using axis.
> App
> > server is not running on my box.  I'm developing client code to access
> > webservice. Can i still install, try running the tcpmon to check  SOAP
> > req/res.
> >
> > Thanks,
> > jsri
> >
> >
> >
> >
> >
> >
> > i checked the SOAP response
> >
> >
> > On 11/22/05, Ketan Deshpande <deshpande_ketan@yahoo.com> wrote:
> > >
> > > Can you look at the SOAP response - use tcpmon or some other n/w
> sniffer
> > > to
> > > actually look at the SOAP request/response between client and server?
> > >
> > > The other way to debug that I can think of is to debug the call.invoke-
> > > download the source for 1.3 and step thru...
> > >
> > > -K
> > >
> > > --- jsri <jayskm@gmail.com> wrote:
> > >
> > > > Thanks for responding. yes, bean mappings are defined.
> > > >
> > > > On 11/22/05, Developer Developer <devquestions@gmail.com> wrote:
> > > > >
> > > > > you have defined the bean mappings required for serialization and
> > > > > deserialization at the server and client side ?
> > > > >
> > > > >
> > > > >  On 11/21/05, jsri <jayskm@gmail.com> wrote:
> > > > > >
> > > > > >
> > > > > >  Hello all
> > > > > > >
> > > > > > > I'm a newbie to webservices. I'm trying to consume
> webservices.
> > > I'm
> > > > > > > using axis1.3 ,Eclipse IDE. Using axis i got the java &
stub
> > > classes
> > > > > > > generated. I'm able to receive string literals from
> webservice.
> > > Problem
> > > > > > > comes with objects..bean. This is the scenairo of the
> > > > application...When i
> > > > > > > send an Patient ID to the webservices it returns demographic
> > > > information
> > > > > > > related to the Patient ID.
> > > > > > >
> > > > > > > (a) Query record -method returns Patient record for the
> requested
> > > > > > > Patient-MPI ID
> > > > > > > 1. I sent an invalid MPI ID. I got msg from webservice-
"MPI
> ID
> > > > > > > doesn't exists" .
> > > > > > > 2.When i send the existing MPI ID i get ClassCastException.
> > > > > >
> > > > > >
> > > > > > It show the error at call.invoke().I tried using the same jar
> files
> > > used
> > > > > > > by the webservice provider to generate java calsses
> &stubs.still
> > > got
> > > > the
> > > > > > > same errors. I attached wsdl and soapbindingstub class.I'm
> pasting
> > > the
> > > > > > > code snippets&stack trace below.
> > > > > > >
> > > > > > > Generated SoapBindingStub.java
> > > > > > >
> *****************************************************************
> > > > > > > public com.stchome.mpi.MPIQueryReply
> > queryRecord(java.lang.Stringin0,
> > > > > > > long in1) throws java.rmi.RemoteException {
> > > > > > >
> > > > > > >
> > > > > > > if (super.cachedEndpoint == null) {
> > > > > > > throw new org.apache.axis.NoEndPointException();
> > > > > > > }
> > > > > > >
> > > > > > >
> > > > > > > org.apache.axis.client.Call _call = createCall();
> > > > > > > _call.setOperation(_operations[0]);
> > > > > > > _call.setUseSOAPAction(true);
> > > > > > > _call.setSOAPActionURI("");
> > > > > > > _call.setSOAPVersion(
> > > > > > > org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
> > > > > > > _call.setOperationName(new javax.xml.namespace.QName
> ("urn:mpi",
> > > > > > > "queryRecord"));
> > > > > > >
> > > > > > > setRequestHeaders(_call);
> > > > > > >  setAttachments(_call);
> > > > > > >
> > > > > > > try {
> > > > > > >
> > > > > > > java.lang.Object _resp = _call.invoke(new java.lang.Object
[]
> > > {in0,
> > > > > > > new java.lang.Long(in1)});
> > > > > > >
> > > > > > > if (_resp instanceof java.rmi.RemoteException) {
> > > > > > > throw (java.rmi.RemoteException)_resp;
> > > > > > > }
> > > > > > > else {
> > > > > > > extractAttachments(_call);
> > > > > > > try {
> > > > > > > return (com.stchome.mpi.MPIQueryReply) _resp;
> > > > > > > }
> > > > > > > catch (java.lang.Exception _exception) {
> > > > > > > return (com.stchome.mpi.MPIQueryReply)
> > > > > > > org.apache.axis.utils.JavaUtils.convert(_resp,
> > > > > > > com.stchome.mpi.MPIQueryReply.class);
> > > > > > > }
> > > > > > > }
> > > > > > > } catch (org.apache.axis.AxisFault axisFaultException)
{
> > > > > > > throw axisFaultException;
> > > > > > > }
> > > > > > >
> > > > > > > }
> > > > > > >
> *****************************************************************
> > > > > > > ClientTest.java Query Record
> > > > > > >
> ******************************************************************
> > > > > > > public void QueryMPI() throws Exception {
> > > > > > >
> > > > > > > java.lang.String in0String = new String("system"); //mpi
user
> > > > > > > long in1Long = 17831;
> > > > > > >
> > > > > > > try{
> > > > > > >
> > > > > > > MPIServiceLocator temp = new MPIServiceLocator();
> > > > > > > MPI mpi = temp.getMPI();
> > > > > > >
> > > > > > > com.stchome.mpi.MPIQueryReply x = mpi.queryRecord
> > > (in0String,in1Long);
> > > > > > >
> > > > > >
> > > > > >   System.out.println((x.getRecord()).getFirstName());
> > > > > > >
> > > > > > > System.out.println("Status : " + x.getStatus ());
> > > > > > > System.out.println("Status String : " + x.getStatusString());
> > > > > > > }
> > > > > > >
> > > > > > >
> > > >
> > >
> >
> *****************************************************************************
> > > > > > > AxisFault
> > > > > > > faultCode: {
> > > >
> >
> http://schemas.xmlsoap.org/soap/envelope/}Server.userException<
> http://schemas.xmlsoap.org/soap/envelope/%7DServer.userException>
> > > > > > > <
> http://schemas.xmlsoap.org/soap/envelope/%7DServer.userException
> > > >
> > > > > > >  faultSubcode:
> > > > > > > faultString: java.lang.ClassCastException
> > > > > > > faultActor:
> > > > > > > faultNode:
> > > > > > > faultDetail:
> > > > > > >  {
> > >
> >
> http://xml.apache.org/axis/}stackTrace:java.lang.ClassCastException<
> http://xml.apache.org/axis/%7DstackTrace:java.lang.ClassCastException>
> > > > > > > <
> > > http://xml.apache.org/axis/%7DstackTrace:java.lang.ClassCastException>
> > > > > > > at org.apache.axis.message.SOAPFaultBuilder.createFault
(
> > > > > > > SOAPFaultBuilder.java:222)
> > > > > > > at org.apache.axis.message.SOAPFaultBuilder.endElement(
> > > > > > > SOAPFaultBuilder.java:129)
> > > > > > > at org.apache.axis.encoding.DeserializationContext.endElement(
> > > > > > > DeserializationContext.java:1087)
> > > > > > > at org.apache.xerces.parsers.AbstractSAXParser.endElement
> (Unknown
> > > > > > > Source)
> > > > > > >  at
> > > > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
> > > > > > > Source)
> > > > > > > at
> > > > > > >
> > > >
> > >
> > >
> >
>
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
> > > (Unknown
> > > > Source)
> > > > > > > at
> > > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
> > > (Unknown
> > > > > > > Source)
> > > > > > > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > > Source)
> > > > > > > at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
> > > Source)
> > > > > > > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > > > > > > at org.apache.xerces.parsers.AbstractSAXParser.parse (Unknown
> > > Source)
> > > > > > > at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> > > > > > > at org.apache.axis.encoding.DeserializationContext.parse(
> > > > > > > DeserializationContext.java :227)
> > > > > > > at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> > > > > > > at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
> > > > > > > at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(
> > > > > > > MustUnderstandChecker.java:62)
> >
> === message truncated ===
>
>
> Ketan Deshpande
> deshpande_ketan@yahoo.com
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>

Mime
View raw message