Org.w3c.dom - Parsing?

Hi everyone,
I'm making a very small library for accessing resources. I want to be able to access them through XML, amongst others. I figured W3C DOM is the best approach. But! Is there any standard for parsing the documents? I would like a org.w3c.ParserFactory.createDefaultParser().parse() method. Is something like this available? Otherwise I will have to make an adapter for every implementation I use, and that's not any fun...
BTW
I am not familiar with the W3C DOM API. Is the parsing procedure specified? I've only seen the DOM in the API.
Thanks in advance,
Nille

Other wise known as JAXP. Click on the link to the left for XML and you'll find out more than you wanted to know...

Similar Messages

  • Java.lang.ClassCastException: oracle.xml.parser.v2.XMLText cannot be cast to org.w3c.dom.Element

    Hello
    I am getting java.lang.ClassCastException: oracle.xml.parser.v2.XMLText cannot be cast to org.w3c.dom.Element error. This code is in java which is present in java embedding.
    The SOA is parsing the xml in java code using oracle.xml.parser.v2 . This wont be a problem if the SOA uses default w3c DOM parser. How do i force SOA to use w3c DOM parser.
    Is there any thing i can do with class loading?
    Kindly help.
    Regards
    Sharat

    Can you paste your java code here ? I assume, you must have tried type-casting.

  • XML Parsing exception: org.w3c.dom.ls.LSException

    Hi All,
    <p>We have a WSM(Webservice Management Application) product which will generate a 'Proxy WSDL URL' for a 'Real WSDL URL' and it does security/auditing/logging/routing and other stuffs at runtime while getting a webservice request (on Proxy WSDL) and route it to the Functional(Real WSDL URL - Application server where the actual webservice is deployed) endpoint.
    On receiving response from the functional endpoint, it again comes back to WSM which has to just give the response back to the user unless and until some special policies are attached (like schema validation policy - it will validate the response body based on the schema XSD) </p>
    <p/>
    <p>Here, while reading the response (from functional/application endpoint) over the wire and at the time of creating the actual SoapResponse (XmlResponse) for the end user
    xercesImpl.jar is used to parse the data -lsParser.parse(lsInput); which is throwing the exception <b>"org.w3c.dom.ls.LSException: An invalid XML character (Unicode: 0x16) was found in the element content of the document" </b>when it sees not properly formatted XML at any cause (having incompatible data/special character).</p>
    <p/>
    <p><b>As the exception does not even give enough information like where the XML is corrupt/having incompatible data/special character, we cant have a control to do anything from our application/product side ,as it is third party jar xercesImpl.jar. It would be really very helpful if we
    > either get a option/boolean to turn off the validation logic which is done internally in xercesImpl.jar at the time of parsing 'lsParser.parse(lsInput);'
    > or get additional information in the exception (original cause - like the incompatible/special character (or) a full corrupted response in the exception itself) with which we can get a clue to resolve the issue.</b></p>
    <p/>
    Thanks in Advance
    Priya

    I did a search on Sun site, nothing came back.
    It is on http://xml.apache.org/xerces2-j though.
    You might need to go there and download it. or make sure your
    classpath includes the right jar file.

  • Problem casting org.w3c.dom.Document to oracle.xml.parser.v2.XMLDocument

    I have the following problem:
    I get my xml-documents as an XMLType from the database and want to compare these using the supplied Oracle class oracle.xml.differ.XMLDiff (i use the java version supplied with Oracle 9i r2).
    XMLType.getDOM() returns the xml-document as a org.w3c.dom.Document,
    what i need for oracle.xml.differ.XMLDiff is a oracle.xml.parser.v2.XMLDocument.
    How can i cast/convert between these two formats?
    thanks!
    p.s. cross-posting with Re: Casting/Converting XMLType to XMLDocument? (but i think this forum is more relevant).

    Hi,
    thanks for the suggestion: i have written the code shown below. It results in a casting error.
    As far as i know, i don't use a oracle.xdb.dom.XDBDocument, i only use a oracle.xdb.XMLType as the input parameter for my conversion-method:
    any new suggestions ???
    p.s. the second method which is commented does work, but is a bit verbose.
       private static oracle.xml.parser.v2.XMLDocument convert2XMLDocument(XMLType xml) {
         // simple version (should work according to tech. doc. 9i r2/ 10g r1 database)
         oracle.xml.parser.v2.XMLDocument doc = null;
         try {
            // n.b. probleem is dat XMLType.getDOM() een w3c.Document object teruggeeft ipv een oracle.XMLDocument.
            System.out.println("convert2XMLDocument(): casting w3c.Document naar oracle.XMLDocument.");
            doc = (oracle.xml.parser.v2.XMLDocument) xml.getDOM(); // public org.w3c.dom.Document getDOM()
            System.out.println("convert2XMLDocument(): done casting w3c.Document naar oracle.XMLDocument.");
         catch (Exception e) {
            e.printStackTrace(System.out);
        return doc;
       private static XMLDocument convert2XMLDocument(XMLType xml) {
         // complex version: works ok !!!
         XMLDocument doc = null;
         try{
            DOMParser parser  = new DOMParser();
            parser.setValidationMode(oracle.xml.parser.v2.XMLParser.NONVALIDATING);
            parser.setPreserveWhitespace (true);   
            parser.parse(new StringReader(xml.getStringVal()));
            doc = parser.getDocument();
        catch ( XMLParseException e ) {
          e.printStackTrace(System.out);
        catch ( SQLException e ) {
          e.printStackTrace(System.out);
        catch ( Exception e ) {
          e.printStackTrace(System.out);
        return doc;
    convert2XMLDocument(): casting w3c.Document naar oracle.XMLDocument.
        java.lang.ClassCastException: oracle.xdb.dom.XDBDocument
         at pnb.bdb.xml.testJDBC.convert2XMLDocument(testJDBC.java:305)
         at pnb.bdb.xml.testJDBC.main(testJDBC.java:187)

  • How to parse & update org.w3c.dom.Document

    Hi,
    I have a org.w3c.dom.Document "w3Doc" object which is converted to org.jdom.Document object using DOMBuilder().build(w3Doc) method.
    Now the problem which I'm facing is that this org.w3c.dom.Document object contains an illegal xml character & when DOMBuilder().build() method tries to create JDOM doc/tree from org.w3c.dom.Document it raises IllegalDataException & the application errors up.
    Now, I want to parse org.w3c.dom.Document "w3Doc" object & check for illegal xml character in the w3Doc & remove this character.
    Can anyone help me out in finding which parser should I use to read w3Doc & update the doc(by removing the illegal data).
    Thanks in advance,

    Normally a Document is the output of a parser, not the input to one. And all the parsers I know of will not allow invalid XML characters to pass. So it must be that you're creating Text nodes in your program that include invalid XML characters and adding them to a Document. (I'm surprised that the DOM implementation allows you to do that.)
    So you should just stop doing that, instead of trying to find something to clean up the mess after the fact. The XML Recommendation, in section 2.2, tells you what characters are valid in XML. You can find it here:
    http://www.w3.org/TR/REC-xml/

  • Invoking BPEL process from Java servlet with org.w3c.dom.Element as payload

    Hello,
    I'm trying to initiate a BPEL process from my servlet running under Tomcat. When I create the NormalizedMessage passing the XML as a String everything works fine. But if I use an org.w3c.domElement the BPEL server doesn't react at all (even on DEBUG log level there are no outputs).
    This works:
    NormalizedMessage message = new NormalizedMessage();
    message.addPart("payload", "<foo></foo>");
    This doesn't work:
    org.w3c.dom.Element elem;
    oracle.xml.parser.v2.XMLDocument xmlDocument;
    NormalizedMessage message = new NormalizedMessage();
    Element elem = xmlDocument.createElement("foo");
    message.addPart("payload", elem);
    Is there a known problem with payloads using Element or did I get something completely wrong? Thanks in advance,
    Hans.

    Hello,
    I'm trying to initiate a BPEL process from my servlet running under Tomcat. When I create the NormalizedMessage passing the XML as a String everything works fine. But if I use an org.w3c.domElement the BPEL server doesn't react at all (even on DEBUG log level there are no outputs).
    This works:
    NormalizedMessage message = new NormalizedMessage();
    message.addPart("payload", "<foo></foo>");
    This doesn't work:
    org.w3c.dom.Element elem;
    oracle.xml.parser.v2.XMLDocument xmlDocument;
    NormalizedMessage message = new NormalizedMessage();
    Element elem = xmlDocument.createElement("foo");
    message.addPart("payload", elem);
    Is there a known problem with payloads using Element or did I get something completely wrong? Thanks in advance,
    Hans.

  • Document in org.w3c.dom.*??

    Is Document in org.w3c.dom.* a file?what is its extension?
    How can i write a file with it?

    org.w3c.dom.Document is a class that represents an XML document.
    It does not represent an XML stream as mlk says.
    It doesn't have anything to do with files. You can use an XML parser to build up a Document in memory from an XML file or any other data source that produces XML. Class org.w3c.dom.Document does not have any methods by itself that you can use to write to an XML file.
    XML files usually have the extension ".xml", but they can also have other extensions.
    See this: Working with XML: The Java/XML Tutorial

  • Org.w3c.dom.Document to/from String ?

    I need to be able to parse (once) an XML string, and then pass the parsed object around to/from different objects.
    I tried to use org.w3c.dom.Document,
    generated by javax.xml.parsers.DocumentBuilder .
    HOWEVER - I don't see any way to parse an xml String!
    The doc-builder parse() method accepts either a file/url, or an InputStream.
    When I tried to use the StringBufferInputStream I found-out it is deprecated, and that I should use StringReader.
    BUT I cannot parse using StringReader ! (the method parse() doesn't work with it)
    Is there anyway to parse a String to create a Document ?
    ========================================================
    And that's only HALF my problem:
    I did parse an input file into a Document, to experiment a little.
    I then wanted to convert it to an XML String - but couldn't.
    How do I get the xml String from a Document ?
    I cannot: How do I save it to a file ?
    I must say that under .NET both tasks are TRIVIAL:
    XmlDocument.LoadXML()
    XmlDocument.OuterXml
    Thanks
    Meir

    The doc-builder parse() method accepts either a file/url, or an InputStream.This isn't true. Look it up again. There are overridden versions of parse() that use File, InputSource, InputStream, or String. The String one isn't what you want, because the String it takes is a URL pointing to the XML and not the XML itself. The File one doesn't work for you because you don't have a file, and you've already said why the InputStream one doesn't work for you.
    So that leaves the version that takes an InputSource. So, what is an InputSource anyway? You could look it up just by clicking on the link in the API docs...

  • Cost of creating org.w3c.dom.Node

    I am trying to create an xml of cached data at run time. I need to know if this would increase the response time considerably ..?
    Is there any documents which talk about the cost of creating nodes(e.g.within loops) ..?
    public Node createnode(Document d, String node_name, int node_value) {
    org.w3c.dom.Node temp_element_node, temp_text_node;
    temp_element_node = d.createElement(node_name);
    temp_text_node = d.createTextNode(node_name);
    temp_text_node.setNodeValue(node_value + "");
    temp_element_node.appendChild(temp_text_node);
    return temp_element_node;
    Has anybody implimented a pool of nodes(like pool of database connections). Any information is appreciated!

    It would certainly depend somewhat on which parser you were using, but i can't imagine it would be any more costly than any other type of object.

  • Help: program error: package org.w3c.dom does not exist

    i 've already downloaded and unpacked the java-xml-pack by following the given instruction. again when i compile the program, the compiler still can't locate the package.. org.w3c.dom where i've already import org.w3c.dom.* at the beginning of the program. so, until now, the symbol like Document, Node still can't be resolved.
    is there any important step that i've missed ??

    Even I have faced the same problem, the Reasons can be:
    1. Take the latest packages of all the JAR files U need for XML Parsing.
    2. Set the class path for all the JAR files.
    2nd thing should be the reason for U getting the error.
    All The Best.

  • Importing package org.w3c.dom

    Hi,
    I am quite new to Java programming. Therefore solving my prob. is surely kind of obvious to a lot of you guys...
    For my program I need a type named "Element" defined in org.w3c.dom. Though I did not use the type directly anywhere in my code, my Builder (Eclipse) told me that it could not build my prog because: "The compilation unit indirectly references the missing type org.w3c.dom.Element"
    I tried to import that package:
    1. downloaded the zip (downloded http://www.w3.org/TR/2002/WD-DOM-Level-3-LS-20020725/java-binding.zip)
    2. put it in a subfolder of my project
    3. set the classpath correctly
    4. added import org.w3c.dom.* to my prg (adding "import org.w3c.dom.Element" results in an error)
    After that he properly imported the package as the import line of code was not underlined in red anymore. Nevertheless the annoying error message (The comp. unit indirectly...) did not disappear. I still can not build the prog. So I expected not to find the type "Element" defined in that package. But unziping the package showed me that there is in fact a type named "Element" in "./org/w3c/dom".
    Maybe it is worth noting that using the "Java Browsing" functionality of my Eclipse on this package results in "Selected package fragment does not contain any Java resource". The package symbol in the tree structure is displayed in gray instead of yellow too (all yellow packages permit browsing).
    Does anyone have a clue how to overcome that da... prob?
    Must the package be compiled before, as there are no classes within? And if yes, how do I accomplish that?
    Regards
    Matthias

    Even I have faced the same problem, the Reasons can be:
    1. Take the latest packages of all the JAR files U need for XML Parsing.
    2. Set the class path for all the JAR files.
    2nd thing should be the reason for U getting the error.
    All The Best.

  • Validate org.w3c.dom.Element against xsd

    I need to validate a org.w3c.dom.Element against an xsd.
    DOMParser dp = new DOMParser();
    URL xmlurl = new URL("file:\\test.xml");
    XSDBuilder builder = new XSDBuilder();
    URL xsdurl = new URL("file:\\test.xsd");
    XMLSchema schemadoc = (XMLSchema)builder.build(xsdurl);
    dp.setXMLSchema(schemadoc);
    dp.setValidationMode(XMLParser.SCHEMA_LAX_VALIDATION);
    dp.setPreserveWhitespace(true);
    dp.setErrorStream (System.out);
    System.out.println("Parsing "+xmlurl);
    dp.parse(xmlurl);
    This works when my input is an xml file. I cannot get it work against an element. If I convert the element as a string or inputsource it gives the error
    "XML-20220: (Fatal Error) Invalid InputSource.
    java.net.MalformedURLException: no protocol:"
    Any idea how it can be done? I am using jdeveloper 10.1.2
    Thanks
    MM

    Thanks for the reply. I get the following error.
    Exception in thread main
    oracle.xml.parser.v2.XMLDOMException: cannot add a node belonging to a different document
    at oracle.xml.parser.v2.XMLNSNode.checkNodePermissions(XMLNSNode.java:854)
    at oracle.xml.parser.v2.XMLNSNode.appendChild(XMLNSNode.java:257)
    at oracle.xml.parser.v2.XMLDocument.appendChild(XMLDocument.java:1010)
    at test.parser.ParseTest.parse1(ParseTest.java:136)
    at test.parser.ParseTest.main(ParseTest.java:63)
    Process exited with exit code 1.
    This is my code
    public void parse1(Element elem) {
    try{
    //Element docElement;
    //Node elemNode=(Node)docElement;
    DOMParser dp1 = new DOMParser();
    XMLDocument xmlDocument=new XMLDocument();
    xmlDocument.appendChild(elem);
    ByteArrayOutputStream docOutputStream = new ByteArrayOutputStream();
    xmlDocument.print(docOutputStream);
    ByteArrayInputStream docInputStream = new ByteArrayInputStream(docOutputStream.toByteArray());
    InputSource inputSource = new InputSource(docInputStream);
    dp1.parse(inputSource);
    catch (IOException e){e.printStackTrace();}
    catch (XMLParseException e){e.printStackTrace();}
    catch (SAXException e){e.printStackTrace();}
    Thanks
    MM

  • Java.lang.NoClassDefFoundError: org/w3c/dom/xpath/XPathEvaluator

    here is the tiresome problem, which has puzzled me for 5 days.
    2008-7-11 15:58:03 org.apache.catalina.core.StandardWrapperValve invoke
    ����: Servlet.service() for servlet MapRequest threw exception
    java.lang.NoClassDefFoundError: org/w3c/dom/xpath/XPathEvaluator
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1812)
         at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:866)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1319)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1812)
         at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:866)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1319)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1812)
         at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:866)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1319)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at org.apache.batik.dom.svg.SVGDOMImplementation.createDocument(Unknown Source)
         at org.apache.batik.dom.util.SAXDocumentFactory.startElement(Unknown Source)
         at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:434)
         at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(XMLNamespaceBinder.java:832)
         at org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinder.java:568)
         at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:796)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:752)
         at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(XMLDocumentScannerImpl.java:927)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1519)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
         at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:529)
         at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:585)
         at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
         at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1148)
         at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
         at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
         at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown Source)
         at cn.edu.tongji.hpcc.tigcn.webgis.SVGMapGenerator.<clinit>(SVGMapGenerator.java:51)
         at cn.edu.tongji.hpcc.tigcn.webgis.servlet.MapRequestServlet.doGet(MapRequestServlet.java:70)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    2008-7-11 15:58:03 org.apache.catalina.core.StandardWrapperValve invoke
    ����: Servlet.service() for servlet MapRequest threw exception
    java.lang.NoClassDefFoundError
         at cn.edu.tongji.hpcc.tigcn.webgis.servlet.MapRequestServlet.doGet(MapRequestServlet.java:70)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    help me! thank you very much :)

    First,download xalan-j_2_7_0-bin.zip, unpack it.
    Then, place the xalan.jar, serializer.jar, xercesImpl.jar and xml-apis.jar in the
    <catalina-home>\common\endorsed directory.
    At last, reboot your TOMCAT.

  • No Serializer found to serialize a 'org.w3c.dom.Element' using encoding style ...

    I use oc4j903 and win2k. I write a document style web service following Demo for Stateless Java Document Web Services.
    I Create an EAR file using WebServicesAssembler and deploy it .and my config.xml:
    <web-service>
    <display-name>Stateful Java Document milkdemo Web Service</display-name>
    <description>Stateful Java Document milkdemo Web Service Example</description>
    <!-- Specifies the resulting web service archive will be stored in ./docws.ear -->
    <destination-path>./milkdemo.ear</destination-path>
    <!-- Specifies the temporary directory that web service assembly tool can create temporary files. -->
    <temporary-directory>./temp</temporary-directory>
    <!-- Specifies the web service will be accessed in the servlet context named "/docws". -->
    <context>/milkdemo</context>
    <!-- Specifies the web service will be stateful -->
    <stateful-java-service>
    <interface-name>com.brightdairy.client.sync.SyncServerDoc</interface-name>
    <class-name>com.brightdairy.client.sync.SyncServerDocImpl</class-name>
    <!-- Specifies the web service will be accessed in the uri named "/docService" within the servlet context. -->
    <uri>/milkdemo</uri>
    <!-- Specifies the location of Java class files ./classes -->
    <java-resource>./classes</java-resource>
    <!-- Specifies that it uses document style SOAP messaging -->
    <message-style>doc</message-style>
    </stateful-java-service>
    <!-- generate the wsdl -->
    <wsdl-gen>
         <wsdl-dir>wsdl</wsdl-dir>
    <!-- over-write a pregenerated wsdl , turn it 'false' to use the pregenerated wsdl-->
         <option name="force">true</option>
         <option name="httpServerURL">http://localhost:8888</option>
    </wsdl-gen>
    <!-- generate the proxy -->
    <proxy-gen>
         <proxy-dir>proxy</proxy-dir>
         <option name="include-source">true</option>
    </proxy-gen>
    </web-service>
    my webservice java file:
    * Title: BrightDairy SOAP demo
    * Description:
    * Copyright: Copyright (c) 2002
    * Company: ufoasia
    * @author
    * @version 1.0
    package com.brightdairy.client.sync;
    import java.sql.*;
    import java.util.Vector;
    import java.util.Iterator;
    import org.w3c.dom.Element;
    import org.w3c.dom.Document;
    import org.w3c.dom.NodeList;
    import oracle.xml.parser.v2.XMLDocument;
    import oracle.xml.parser.v2.XMLElement;
    //import com.brightdairy.client.object.Product;
    import com.brightdairy.client.sync.SyncServerDoc;
    public class SyncServerDocImpl implements SyncServerDoc {
    public SyncServerDocImpl() {
    public Element getProductIDList() {
    Connection connServer = null;
    PreparedStatement stmtServerProduct = null;
    ResultSet rsServerProduct = null;
    Document doc = new XMLDocument();
    Element elProduct = doc.createElement("product");
    doc.appendChild(elProduct);
    long m_msec;
    m_msec = System.currentTimeMillis();
    try {
    connServer = makeConnection();
    System.out.println("1");
    stmtServerProduct = connServer.prepareStatement(
    "SELECT ID FROM " + SERVER_TABLE_PRODUCT );
    System.out.println("");
    rsServerProduct = stmtServerProduct.executeQuery();
    System.out.println("2");
    while(rsServerProduct.next()) {
    Element elID = doc.createElement("id");
    elID.appendChild(doc.createTextNode(rsServerProduct.getString("ID")));
    elProduct.appendChild(elID);
    System.out.println("3");;
    System.out.println("4");
    return doc.getDocumentElement();
    } catch(SQLException e) {
    e.printStackTrace();
    System.out.println("SQL exception has occured");
    System.out.println(e.getMessage());
    return doc.getDocumentElement();
    }finally {
    try {
    rsServerProduct.close();
    stmtServerProduct.close();
    connServer.close();
    m_msec = System.currentTimeMillis() - m_msec;
    System.out.println("6");
    System.out.println("getProductIDList:It take time:" m_msec/1000 "s");
    } catch(Exception e1) {}
    Now my firts question: when i generate the proxy WebServicesAssembler will failure (couldn't import jar.....) and i had imported all jar files,But if i commented proxy-gen , no error.
    and my second question: I commented proxy-gen and deployed ite and success. when i invoked it through web page , then error:
    java.lang.IllegalArgumentException: No Serializer found to serialize a 'org.w3c.
    dom.Element' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.
    at org.apache.soap.util.xml.XMLJavaMappingRegistry.querySerializer(XMLJa
    vaMappingRegistry.java:157)
    at org.apache.soap.encoding.soapenc.ParameterSerializer.marshall(Paramet
    erSerializer.java:106)
    at org.apache.soap.rpc.RPCMessage.marshall(RPCMessage.java:265)
    at org.apache.soap.Body.marshall(Body.java:148)
    at org.apache.soap.Envelope.marshall(Envelope.java:203)
    at org.apache.soap.Envelope.marshall(Envelope.java:161)
    at oracle.j2ee.ws.InvocationWrapper.invoke(InvocationWrapper.java:309)
    at oracle.j2ee.ws.RpcWebService.doGetRequest(RpcWebService.java:540)
    at oracle.j2ee.ws.BaseWebService.doGet(BaseWebService.java:1106)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletReque
    stDispatcher.java:721)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Ser
    vletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques
    tHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:106)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
    utor.java:803)
    at java.lang.Thread.run(Thread.java:484)
    I took much time and couln't get answer ,please help me!!!!!!!!!!!!

    Yeah!
    I have resolved it .
    It take me one day time!
    my error is 1: Element which I used is no namespace.
    2: no import enough jar files
    just so so .
    sorry! I am poor in English

  • Obtaining org.w3c.dom.html implementation?

    I'm would like to obtain implementations of the org.w3c.dom.html interfaces so that I can create HTML documents/fragments from scratch (as opposed to parsing files). After some pretty lengthy investigation (and much frustration), it looks like I need to (as one possible option) use JAXP to obtain implementation-independent versions of those interfaces. I still can't figure out how to wire everything up.
    Any help would be appreciated.
    Thanks,
    Gary

    I've been able to get an instance of DOMImplementation using the following code:
    private DOMImplementation getDomImplementation() throws ParserConfigurationException {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        return builder.getDOMImplementation();
        // // get an instance of the DOMImplementation registry
        // DOMImplementationRegistry registry =
        // DOMImplementationRegistry.newInstance();
        // // get a DOM implementation the Level 3 XML module
        // return registry.getDOMImplementation("XML 3.0");
    }I tried casting the returned DOMImplementation to HTMLDOMImplementation but received a cast exception.
    The commented code was actually my first unsuccessful attempt (it would return null). I tried calling
    System.getProperty("org.w3c.dom.DOMImplementationSourceList") just to see what was listed and it also returned null. I'm guessing that maybe I need to configure/install/register/etc. an implementation but I'm not sure where to start with that. I downloaded the J2SE 5.0 source code and discovered the com.sun.org.apache.html.internal.dom package which contains implementations of all the interfaces I need but I'm not sure how to point to them.
    This seems much harder than it should be. Any help would be appreciated.
    Thanks,
    Gary

Maybe you are looking for

  • Credit memo -Depot sale return

    Hello Guru, I am facing problem in credit return memo regarding excise amount. Since this is depot scenario after doing J1IJ i am doing invoice where excise value is picking from J1IJ...which is ok. when i am doing depot return with reference to invo

  • BADi FAGL_DERIVE_SEGMENT

    Dear Experts, I have a requirement where the Segment Values need to be derived in recording the business transactions. Profit Center Accounting is not implemented and hence need to know whether BADi FAGL_DERIVE_SEGMENT would address the requirement.

  • SQL loader : how to populate a calculated feild of a table?

    Hi All, I have a table which has total 92 columns, among them 6 feilds are calculated using few other fields of the same table. i have a csv file , which has only 86 feilds . during upload data using sql loader, is it possible to calculate other 6 fe

  • Express xy graph second plot

    Hi , Im trying to get a second plot on the express XY graph. I've tried some of the suggestions like building the x array twice ( concatanating ?) but this does not seem to work for me. Is there a tutorial on multiple plotting with this beast anywher

  • Mini display port - video only?

    Hey, I'm just wondering if the mini display port is video only as I've read in some places, and if so, what is the best way to connect my MacBook to my Samsung 26" TV? Thanks