axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shams jawaid <>
Subject SAXParser Help, *Urgent*
Date Fri, 07 Dec 2007 15:16:08 GMT

Hi  Im been trying below to make it work since 4 weeks now. Any 1 please help me.  i have
attached:,, saxparser.jar, test.xml in the
file, please have a look     I'm trying to reterive xml file attributes on Client-side when
accessing web service. Actually I have more than 1 web services and I want my client take
address of each webservice from xml at runtime(XML file is attached). I'm using SAX Parser
for XML. I made a jar file of SAX Parser classes ( &
Both classes are SAXPArser) and put that in axis2/WEB-INF/lib. the problem is when Im accessing
this jar file getting error of MYSAXParseBean is undefined class. where as the same java coding
works well when I access SAX Parser classes as pure java. Following is the code which I use
to retrieve the attribute ( which works as Java but not as JSP). So If I put all this in conclusion
I have an XML file and SAXParserBean & MyElement are SAXParser classes and the code below
to access the SAXParser to retrieve and print. <%@ page import='*,org.apache.axis2.client.*,org.apache.axis2.addressing.*,*,javax.xml.namespace.*,java.util.Iterator,javax.activation.DataHandler,java.awt.Image,javax.imageio.ImageIO,org.apache.axis2.Constants,org.apache.axis2.engine.DefaultObjectSupplier,org.apache.axis2.*,org.xml.sax.Attributes.*,saxparser.*,java.util.*,
javax.servlet.http .* ' %>  <% try { MySAXParserBean p = new MySAXParserBean(); Collection
v = p.parse('c://test.xml');Iterator it = v.iterator();while(it.hasNext()) {MyElement element
= (MyElement);String tag = element.getLocalName();String qName = element.getQname();String
at = element.getAttributes();String url = element.getAttributes1();if(qName.equals('HSP'))
{if(at.equals('HSP1')){out.println('Attribute HSP: ' + at); out.println('Attribute HSP: '
+ url);}else if(at.equals('HSP2')){out.println('Attribute HSP2: ' + at); out.println('Attribute
HSP2: ' + url);}else if(at.equals('HSP3')){out.println('Attribute HSP3: ' + at); out.println('Attribute
HSP3: ' + url);}else if(at.equals('HSP4')){System.out.println('Attribute HSP4: ' + at); System.out.println('Attribute
HSP4: ' + url);}else if(at.equals('HSP5')){out.println('Attribute HSP5: ' + at); out.println('Attribute
HSP5: ' + url);}else if(at.equals('HSP6')){out.println('Attribute HSP6: ' + at); out.println('Attribute
HSP6: ' + url);}else if(at.equals('HSU1')){System.out.println('Attribute HSPU: ' + at); out.println('Attribute
HSPU: ' + url);}} else if(qName.equals('HSU')) {out.println('Attribute HSU: ' +url);} } }
catch (Exception e) {}%>
Who's friends with who and co-starred in what?
View raw message