Webservices: returning xml document to client

Can anyone please help me to the following problem.
1. I have a java bean which i publish as webservice. I want to return an xml document on request from client(for time being my client is normal java client). when i call getDoc() from client i get classload exception. can anyone explain me why?
public org.w3c.dom.Document getDoc() throws java.rmi.RemoteException {
Document document = null;
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
try {
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse( new File("C:\\data\\RND\\XmlParser\\XmlParser\\src\\xmlparser\\employer.xml"));
catch (Exception ex) {
return document;
2. if i have to send a xml file to clinet on request using web services(i assume i cant return an document as above), is it feasible(my xml file is a transaction file) to send a xml file as string?
3. how to transfer a xml file into a string?

I'm almost sure that the error is because the Document class is not supported by JAX-RPC (see page 384 of the Java Web Services Tutorial).
Try sending your XML as a String.
This code may help you to transform between XML and String and viceversa:
import javax.xml.parsers.*;
import javax.xml.transform.*;
import org.xml.sax.*;
import org.w3c.dom.*;
public static Document toXmlDocument(String xml) throws IOException, SAXException, ParserConfigurationException
StringReader reader = new StringReader(xml);
InputSource source = new InputSource(reader);
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document xmlDoc = builder.parse(source);
return ( xmlDoc );
public static String toXmlString(Node node) throws TransformerConfigurationException, TransformerException
StringWriter writer = new StringWriter();
DOMSource source = new DOMSource(node);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer();
StreamResult result = new StreamResult(writer);
transformer.transform(source,result);
return ( writer.toString() );
}

Similar Messages

  • Returning XML Document

    I am having trouble (weblogic 7.0) exposing an EJB web service. It
    takes string parameters in and should return an XML document. I've
    ported this from apache axis, the java method takes java.lang.String
    parameters and returns org.w3c.dom.Element ... this works fine on
    Jboss 3.2.0. Can anyone help me figure out how to do the same on
    weblogic? My web-services.xml file is as follows now:
    <web-services>
         <web-service name="myService"
    targetNamespace="http://www.bobo.com"
    uri="/jboss-net/services/myService">
              <components>
                   <stateless-ejb name="myService">
                        <ejb-link
    path="myjarfile.jar#MyServiceService"/>
                   </stateless-ejb>
              </components>
              <operations>
                   <operation name="runQuery"
    invocation-style="request-response" component="myService" >
                        <params>
                             <param name="in0" style="in"
    type="xsd:string" location="header"/>
                             <param name="in1" style="in"
    type="xsd:string" location="header"/>
                             <param name="in2" style="in"
    type="xsd:string" location="header"/>
                             <param name="in3" style="in"
    type="xsd:string" location="header"/>
                             <return-param name="result"
    type="xsd:anyType"/>
                        </params>               
                   </operation>
              </operations>     
    </web-service>
    </web-services>
    Feel free to respond to the group or to [email protected]
    John

    Hello,
    Are you using servicegen against the EJB?
    http://edocs.bea.com/wls/docs81/webserv/anttasks.html#1063540
    Using a stateless session EJB example can be found here:
    http://webservice.bea.com/statelessSession.zip and there is a dom
    example here: http://webservice.bea.com/dom.zip
    Thanks,
    Bruce
    Hauss wrote:
    >
    I am having trouble (weblogic 7.0) exposing an EJB web service. It
    takes string parameters in and should return an XML document. I've
    ported this from apache axis, the java method takes java.lang.String
    parameters and returns org.w3c.dom.Element ... this works fine on
    Jboss 3.2.0. Can anyone help me figure out how to do the same on
    weblogic? My web-services.xml file is as follows now:
    <web-services>
    <web-service name="myService"
    targetNamespace="http://www.bobo.com"
    uri="/jboss-net/services/myService">
    <components>
    <stateless-ejb name="myService">
    <ejb-link
    path="myjarfile.jar#MyServiceService"/>
    </stateless-ejb>
    </components>
    <operations>
    <operation name="runQuery"
    invocation-style="request-response" component="myService" >
    <params>
    <param name="in0" style="in"
    type="xsd:string" location="header"/>
    <param name="in1" style="in"
    type="xsd:string" location="header"/>
    <param name="in2" style="in"
    type="xsd:string" location="header"/>
    <param name="in3" style="in"
    type="xsd:string" location="header"/>
    <return-param name="result"
    type="xsd:anyType"/>
    </params>
    </operation>
    </operations>
    </web-service>
    </web-services>
    Feel free to respond to the group or to [email protected]
    John

  • Return XML document through Web Service?

    Hello,
    Is it possible to return a XML document from a web service?
    For example, I have a Oracle Report that outputs in XML format, is it possible to return that through a web service?
    Any suggestions or pointers will be most appreciated.
    Nilan

    Hi Nilan,
    You can see a simple example here.,on how to pass and receive XML elements as web service params.
    http://otn.oracle.com/sample_code/tech/java/codesnippet/webservices/docservice/content.html
    A tutorial on Using Web Services with Oracle9i Reports
    http://otn.oracle.com/tech/webservices/htdocs/series/reports/content.html
    Regards
    Elango.

  • How do I using Workshop's XMLMap Defined XML Document ?

    Hi ,
    I wonder that how can call the Workshop's XMLMap Defined Document in Java
    Application Client.
    I need to get not returned Object but returned XML Document in Java
    Application Client.
    Regards.

    Here's a more complete example:
    * @jws:operation
    public org.w3c.dom.Document getPurchaseOrderAsDocument() throws org.xml.sax.SAXException
    Document doc = null;
    try
    DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = fact.newDocumentBuilder();
    doc = db.parse(new InputSource(new FileInputStream(new File("c:/temp/mypo.xml"))));
    catch (IOException ioe)
    throw new SAXException("IO exception occurred", ioe);
    catch (ParserConfigurationException pce)
    throw new SAXException("JAXP Parser configuration exception occurred", pce);
    return doc;
    HTH,
    Mike Wooten
    "dudwnrla" <[email protected]> wrote:
    Hi ,
    I wonder that how can call the Workshop's XMLMap Defined Document in
    Java
    Application Client.
    I need to get not returned Object but returned XML Document in Java
    Application Client.
    Regards.

  • How to parse XML document returned by webservices

    Hi,
    I have a form (version 10.1.2.0) which has to display the credit card types using webservices. I created the webstub and jar file through jdeveloper and then after adding the jar files in the respective classpaths, I import it in the forms. I write the code in when-button-pressed and it gives the result in xml document like this:
    <?xml version="1.0" encoding="UTF-8"?><WSAnswerTO><error>false</error><errorMessage></errorMessage><
    results><CardTypeTO><carTypId>3</carTypId><type>AMERICAN
    EXPRESS</type><numLength>15</numLength><cvvLength>4</cvvLength><comments>1 800-639-0002</comments></CardTypeTO><CardTypeTO><carTypId>4</carTypId><type>DISCOVER</type><numLength>16</numLength><cvvLength>3</cvvLength><comments>1 800-347-2683</comments></CardTypeTO><CardTypeTO><carTypId>1</carTypId><type>MASTERCARD</type><numLength>16</numLength><cvvLength>3</cvvLength><comments>1 800-633-7367</comments></CardTypeTO><CardTypeTO><carTypId>2</carTypId><type>VISA</type><numLength>16</numLength><cvvLength>3</cvvLength><comments>1 800-945-2000</comments></CardTypeTO></results></WSAnswerTO>
    From the above xml document, I only need to display the type (such as AMERICAN EXPRESS, VISA, ETC) in my forms. Can somebody please tell me how to do it. Do I need to store the values in a table first and then retrieve it. Please advise. I have already read a otn document in xml parsing but I didnt understand anything from it.
    Please help. Thanks in advance.

    Hello,
    It probably exists a database package/function to parse this kind of stuff.
    If you want to keep the process into the Forms, here is a PL/SQL package you can use:
    CREATE OR REPLACE PACKAGE Pkg_Tools AS
      --  Types  --
      -- table of strings --
      TYPE TYP_TAB_CHAR IS TABLE OF VARCHAR2(4000) INDEX BY BINARY_INTEGER;
      --  Methodes   --
      -- function that return all contents for a given XML tag --
      FUNCTION Get_Xml_Tag
         PC$XmlContent  IN VARCHAR2,                 -- XML string
         PC$Tag         IN VARCHAR2,                 -- searched tag
         PC$NewLine     IN VARCHAR2 DEFAULT CHR(10)  -- defaull NL character
      RETURN TYP_TAB_CHAR ;
    END Pkg_Tools;
    CREATE OR REPLACE PACKAGE BODY Pkg_Tools
    IS
      -- fonction de retour du contenu d'une balise XML  --
      FUNCTION Get_Xml_Tag
         PC$XmlContent  IN VARCHAR2,                 -- contenu XML
         PC$Tag         IN VARCHAR2,                 -- tag recherche
         PC$NewLine     IN VARCHAR2 DEFAULT CHR(10)  -- defaull NL character
      RETURN TYP_TAB_CHAR
      IS
       TC$Table      TYP_TAB_CHAR ;
       LC$Ligne      VARCHAR2(32000) ;
       LC$Xml        VARCHAR2(32000) ;
       LN$INDEX      PLS_INTEGER := 0 ;
       LN$TagDeb     PLS_INTEGER ;
       LN$TagFin     PLS_INTEGER ;
       LN$TagLength  PLS_INTEGER ;
       LN$LigLength  PLS_INTEGER ;
       LN$Occur      PLS_INTEGER := 1 ;
      BEGIN
        IF ( PC$XmlContent IS NOT NULL AND PC$Tag IS NOT NULL ) THEN
          LC$Xml := REPLACE( PC$XmlContent, CHR(13), '' ) ;
          LN$TagLength := LENGTH( PC$Tag ) ;
           LOOP
          LN$TagDeb := INSTR( LC$Xml, PC$Tag, 1, LN$Occur ) ;
          LN$TagFin := INSTR( LC$Xml, '</' || SUBSTR(PC$Tag,2, 256), 1, LN$Occur ) ;
          LN$LigLength := (LN$TagFin - ( LN$TagDeb + LN$TagLength ) ) ;
          IF (LN$TagDeb > 0 AND LN$TagFin > 0 ) THEN
             LN$Occur := LN$Occur + 1 ;
             LC$Ligne := SUBSTR( LC$Xml, LN$TagDeb + LN$TagLength, LN$LigLength ) ;
             LOOP
               LN$INDEX := LN$INDEX + 1 ;
               LN$TagDeb := INSTR( LC$Ligne, PC$NewLine ) ;
               IF LN$TagDeb > 0 THEN
                 IF Trim( SUBSTR( LC$Ligne, 1, LN$TagDeb - 1 )) IS NOT NULL THEN
                   TC$Table(LN$INDEX) := SUBSTR( LC$Ligne, 1, LN$TagDeb - 1 ) ;
                 ELSE
                   LN$INDEX := LN$INDEX - 1 ;
                 END IF ;
                 LC$Ligne := SUBSTR( LC$Ligne, LN$Tagdeb + LENGTH( PC$NewLine ), 30000 ) ;
               ELSE
                 IF Trim(LC$Ligne) IS NOT NULL THEN
                    TC$Table(LN$INDEX) := LC$Ligne ;
                 END IF ;
                 EXIT ;
               END IF ;
             END LOOP ;
          ELSE
              EXIT ;
          END IF ;
           END LOOP ;
        END IF ;
        RETURN TC$Table ;
      END Get_Xml_Tag ;
    END Pkg_Tools;
    /Then the call:
    DECLARE
       LC$t  VARCHAR2(2000);
       LT$Table Pkg_Tools.TYP_TAB_CHAR ;
    BEGIN
       lc$t := '<?xml version="1.0" encoding="UTF-8"?><WSAnswerTO><error>false</error><errorMessage></errorMessage><results>'
    ||'<CardTypeTO><carTypId>3</carTypId><TYPE>AMERICAN EXPRESS</TYPE><numLength>15</numLength><cvvLength>4</cvvLength>'
    ||'<comments>1 800-639-0002</comments></CardTypeTO><CardTypeTO><carTypId>4</carTypId><TYPE>DISCOVER</TYPE>'
    ||'<numLength>16</numLength><cvvLength>3</cvvLength><comments>1 800-347-2683</comments></CardTypeTO>'
    ||'<CardTypeTO><carTypId>1</carTypId><TYPE>MASTERCARD</TYPE><numLength>16</numLength><cvvLength>3</cvvLength>'
    ||'<comments>1 800-633-7367</comments></CardTypeTO><CardTypeTO><carTypId>2</carTypId><TYPE>VISA</TYPE>'
    ||'<numLength>16</numLength><cvvLength>3</cvvLength><comments>1 800-945-2000</comments></CardTypeTO></results></WSAnswerTO>' ;
       LT$Table := Pkg_Tools.Get_Xml_Tag(LC$T,'<TYPE>') ; 
       IF LT$Table.COUNT > 0 THEN
         FOR i IN LT$Table.First .. LT$Table.Last LOOP
            dbms_output.put_line( 'Table(' || i || ')=' || LT$Table(i) ) ;
         END LOOP ;
       ELSE
         dbms_output.put_line( 'tag xml not found' ) ;
       END IF ;
    END;Francois

  • Transmission of XML Documents in a vector via WebService using Axis

    Hello,
    I'm trying to transmit several XML documents (belonging to a DICOM-Study) from WebService Provider to WebService consumer.
    This is my server/provider:
    public static Vector<Document> returnPatientStudies(String PatientID)
    DocumentBuilderFactory factory  = DocumentBuilderFactory.newInstance();
    DocumentBuilder        builder  = factory.newDocumentBuilder();
    File x = new File(PATH + "patient.xml");
    Document document = builder.parse(x);
    DCM2XMLFiles.add(document);This code works fine if it's executed locally in a JAVA class or via http/GET (http://.../axis/services/Gateway?method=returnPatientStudies&PatientID=123456).
    After using Axis' WSDL2Java-Tool I wrote a client:
    public static void main(String[] args) {
    GatewayServiceLocator locator = new GatewayServiceLocator();
    try {
         Gateway gateway = locator.getGateway();
         Vector<Document> documents = Gateway.returnPatientStudies("123456");
    ... Everytime I try to invoke this client-side class, I get an "org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize."
    Obviously the client gets confused by the XML content of the vector I'm trying to transmit (this error also occurs if I transmit XML files constisting only of a single empty element <empty />).
    I think this is a simple problem, since one single XML Document can be transmitted and gets displayed on client side, but I don't have a clue how to solve this vector<Document> problem. Hope someone can help me.
    Thanks

    Hi thanks for your answer.
    I am striving to make this webservice as universal as possible. I have only been returning dumps to my calling page to try and get a view of what's going on inside the component when I call it as a webservice. I wouldn't dream or returnin these back the client.
    The major core of this idea was to create a single component that acts as a facade for a number of other components. Because of this the component needs to accept and return a dynamically variable number of arguments. Because of this I selected xml as this seemed like the ideal solution; I can pass in an out some xml that contains all the arguments. I was hoping to reuse some internal functions to provide external webservices, and use this facade architechture to add a layer of security and logging which doesn't exist with the current functions.
    Do you have any suggestions of how I could best acheive something along these lines? Has someone already created a framework or methodology for creating webservices with Coldfusion which would provide this sort of functionality out of the box?
    Thanks again
    Jim

  • Returning XML to client from web service

    Hi,
    I am new to developing web services using JAX_RPC. I am trying to return a xml document to the client from the web service.
    My Server implementation is as follows:
    Interface:
    public interface OntoIF extends Remote
    public DataHandler ontoCompare (String targetUrl,String sourceUrl ) throws RemoteException;
    Implementaion:
    public class OntoImpl implements OntoIF
    public DataHandler ontoCompare (String targetUrl,String sourceUrl ) throws RemoteException
    DataHandler dataHandler = new DataHandler( new StreamSource( new File ("status.xml")), "text/xml");
    return dataHandler;
    Client Implementation:
    Stub stb = (Stub) (new OntoService_Impl().getOntoIFPort());
    stb._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,
         "http://localhost:8080/onto-service/onto");
    OntoIF onto = (OntoIF) stb;
    DataHandler retDHandler = onto.ontoCompare(targetOntoUrl, sourceOntoUrl);
    When I compile and run my client, it throws the following error -
    java.rmi.ServerException: JAXRPCSERVLET28: Missing port information
    at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.ja
    va:497)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:294
    at sstub.OntoIF_Stub.echoDataHandler(OntoIF_Stub.java:122)
    at sstub.OntoClient.main(OntoClient.java:63)
    Can you please let me know what I am doing wrong? I have no problems in sending a DataHandler but receiving the DataHandler from the web service throws errors.
    Thanks!

    Hi I'm having the same problem. I try to set up a Web Service using JAX_RPC. My WS should invoke a native Method implemented in C++. Did you got a solution for this issue? My Error Message is as follows:
    java.rmi.ServerException: JAXRPCSERVLET28: Missing port information
         at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:497)
         at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:294)
         at com.sun.xml.rpc.client.dii.CallInvokerImpl.doInvoke(CallInvokerImpl.java:80)
         at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:489)
         at com.sun.xml.rpc.client.dii.CallInvocationHandler.doCall(CallInvocationHandler.java:122)
         at com.sun.xml.rpc.client.dii.CallInvocationHandler.invoke(CallInvocationHandler.java:86)
    at $Proxy0.getHello(Unknown Source)
         at com.neuhaus.test.ws.client.NativeInvokeClient.main(NativeInvokeClient.java:44)
    Exception in thread "main"
    greetings, JAN

  • Error in webservice call | Error in XML Document(1,358)

    Hi all,
    We currently have a web service developed in Java, which we're calling from
    a dot net coded windows form. this web service is returning an object of type
    abc (say). Now, when we try and get a response from java server on the form,
    i'm getting the following error:
    There is an error in XML document (1, 358)
    Does this have something to do with a java serialised object not being able
    to get deserialised in dot net? Or is it something else?
    Also, I have a web reference that has been created on this java web service.
    This I believe means that the object that we're trying to get on the dot net
    client would be the java object that is being sent from the web service.
    Point to be noted is the fact that this web service was working absolutely fine till about 2 days ago.
    Any pointers are gladly appreciated.
    Cheers!
    Nick

    Sorry for not mentioning the product versions:
    The bpel process was build and deployed with Jdeveloper Studio edition version 10.1.3.1.0.3984 on a Bpel server/Application Server with version 10.1.3.1 (NT).

  • Receive XML document as Webservice Response

    Hi
    I have implemented webservices using axis.This works fine.
    But I need an receive the response as an XML document.because for multiple entries of same tag name, i can parse through the document and do what ever i want.
    Also how can i attach an external xsd for a wsdl.
    I am stuck up at these two places,Your help would be appriciated
    Thanks in advance

    Web service is platform independent hence most programming languages should return basic datatypes. In your case easiest thing would be to read that XSD file and convert entire file as String and return it as String. A document object will always throw an error.
    Google to find out datatypes supported.
    Hi Everyone,
    Please let me know if this can be a quick resolution to his problem.

  • Carriage Returns & Line Feeds in XML documents

    Does anyone know why the PL/SQL XML parser will NOT work with Carriage Returns (0x0D) within the XML document?
    Currently I'm having to strip them out, leaving just the Line Feed (0x0A).
    I only realised this after looking at the family.xml example document.
    T.I.A.
    Geoff

    I forgot to mention that I'm running Oracle 8i on Windows NT.

  • Webservice returning string (but I need XML for XSLT Tranformation)

    Hello everybody,
    I have configured an ip with a webservice. So far so good - everything works fine.
    Now I want to transform the output of the webservice with xslt. The webservice returns the data as a String in form of XML.
    e.g.
        <!XML>
    <!String>
    <!String> </b>
    </Bill> <!XML>
    But XSLT don't find e.g the node , because it is a String. I think the right way is first to transform the String into XML. I tried this step with Java with the method
    public void execute(InputStream inputStream, OutputStream outputStream)
            throws StreamTransformationException {
    but it doesn't work. I am not sure, if this is the right way.I have searched for a code sample, but I didn't find anything.
    What do you think?
    Do you have a code sample?
    This would be great!
    Best regards,
    Jürgen

    Hello Bhavesh,
    thx very much for your help.
    Here is my Java Mapping:
    public class ModusLebenTransformation implements StreamTransformation
    public static byte[] readStream(InputStream in, boolean close)
        throws IOException
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        int c = in.read();
        while (c > -1)
            out.write(c);
            c = in.read();
        out.flush();
        byte[] result = out.toByteArray();
        out.close();
        if (close)
            in.close();
        return result;
    public void setParameter(Map map) {
    public void execute(InputStream inputStream, OutputStream outputStream)
            throws StreamTransformationException {
       try {
    TransformerFactory tFactory = TransformerFactory.newInstance();
                Transformer transformer = tFactory.newTransformer();
       StreamResult result = new StreamResult(outputStream);
    String input = new String(readStream(inputStream,true));
    transformer.transform(new StreamSource(input), result);      
      } catch (Exception e) {
                 throw new StreamTransformationException("Mapping failed", e);
    But I don't know if this code is enough to convert the String( from the webservice) into XML.
    And then I would like to use XSLT for transformation in a new mapping step.
    Do you think this is possible?
    Do you have a code sample, that will tranform the String (from the webservice) into XML?
    This would be very helpful!
    regards,
    Jürgen

  • My Task is To Parse a XML Document to Return CLOB's

    Hi folks
    I am writing this mail in the hope of getting a help.Please
    give me a shoulder to keep me going.
    The task is to parse a XML document for a specific Tag and
    read the Tag content in CLOB to return CLOB.
    I know that the writetoclob will do the job as
    per oracle documentation.
    I am giving the code where i got stuck.
    Please help me complete my rest of coding.
    Thanks
    Input variables are
    XMLin in CLOB, -- Incoming XML Document Structure
    Partype in varchar2, -- Tagname
    Result out CLOB -- Return Tag value CLOB data type.
    My Code : -
    Declare
    p xmlparser.parser;
    d xmldom.DOMDocument;
    e xmldom.DOMElement;
    nl xmldom.DOMNodeList;
    n xmldom.DOMNode;
    tagvalue varchar2(255);
    paramsIn Clob;
    result CLOB;
    BEGIN
    --loading SecXML
    dbms_lob.createtemporary(paramsIn,true);
    dbms_lob.append(paramsIn,XMLin);
    --dbms_output.put_line('ParsebyTag ='||Partype);     
    --defining parser
    p := xmlparser.newparser;
    xmlparser.parseClob(p,paramsIn);
    d := xmlparser.getDocument(p);
    --get tagvalue
    nl := xmldom.getElementsByTagName(d,partype);
    n := xmldom.item(nl,0);
    IF xmldom.getlength (nl) > 0
    THEN
    n := xmldom.item (nl, 0);
    =>=>=> => xmldom.writetoclob (n, result); <=<=<=<=<=<=====
    END IF;
    return; -- from a procedure
    The above line marked with a arrow does not work for CLOB Variables.
    Please explain with a corrected code to complete this task.
    Thanks for reading my request.
    Please reply to this message poster as i am frequently
    checking this to see a answer.
    my email is [email protected]
    Balaji.

    First, you have 2 variables with the same name,
    Second, let me show you what is that you need to do:
    PROCEDURE WriteDataToClob(XMLin in CLOB, Partype in varchar2, Result out CLOB) IS
    Declare
    p xmlparser.parser;
    d xmldom.DOMDocument;
    e xmldom.DOMElement;
    nl xmldom.DOMNodeList;
    n xmldom.DOMNode;
    tagvalue varchar2(255);
    TempClob Clob;
    BEGIN
    --Create a temporary clob
    dbms_lob.createtemporary(TempClob,true);
    --loading SecXML
    --defining parser
    p := xmlparser.newparser;
    xmlparser.parseClob(p,XMLin);
    d := xmlparser.getDocument(p);
    --get tagvalue
    nl := xmldom.getElementsByTagName(d,partype);
    n := xmldom.item(nl,0);
    IF xmldom.getlength (nl) > 0 THEN
    n := xmldom.item (nl, 0);
    xmldom.writetoclob (n, TempClob );
    END IF;
    Result := TempClob;
    dbms_lob.FreeTemporary(TempClob);
    END;

  • Parsing the return value from a http request into a xml document?

    suppose a url "http;//abc.com/index.asp" that return a string like this:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <bbsend>
    <title>xml testing</title>
    - <record>
    <sender>111111</sender>
    <date>2004-01-05 04:11:44</date>
    <message>yes!</message>
    </record>
    - <record>
    <sender>22222222</sender>
    <date>2004-01-14 01:06:31</date>
    <message>A</message>
    </record>
    </bbsend>
    how can i parsing this return value into a xml document???
    i try something like this:
    URL url = new URL("http://abc.com/index.asp");
    HttpURLConnection http = (HttpURLConnection)url.openConnection();
    DataInputStream in = new DataInputStream(http.getInputStream());               
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse(in);
    System.out.println(document.getNodeValue());
    But fail , can anyone help

    do u mean get the xml content??
    i am doing a project with BBSend
    [email protected]

  • How to check empty return from Get XML Document Data?

    If Get XML Document Data doesn't return a result, how do you test it? String.isEmpty() doesn't do the trick, it still throws the exception "java.lang.NullPointerException". I can't seem to be able to match that up to a cisco exception with a "On Exception Goto" step (which I put right before the XML Document Data step). Any clues anyone?

    Hi,
    Try this:
    variable=Get XML Document Data ()
    if(variable == null) then
         true
         false
    Gabriel.

  • UCCX XPath on Get XML Document Data Step always returns null

    Hello,
    Can someone tell whats wrong with my XPath, because it always returns null. I have tried different variations and nothing. I'm using UCCX 7.0
    XML
    <?xml version="1.0" encoding="utf-8" ?>
    <GetManagersResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.labdomain.com/">
      <ClaimManagersList>
        <X_CLAIM_MANAGER>
          <ClaimManagerUserName>test</ClaimManagerUserName>
        </X_CLAIM_MANAGER>
      </ClaimManagersList>
    </GetManagersResult>
    XPATH
    "/descendant::GetManagersResult/child::ClaimManagersList/child::X_CLAIM_MANAGER/child::ClaimManagerUserName"
    During debug, this is the value of the xml document when it reaches the Get XML Document Data step:
    TEXT[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<GetManagersResult xmlns=\"http://www.labdomain.com/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n  <ClaimManagersList>\r\n    <X_CLAIM_MANAGER>\r\n      <ClaimManagerUserName>test</ClaimManagerUserName>\r\n    </X_CLAIM_MANAGER>\r\n  </ClaimManagersList>\r\n</GetManagersResult>]

    It's your XML namespace in the root element.
    First off, I have never seen the CRS Editor play nice when XML namespaces are involved.
    Secondly, with your namespace in place, not even a generic xpath expression tester can find your data.  See attachements.
    I think that if you find a way to either: not send, or remove the namespace from your document, your xpath expression will work.
    With Namespaces
    Without Namespaces

Maybe you are looking for

  • After updating to iOS 8.1.2 it asks for a passcode, which I never used, such that I now have an $800 paperweight!

    I recently updated to the iOS 8.1.2, but after rebooting, the iPad demands a passcode, which was never used on this iPad. I cannot bypass the passcode question. It is now an $800 paperweight. Apple support of course wants money for the obviously poor

  • DVCPRO HD Varicam capture of 720/24p (not 23.978)

    Hi, I was hoping someone could help me, im hiring in a AJHD-1400 deck to digitise some footage shot on the AJ-HDC27 Varicam. It was shot at 720/24p at 60hz meaning that the frame rate is true 24fps not 23.978fps. I had limited access to one a while b

  • My Imac 24" Leopard wake me up every night at 01h00 AM!

    Hi to all of you my new Imac 24" (dec07 and 10.5.1) wake up or start by itself every night at 01h00 AM. As my desk is in my bedroom, it drives me crazy. The only solution found is to change the time setting (3h earlier) to perform this at 10h00pm. No

  • Dynamically Binding to Dynamically Create View

    I tried to copy the code of “Dynamically Binding to Dynamically Create View object” but something is wrong because when I am debbuging it doesn’t work after the sentence vo.executeQuery(); I suspect that the reason could be how I created the view.. Y

  • Singleton service example

    Hi           In order to create and deploy a singleton service on WebLogic 92, I did exactly as the book said (http://edocs.bea.com/wls/docs92/cluster/migration.html#wp1045262). But it didn't work.           So I wish to find a tested example (all re