Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
JDOM w/ Apache Axis

JDOM w/ Apache Axis

2004-04-13       - By Jerry Jalenak

 Back
Greetings All!

I'm fairly new to using JDOM to generate XML, so bear with me.  I'm in the
processing of writing a web service using Apache Axis.  As part of my
'learning' process, I've been able to have a dotNet client hit my web
service and retrieve a basic String, a basic JavaBean, and an Array object
from the JavaBean.  I'm now trying to generate a XML document using JDOM,
and pass it back to the client.  Here's my basic 'HelloWorld'
implementation:

package ws;

import org.jdom.Element Source code of org.jdom.Element;

/**
* @(protected) jjalenak
*
*/
public class HelloWorldImpl implements HelloWorld
{
  /* (non-Javadoc)
  * @(protected) ws.HelloWorld#hello()
  */
  public Document hello() throws Exception
  {
    Document _d = new Document();
   
      Element _e = new Element("root");
      _e.setText("Hi There!");

    _d.setRootElement(_e);
    return _d;
  }

  /* (non-Javadoc)
  * @(protected) ws.HelloWorld#goodbye()
  */
  public Document goodbye() throws Exception
  {
    Document _d = new Document();
   
      Element _e = new Element("root");
      _e.setText("Good Bye!");

    _d.setRootElement(_e);
    return _d;
  }
}

When I ran the WSDL2JAVA emitter, it created a 'Document' bean in my 'ws'
package, and removed the import for the org.jdom.Document Source code of org.jdom.Document  The web service
deploys on Tomcat (5.0.18) without any problems.  When I try to call the web
service from my test Java web app, I get the following exception:

exception is (500)Internal Server Error
AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (500)Internal Server Error
faultActor:
faultNode:
faultDetail:
  {}string: return code:  500

Digging into this, I found what I think is the 'true' problem :
java.io.IOException Source code of java.io.IOException: No serializer found for class org.jdom.Element Source code of org.jdom.Element in
registry org.apache.axis.encoding.TypeMappingImpl@(protected)  It appears that
although WSDL2JAVA converted the Document object to a proper bean, it didn't
do the Element object.  I not quite sure where to go from here, so if anyone
has some guidance, I'd sure appreciate it.  Better yet, if someone has a
working example of an Axis-based webservice using JDOM that they can share,
I'd also appreciate being able to get a look at it.

Thanks!

Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

jerry.jalenak@(protected)


This transmission (and any information attached to it) may be confidential and
is intended solely for the use of the individual or entity to which it is
addressed. If you are not the intended recipient or the person responsible for
delivering the transmission to the intended recipient, be advised that you
have received this transmission in error and that any use, dissemination,
forwarding, printing, or copying of this information is strictly prohibited.
If you have received this transmission in error, please immediately notify
LabOne at the following email address: securityincidentreporting@(protected)

__ ____ ____ ____ ____ ____ ____ ____ ____ ____
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)
.com

©2008 junlu.com - Jax Systems, LLC, U.S.A.