XML Beans 1.0.4 parsing the response XML.

Hi,
I am reading an XML Document that was sent as a Stream from another Servlet using XMLBeans technology
objectInputStream = new ObjectInputStream(new BufferedInputStream( postmethod.getResponseBodyAsaStream());
abcResponseDocument = ABCResponseDocument.Factory.parse((InputStream)objectInputStream);
This was the error I'm encountering at the first line.
java.io.StreamCorruptedException: invalid stream header at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:737) at java.io.ObjectInputStream.(ObjectInputStream.java:253.....
Please let me know what more needs to be done in order to get this fixed and also shed some light when this particular exception occurs(like due to internal inconsistency checks etc..) and how handle this.
Thanks,
Kartheek

So,
Could you please elaborate what needs to be done in this case.I.e., StreamCorruptedException implies that the other part was not sending the data as expected or the processing of XML Document was not properly being done on our side??
As Suggested by you, I changed the code as follows
abcResponseDocument = ABCResponseDocument.Factory.parse(postMethod.getResponseBodyAsString());
Here's the error I'm facing
org.apache.xmlbeans.XmlException: error: White spaces are required between publicId and systemId. at org.apache.xmlbeans.impl.store.Root$SaxLoader.load(Root.java:762) at org.apache.xmlbeans.impl.store.Root.loadXml(Root.java:1036) at org.apache.xmlbeans.impl.store.Root.loadXml(Root.java:1028) at
Please advise.
Thanks,
Kartheek
Edited by: 811914 on Dec 25, 2011 10:43 PM

Similar Messages

  • Issue in parsing the response of a WebService in Service Link

    I am getting issues in connecting an external (non cisco) application via WebService. Appreciate if anyone can help in fixing the issue. I am using 9.3.2 Patch 6.
    Connectivity to an external system (a 3rd party application in my firm) was achieved via WebService using the ServiceLink module.
    Used the Outbound HTTP/WS Adapter where I am sending request and receiving response (bi-direction).
    Successfully constructed and passed the XML request to the WebService.
    Received response from the WebService as an XML / Soap Message which is then wrapped with the <Message> tag with the channel-id attribute successfully.
    Designed a XSL Transformation (For this WebService, the XSLT did not generated automatically) which, I hope is not being applied properly in CPSC; but working fine outside of CPSC when I have checked the response XML with the XSLT in an online editor (http://www.freeformatter.com/xsl-transformer.html). Everything looks perfect in this editor where I have issues in CPSC.
    I am getting a Transformation exception in CPSC and the response message was unable to convert into the nsXML. The exception I am receiving is below. Not sure whether it is due to the namespace or something else..
    Note: I am having this issue in this Agent/WebService alone. I have tested with couple other WebServices where I didn't have any issues in getting the response and update the field in CPSC form successfully. So, I believe that there are no issues in the parser in our server.
    Exception Received:
    org.xml.sax.SAXParseException: Premature end of file. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124) at com.newscale.bfw.util.XMLValidator.validate(XMLValidator.java:147) at com.newscale.is.core.MessageExecutor.processNSTaskTransportMessage(MessageExecutor.java:135) at com.newscale.is.core.MessageExecutor.processTransportMessage(MessageExecutor.java:431) at com.newscale.is.core.MessageExecutor.processSynchronousOutboundMessage(MessageExecutor.java:526) at com.newscale.is.adk.OutboundAdapterUtil.processSynchronousResponse(OutboundAdapterUtil.java:44) at com.newscale.is.adapter.http.HTTPOutboundAdapter.call(HTTPOutboundAdapter.java:190) at com.newscale.is.adapter.http.HTTPOutboundAdapter.processMessage(HTTPOutboundAdapter.java:147) at com.newscale.is.core.MessageRouter.routeMessage(MessageRouter.java:115) at com.newscale.is.core.MessageExecutor.processOutboundMessage(MessageExecutor.java:604) at com.newscale.is.core.MessageExecutor.processMessage(MessageExecutor.java:125) at com.newscale.is.core.QueueListener.handleTextMessage(QueueListener.java:91) at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:340) at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:237) at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:168) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:73) at org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:101) at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:115) at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:285) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:110) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:71) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:322) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:213) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:71) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86) at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:105) at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:561) at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:499) at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1059) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1051) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:948) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
    Sample XML File received as response from the WebService – which then wrapped with the <message> tag along with appropriate channel-id.
    <message channel-id="10a60e45-65d4-40c0-826f-1a91d2135da0">
    <?xml version="1.0"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
    <ns:ITSPResponse xmlns:ns="urn:PegaRULES:SOAP:BNYMDataITSPTest:Services">
    <Output>Test IT Service Portal - 1</Output>
    </ns:ITSPResponse>
    </soap:Body>
    </soap:Envelope>
    </message>
    XSL Transformation
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="
    http://www.w3.org/1999/XSL/Transform" xmlns:ns="urn:PegaRULES:SOAP:BNYMDataITSPTest:Services">
    <xsl:template match="/">
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="urn:PegaRULES:SOAP:BNYMDataITSPTest:Services">
    <message>
    <xsl:attribute name="channel-id">
    <xsl:value-of select="//@*[local-name()='channel-id']" />
    </xsl:attribute>
    <send-parameters>
    <agent-parameter>
    <name>Output</name>
    <value> <xsl:value-of select="//*[local-name()='Output']" /> </value>
    </agent-parameter>
    </send-parameters>
    </message>
    </xsl:template>
    </xsl:stylesheet>

    The reply I got from Cisco Engineering team for this is to get the response as a soap message than XML data.
    The tag should not be available in the response received. If we don't have this, the response will still consider as a valid XML / Soap message after wrapped by the tag.
    If we have the tag in the response, after wrapping the tag, the format of the response will not be in good format.
    Also, Cisco Engineering team has confirmed that it is not possible to remove the tag from CPSC. It should be removed by the WebService providers while sending the response.
    For my case, I am consuming the WebService from a tool similar to CPSC where the entire settings has to be changed to send the response format as soap message than XML. So, we need to have another WebService as a middleware! Bad day!

  • Adt.bat Could not generate timestamp: Cannot parse the response

    I am using the command line to build an air app as follows:
    adt.bat -package -storetype pkcs12 -keystore mycert.pfx
    -storepass xxx -tsa
    http://timestamp.verisign.com/scripts/timstamp.dll
    myApp.air myApp-app.xml myApp.swf
    However, I receive this error:
    Could not generate timestamp: Cannot parse the response
    I am using a Verisign issued Authenticode certificate. Has
    anyone got any idea why this might be happening?
    Thanks

    There is no previous thread running for this application
    (that's the first thing I checked out). As I said in the last
    message, I can successfully launch my app from within FlexBuilder3,
    but not from a generated .air file install.
    At your suggestion, I created a simple "Hello World" type of
    Flex application in FlexBuilder3. From within FlexBuilder3, I
    exported it to an AIR file and installed it. This simple
    application does indeed run on my system after being installed from
    the .air file.
    So there's something different about this new public release
    of the FlexSDK than the last bet release. I compared that simple
    project contents and layout to my project. The big difference is
    that all the source files for the simple project was automatically
    dropped/created in a child 'src' folder under the main project
    folder. I also noticed that when installed, there were files
    missing for my app, but not for the simple app. The big difference
    there being that only the files in the src folder were copied into
    the AIR installer to be installed. Nothing outside of that folder
    was part of the install codebase!
    I therefore refactored my code (yet again) to move all my
    source files (including my external config XML files) into a 'src'
    folder under the main project folder. After a lot of tweaking in
    FlexBuilder3 to get it all working again and running, I exported to
    an AIR file once again. This time all the files were included, when
    I ran the new installer. The application now launches successfully.
    The next step is to replicate this via the command-line ADT
    tool.
    It would have been nice to know the changes in this area (src
    folder) before going this far into the process. Unless they are
    documented in some obscure release note somewhere that I am not
    aware of yet.
    I'll let you know how the ADT run goes when I get the chance.
    Thanks for your help everyone.

  • How to parse the result xml string in BPEL

    Hi,
    This is Ishmayel.v new to BPEL and hava experience in xml parsing, java and webservices.
    Now I am getting the XML file as a result string in BEPL.
    now I want to parse the XML string and insert into the database... If any one has the idea let me know.
    my email id is [email protected]
    Thanks in Advance,
    Regards,
    Ishmayel.

    Your question is not clear.
    You have a client applicaton which invokes a BPEL process and receives XML response from BPEL. Then you want to parse this response XML in your client application?
    Or you are running a BPEL process which invokes a service and receives an XML response. Then you want to parse this XML response in BPEL before your process can proceed?
    I have to assume that you are working with a string and then you want to convert the string into XML, and then parse the XML. If this is the case, then take a look at the ora:parseEscapedXML(contentString) function. You can use this in the expression editor in JDev.

  • New line character (/n ) getting introduced in the response XML in Biztalk 2010

    Hello,
    In one of our enviornment, we have started facing an issue that the response XML does not get structered correctly, hence when the response is finally redenered, there is a /n in the response fields. this is for all string fields that do not have data . 
    e.g.
    If you see the sample below, FName field has data and hence is structered correctly, however HairColorCd does not have data.
    The opening and closing tags of HairColorCd are on different lines when the xml response is opened in a text editor, and when opened in IE, there is a space. When the BizTalk (hosted as a WCF )responds to the caller application there appears a '/n ' in the
    value of the field.
    The correct value should have been null, i.e. ""
    <FName>LISA</FName><HairColorCd>
        </HairColorCd><HairColorDesc>
        </HairColorDesc><EyeColorCd>
        </EyeColorCd><EyeColorDesc>
        </EyeColorDesc>                                                                                                                                                                          
    ANy ideas on why this is happenning?ALl other enviornments(with same code) is working fine.

    Hi Rachana,
    I have faced the same issue last weeks with BizTalk 2010. This happens with versions of BizTalk 2006R2+ and  if you are loading the message using XML Document in some stage. So if that is the case, please check everytime you load the content of the
    message using XMLDocument and do it this way:
    Xmldoc= new System.Xml.XmlDocument();
    Xmldoc.PreserveWhitespace=false;
    Xmldoc.Load(CONTENT); // or Xmldoc.LoadXml(CONTENTAsSTRING)
    Xmldoc.PreserveWhitespace=true;
    YourBizTalkMessage=Xmldoc;
    Do it in this sequence and your problem should be solved.
    Regards, Mazin - MCTS BizTalk Server 2006

  • Change error tag names of the Response xml of a vanilla Inbound Webservice

    Hi,
    I am invoking a vanilla inbound webservice "Service Request" through Soap UI. Whenever any error occurs, in the response xml, some tags like "siebelf:error" is generated in the xml. However these tags are not present in the IO.My question is, can we change these tag names? If yes, then how?
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
    <SOAP-ENV:Fault>
    <faultcode>SOAP-ENV:Server</faultcode>
    <faultstring>Method 'SetFieldValue' of business component 'Service Request' (integration component 'Service Request') returned the following error:
    "The value entered in field Status of buscomp Service Request does not match any value in the bounded pick list FIN PickList Service Request Status.(SBL-DAT-00225)"(SBL-EAI-04376)</faultstring>
    <detail>
    <siebelf:siebdetail xmlns:siebelf="http://www.siebel.com/ws/fault">
    <siebelf:logfilename>EAIObjMgr_enu_0033_34603066.log</siebelf:logfilename>
    <siebelf:errorstack>
    <siebelf:error>
    <siebelf:errorcode>SBL-DAT-00225</siebelf:errorcode>
    <siebelf:errorsymbol/>
    <siebelf:errormsg>Method 'SetFieldValue' of business component 'Service Request' (integration component 'Service Request') returned the following error:
    "The value entered in field Status of buscomp Service Request does not match any value in the bounded pick list FIN PickList Service Request Status.(SBL-DAT-00225)"(SBL-EAI-04376)</siebelf:errormsg>
    </siebelf:error>
    </siebelf:errorstack>
    </siebelf:siebdetail>
    </detail>
    </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Regards
    Sagnik

    Hi,
    You should be able to edit the generated wsdl as you suggested, changing the
    "return" to something else. Then save the wsdl to a file, say
    "filename.wsdl", and then at the top of your jws add the following:
    * @jws:wsdl file="filename.wsdl"
    This will force the jws to use the wsdl you specify and you won't have to
    edit any maps. Of course, as your jws changes, you will need to regenerate
    the wsdl and change the "return" to something else.
    Mike Kaufman
    Software Engineer
    BEA Systems
    "sherlock" <[email protected]> wrote in message
    news:3cbbe81f$[email protected]..
    >
    I have created a webservice in workshop that has some methods what returnstring-data.
    Now I want to create clients with different software-products. Because Igot some
    errors with one of these products, I looked into the WSDL and noticed thatthe
    name of the response-datatype is 'return' (by default).
    You can see this here:
    - <s:element name="addUserResponse">
    - <s:complexType>
    - <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="return" nillable="true"type="s:string"
    />
    This 'return' is interpreted as a keyword in the client-generation tool.If I
    change this manually to another word then it works.
    When I try to change the 'Return XML' in the 'Edit Maps and Interface'Dialog,
    than the WSDL looks like this:
    - <s:element name="addUserResponse">
    - <s:complexType mixed="true">
    - <s:sequence>
    <s:any minOccurs="1" maxOccurs="unbounded" />
    Now the name- and type-definitions are completely missing.
    The question is now: how to change the name of the response-datatype from'return'
    to another (not-keyword-) name?
    I think this is important because I don't know what software a customeruses to
    generate a client and I can not expect that he manually edits myWSDL-file.
    >
    Thanks.

  • How to retain prolog in output xml after parse the input xml

    Hi,
    I am using com.bea.xml.XmlObject.Factory.parse(String) method to parse a xml.
    Input XML is having prolog defore the root node.But after parse the xml using the above method, the prolog is not there in the Output XML.
    can any one help me to retain the prolog in Output XML as it is in Input XML......
    Thanks in advance..
    Regards,
    Deba

    Hi,
    The Input XML is like
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <SOAP-ENV:Body>
         </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    But after parse the Output XML become
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <SOAP-ENV:Body>
         </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    But due to project requirement i want to keep the prolog(<?xml version="1.0" encoding="UTF-8"?>) as it is with Output XML after parse the xml.
    can i use any XMLOption while calling parse() method...Or any one have any otherway to retain prolog after parse ?
    please help me to get it .
    Thanks in advance.
    Regards,
    Deba

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

  • Parsing the large XML ( 1GB) using SAX PARSER

    We have very large XMLs being generated by processes. These XMLs should be validated first and then parsed next. We have implementation that works for small files. My question is
    how can we validate and parse large XMLs with SAX parser?

    The same way as parsing a small XML file, no? Why don't you try it? Then if you have problems that you can't solve, ask about them here.

  • XML dig. signatures: how to identify the root XML element?

    Hello, according to tutorials I need to do these two things to sign a XML document:
    ref = fac.newReference("#invoice",
      fac.newDigestMethod(DigestMethod.SHA1, null));
            XMLObject obj = fac.newXMLObject(Collections.singletonList(content),
                    "invoice", null, null);I need to create a general signing proces that will accept any XML file. In this piece of code I have "invoice" strings directly in the source code. Is it possible to replace them with some general strings? For both methods documentation reads "can be null" but I am getting the "XMLSignatureException: javax.xml.crypto.URIReferenceException: ResourceResolverException: Could not find a resolver for URI null and Base null".
    I have also tried "/" - this should be URI for the root element in the XPath. This leads to "URIReferenceException: java.lang.NullPointerException".
    I could "pre-parse" the XML and find the root element name but there must be "cleaner" method.
    Thanks in advance

    Hello, according to tutorials I need to do these two
    things to sign a XML document:
    ref = fac.newReference("#invoice",
    fac.newDigestMethod(DigestMethod.SHA1, null));
    XMLObject obj =
    fac.newXMLObject(Collections.singletonList(content),
    "invoice", null, null);
    ed to create a general signing proces that will
    accept any XML file. In this piece of code I have
    "invoice" strings directly in the source code. Is it
    possible to replace them with some general strings?
    For both methods documentation reads "can be null"
    but I am getting the "XMLSignatureException:
    javax.xml.crypto.URIReferenceException:
    ResourceResolverException: Could not find a resolver
    for URI null and Base null".
    I have also tried "/" - this should be URI for the
    root element in the XPath. This leads to
    "URIReferenceException:
    java.lang.NullPointerException".
    I could "pre-parse" the XML and find the root element
    name but there must be "cleaner" method.I am not quite sure what you are trying to do. What do you mean by "replace
    them with general strings"? If all you want to do is sign the entire contents of
    an arbitrary XML document, you should probably create an enveloped signature. For
    that you need to specify a URI of "" when creating your Reference (this indicates
    the root of the document) and also specify an enveloped Transform. There is
    an example of how to do this in the XMLDSig Tutorial (the genEnveloped example):
    http://java.sun.com/javase/6/docs/technotes/guides/security/xmldsig/XMLDigitalSignature.html

  • Unable to parse the given xml by unmarshalling it

    Hi,
    I have to fetch the data from xml to java object. I am using castor parsing. i have written mapping xml which is mapped against the xml from which data is to be fetched. The entire application is working fine.
    The problem is if i have data like
    <CampaignName>&<</CampaignName>
    then the unmarshalling is gettig failed and dispalying error message as
    "The entity name must immediately follow the '&' in the entity reference"
    Actually the xml is valid against validation and is allowing to use &< combination as data. But it is requirement to use the same data.
    Please help me to resolve this problem.
    srinivas.

    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.StringReader;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.CharacterData;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.InputSource;
    public class XMLParsingProj {
    public static void main(String arg[]) throws Exception {
    String xmlData = "";
    FileReader fileReader = new FileReader(new File("XMLData.xml"));
    BufferedReader bufReader = new BufferedReader(fileReader);
    String xmlLine = "";
    while ((xmlLine = bufReader.readLine()) != null) {
    xmlData += xmlLine;
    System.out.println("String Value is");
    System.out.println(xmlData);
    DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    InputSource is = new InputSource();
    is.setCharacterStream(new StringReader(xmlData));
    Document doc = db.parse(is);
    NodeList nodes = doc.getElementsByTagName("soap:Envelope");
    for (int i = 0; i < nodes.getLength(); i++) {
    Element element = (Element) nodes.item(i);
    NodeList name = element.getElementsByTagName("soap:Body");
    Element line = (Element) name.item(0);
    System.out.println("Name: " + line.getTagName());
    NodeList title = element.getElementsByTagName("lookupResponse");
    line = (Element) title.item(0);
    System.out.println("Status: " + line.getAttribute("status"));
    System.out.println("data node length :" + nodes.getLength());
    }

  • How to parse the following xml file

    Hi
    I have an xml file with the following data
    Example.xml
    <?xml version="1.0" encoding="iso-8859-1"?>
    <html><set label="09/07/29" value="1241.90"/>
    </html>
    How do i retrive the values of the attributes
    Example i want the label value 09/07/29
    and 1241.90 to be inserted into some temp table.
    Appreciate if any one can provide me the solution.
    Thanks,

    it's more an XQuery question than DB XML one.
    Anyway, you can use the following queries to get attributes values:
    doc(<your_doc>)/html/set/@label
    doc(<your_doc>)/html/set/@valueYou can retrieve both values in a single query, but for this please refer to the XQuery specification.
    Or read: [http://www.oracle.com/technology/documentation/berkeley-db/xml/gsg_xml/java/xquery.html#xqueryintro]
    Best,
    Vyacheslav

  • Maximum XML file size that can parsed with c++ XML parser

    Hi!
    what is the maximum file size that can be parsed using the xml parser(version 1) for c++ on linux .
    i'm getting an error(error no 231) when i try to parse an XML file of 3MB on Red Hat Linux 6.1
    Regards
    anjana

    moving to xml db forum

  • XML namespace to be changed in the outgoing xml message

    HI
    in my scenario I am sending data to a web service .
    The xml namespace that is being sent in t he data is the namespace under which the the object is created.
    while sending the data to the webservice i do not want the ns0: to be attached to the message type and the xml namespace to go as the xml namespace of the vendor.
    Thanks
    Nikhil

    Hi,
    As everyone said you need to remove the namespace in the Message Type screen. If it is a imported XSD you need to remove the attribute targetNamespace.
    After doing this do the mapping once again by selecting the modified message type.
    The above should work... if you are not able to solve it still you can use the following XSLT in the interface mapping after the massage mapping. This is will remove the namespaces and ns0: etc.
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="xml" indent="no"/>
      <xsl:template match="/|comment()|processing-instruction()">
        <xsl:copy>
          <xsl:apply-templates/>
        </xsl:copy>
      </xsl:template>
      <xsl:template match="*">
        <xsl:element name="{local-name()}">
          <xsl:apply-templates select="@*|node()"/>
        </xsl:element>
      </xsl:template>
      <xsl:template match="@*">
        <xsl:attribute name="{local-name()}">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:template>
    </xsl:stylesheet>

  • Generating target XML tag from a value in the Source XML document

    Hi there,
    I have a scenario where the following transformation needs to occur:
    Source Message...
    <Catalogue>
      <key>abc<\key>
      <value>123<\value>
      <key>def<\key>
      <value>456<\value>
    <\Catalogue>
    Target Message...
    <Catalogue>
      <abc>123<\abc>  --> Value of KEY becomes the XML tag and the VALUE gets assigned to it
      <def>456<\abc>
    <\Catalogue>
    The target message is written to an xml file using the receiver file adapter.
    I would like the target message generation to be dynamic so that when a new key-value pair is added, it would not require a change in the XI mapping layer.  Is there a way to accomplish this without having to code or enhance the adapter.  I am trying to avoid doing this in the mapping because that would mean changing the mapping every time a new key-value pair needs to be added.
    Any suggestions to accomplish this are welcome.
    Thanks all.

    Hi,
    I doubt if it will work for you. you can generate dynamic values using this but not tags dynamically. You need to see if there are any methods to generate tags dynamically.
    One way of doing this is by using Java Mapping and playing around with InputStream and OutputStream.It will work for sure with this.
    Thanks
    Amit

Maybe you are looking for

  • Error 1334 (in LabVIEW Run-Time Engine 7.1.1 setup) when launching VB6's IDE

    What's going on here?  I have LabVIEW 7.0 and Visual Basic 6 installed on this Win-XP computer.  When I open VB6, I always get what looks like a Windows Installer error: First, it asked me for the location of "lvruntimeeng.msi", which I located for i

  • 2 Dimensions to 3 Dimensions

    How do I take a circle and make it into a cylinder or a square into a cube?

  • Photo access by apps

    Photo apps, like Art Camera, used to be able to access photo albums on my phone but can't now.  If I go to Privacy/Photos, it doesn't give me the option to allow these programs access.

  • Setting default program to open videos

    So I like to use VLC for videos but whenever I open a video (.avi) it opens in quicktime (and with the videos that I have quicktime doesn't work) so I have to right click and open with VLC. I couldn't figure out how to make VLC the default player for

  • Premiere multicam to after effects

    I have 3 camera green screen shot that i edited in premiere with multicam. I sometimes use the nice option to copy video clips from premiere and paste to AE so I have all the cuts. But when I do this with multicam sequence I got the cuts, but every c