• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting an exception org.xml.sax.SAXException: Bad types

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you help me with my problem??? I have a problem in running my Axis Client. It gives me "org.xml.sax.SAXException: Bad types" exception.
My webservice returns an array of Books (Books[]). My client will login with username/password then send a query, then print all the titles of the book.
Thank you in advance!

Here is the snippet of my client:

public static void main(String [] args) throws Exception{Service service = new Service();Call call = (Call) service.createCall();QName qn = new QName( "urn:BookService", "mypackage.Book" );call.registerTypeMapping(mypackage.Book.class, qn, new org.apache.axis.encoding.ser.BeanSerializerFactory(mypackage.Book, qn), new org.apache.axis.encoding.ser.BeanDeserializerFactory(mypackage.Book, qn)); try {URL url = new URL("http://localhost:8080/axis/services/BookService"); call.setTargetEndpointAddress(url); call.setOperationName( new QName("BookService", "getBooks") );call.addParameter( "username", XMLType.XSD_STRING, ParameterMode.IN );call.addParameter( "password", XMLType.XSD_STRING, ParameterMode.IN );call.addParameter( "where", XMLType.XSD_STRING, ParameterMode.IN );call.setReturnType(qn);Object result = call.invoke(new Object [] { args[0], args[1], args[2]});if (result!=null){Book book[] = (Book[]) result;for (int i=0; i<book.length ; i++){System.out.println("BOOK="+book[ i ].getName());}} } catch (AxisFault fault) {System.err.println("Generated fault: ");System.out.println (" Fault Code = " + fault.getFaultCode()); System.out.println (" Fault String = " + fault.getFaultString());fault.printStackTrace();}}

More Detailed stacktrace
- Exception:
org.xml.sax.SAXException: Bad types (class [Ljava.lang.Object; -> class mypackage.Book)
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:302)
at org.apache.axis.encoding.DeserializationContextImpl.startElement(Dese
rializationContextImpl.java:912)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.ja
va:200)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElemen a

please reply me :satyan4@rediffmail.com
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this to the web services forum...
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Today I meet this problem,but I do not know how to deal with this problem.
If you know this result,please tell me ,thanks a lot .
my detail error is like these:
Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: Bad types (class java.lang.String ->
class java.math.BigInteger)
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:anmei

org.xml.sax.SAXException: Bad types (class java.lang.String -> class java.math.B
igInteger)
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder
 
It sure was nice of your sister to lend us her car. Let's show our appreciation by sharing this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic