Xml representation of a string

hi all,
how do i make an xml representation of a string..if anyone knows please post it.
thanks

wow, you guys must be all in the same class, that's 3 times this question has been asked. Look below...

Similar Messages

  • Generating an XML representation of arbitrary Java objects

    Hi. Just for fun, I'm attempting to write some code which creates an XML representation of an arbitrary java object using reflection. The idea is that only properties with get/set methods should come through in the XML.
    Here is the code:
    package com.uhg.aarp.compas.persistence.common.xml;
    import java.io.IOException;
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.FactoryConfigurationError;
    import javax.xml.parsers.ParserConfigurationException;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.w3c.dom.Document;
    import org.w3c.dom.DOMException;
    import org.w3c.dom.Node;
    import java.util.Stack;
    public class XMLDAO {
         public static String getXMLWithHeader(Object obj){
              return "<?xml version=\"0\"?>" + getXML(obj);
          * Returns an XML representation of an arbitrary object
         public static String getXML(Object obj){
              StringBuffer buffer = new StringBuffer();
              AccessorMethod[] accessorMethods = getAccessorMethods(obj);
              buffer.append("<" + obj.getClass().getName() + ">\n");
              //List
              if(obj instanceof List){
                   List objList = (List)obj;
                   Iterator iterator = objList.iterator();
                   while(iterator.hasNext()){                              
                        buffer.append(getXML(iterator.next()));
              else{
                   for(int i = 0; i < accessorMethods.length; i++){
                        Object fieldObj = null;
                        try{
                             fieldObj = accessorMethods.invoke();
                             1. Primitive Wrapper or String(base case)
                             if(fieldObj instanceof Integer || fieldObj instanceof Float || fieldObj instanceof Double
                                  || fieldObj instanceof Long || fieldObj instanceof String){
                                  buffer.append("<" + accessorMethods[i].getAccessorFieldName() + ">");
                                  buffer.append(accessorMethods[i].invoke());
                                  buffer.append("</" + accessorMethods[i].getAccessorFieldName() + ">\n");
                             else if(fieldObj instanceof Object[]){
                                  buffer.append("<" + accessorMethods[i].getAccessorFieldName() + ">\n");
                                  Object[] fieldArray = (Object[])fieldObj;
                                  for(int j = 0; j < fieldArray.length; j++)
                                       buffer.append(getXML(fieldArray[i]));
                                  buffer.append("</" + accessorMethods[i].getAccessorFieldName() + ">\n");
                        }catch(Exception e){
                             System.out.println("Couldn't invoke method: " + accessorMethods[i].getName());
              buffer.append("</" + obj.getClass().getName() + ">\n");
              return buffer.toString();
         * Returns the Object representation for the XML - used to rebuild Java objects
         * converted to XML by XMLDAO.getXML().
         public static Object getObject(String xmlString) throws ParserConfigurationException,
              SAXException, IOException{
              //the root element is the class name
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              DocumentBuilder builder = factory.newDocumentBuilder();
              Document document = builder.parse(xmlString);
              Stack objectStack = new Stack();
              return getObject(document);
         private static Object getObject(Node n){
              //every document is either an object or a bean property
              //all bean properties have values
              //no object has a value, it can only have bean properties
              //the base case occurs when the document has a value
              String nodeName = n.getNodeName();
              if(n.getNodeValue() == null){
                   System.out.println("node " + nodeName + " is an object");
              else{
                   System.out.println("node " + nodeName + " is a bean property");
              return null;
         * Returns all of the "getter" methods for the given object
         private static AccessorMethod[] getAccessorMethods(Object obj){
              Class theClass = obj.getClass();
              Method[] objMethods = theClass.getMethods();
              ArrayList methodList = new ArrayList();
              for(int i = 0; i < objMethods.length; i++){
                   try{
                        methodList.add(new AccessorMethod(obj, objMethods[i]));
                   }catch(IllegalArgumentException e){}
              return (AccessorMethod[])methodList.toArray(new AccessorMethod[methodList.size()]);
         * Invokes the specified "getter" method and returns the result as an Object
         private Object invokeAccessorMethod(Object obj, Method m) throws IllegalAccessException,
              InvocationTargetException{
              return m.invoke(obj, null);
    package com.uhg.aarp.compas.persistence.common.xml;
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    * Represents an AccessorMethod (i.e. getField()) on an Object
    public class AccessorMethod{
         private Object obj;
         private Method m;
         private String accessorFieldName;
         * Constructor for AccessorMethod
         public AccessorMethod(Object obj, Method m) throws IllegalArgumentException{
              1. Method name starts with get
              2. Method name does not equal get
              3. Method takes no arguments
              4. Method return type is not void
              String methodName = m.getName();
              if(methodName.indexOf("get") != 0 || methodName.length() == 3 &&
                   m.getParameterTypes().length != 0 && m.getReturnType() != null){
                   throw new IllegalArgumentException("Not a valid getter method " + methodName);
              this.obj = obj;
              this.m = m;
              String tempName = m.getName().substring(3, m.getName().length());
              this.accessorFieldName = Character.toLowerCase(tempName.charAt(0)) + tempName.substring(1, tempName.length());
         public Object invoke() throws IllegalAccessException, InvocationTargetException{
              return m.invoke(obj, null);
         * Gets the m
         * @return Returns a Method
         public Method getM() {
              return m;
         * Sets the m
         * @param m The m to set
         public void setM(Method m) {
              this.m = m;
         * Gets the accessorFieldName
         * @return Returns a String
         public String getAccessorFieldName() {
              return accessorFieldName;
         * Sets the accessorFieldName
         * @param accessorFieldName The accessorFieldName to set
         public void setAccessorFieldName(String accessorFieldName) {
              this.accessorFieldName = accessorFieldName;
         * Gets the obj
         * @return Returns a Object
         public Object getObj() {
              return obj;
         * Sets the obj
         * @param obj The obj to set
         public void setObj(Object obj) {
              this.obj = obj;
         public String getName(){
              return this.m.getName();
    I'm having some trouble figuring out how to implement the XMLDAO.getObject(Node n) method. I was thinking of maintaining a Stack of the previous Objects as I traverse the DOM, but I think that might be unnecessary work. Basically I'm wondering how I determine what the last "object" is in the DOM from any given node. Anyone have any input?

    I think the end of my post got cut off:
    I'm having some trouble figuring out how to implement the XMLDAO.getObject(Node n) method. I was thinking of maintaining a Stack of the previous Objects as I traverse the DOM, but I think that might be unnecessary work. Basically I'm wondering how I determine what the last "object" is in the DOM from any given node. Anyone have any input?

  • Assigning a node value from an XML variable to a String type  in Weblogic Process Integrator

    Hi,
    Is there any way to assign a node value from an XML variable to a String variable
    in Weblogic Process Integrator...
    Thanx.
    Narendra.

    Nerendra
    Are you talking about using Xpath on the XML document and assigning to a
    variable, it is unclear what you are asking
    Tony
    "Narendra" <[email protected]> wrote in message
    news:3bba1215$[email protected]..
    >
    Hi,
    Is there any way to assign a node value from an XML variable to a Stringvariable
    in Weblogic Process Integrator...
    Thanx.
    Narendra.

  • How to make an XML in form of String to well-formed XML document

    Hi Folks,
         Thanks for all you support in Advance, i have a requirement, where i have an XML in one line string form and i wondering how to convert into well formed XML?
    Input XML sample:
    <root> <one><link1></link1></one><two></two> </root>
    to well-formed XML
    <root>
          <one>
              <link1></link1>
         </one>
         <two>
         </two>
    </root>
    I was trying to create a well-formed document using DOM or SAX parsers in ExcuteScript activity, but it is leading to some complicated exceptions. And i am looking for the simplest way for transformation.
    Please let me know
    thanks,
    Rajesh

    Rajesh,
    I don't understand. There is no difference between the two XML instances other than whitespace. They are both well-formed XML.
    <root> <one><link1></link1></one><two></two> </root>
    <root>
          <one>
              <link1></link1>
         </one>
         <two>
         </two>
    </root>
    Steve

  • How to create an XML document from a String.

    Can anyone help,
         In the Microsoft XML Document DOM there is a load function load(string) which will create an XML document, but now we are switching to Java and I do not know how to create and XML document from a string, this string �xml document� is passed to my program from a webservice and I need to read several xml elements form it in a web server.
    This string is a well formatted XML document:
    <?xml version="1.0" encoding="UTF-8"?>
    <Countries NumberOfRecords="1" LanguageID="en-us">
         <Country>
              <CountryCode>AU</CountryCode>
              <CountryName>AUSTRALIA</CountryName>
         </Country>
    </Countries>

    Thanks PC!
    I made it work using:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    factory.setIgnoringComments(true); // We want to ignore comments
    // Now use the factory to create a DOM parser
    DocumentBuilder parser = factory.newDocumentBuilder();
    //TransformThisStringBuffer is a string buffer wich contain the 'XML document (String)'
    InputStream in = new ByteArrayInputStream(TransformThisStringBuffer.toString().getBytes());
    // Parse the InputStream and build the document
    Document document = parser.parse(in);
    But which one is faster InputSource or InputStream, were would you put the "new InputSource(new StringReader(yourString))" in the above code?

  • How to get the WHOLE xml document inside a string using XSLT mapping

    Hi folks,
    I have a deep xml structure that I want to embed as body, tags included, in a mail message (not as an attachment).
    I'm trying to use Michal's method in this blog
    /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
    However, I can't get it to deliver the entire structure instead of just specific elements.
    Any help is greatly appreciated,
    Thanks,
    Guy

    Ashok,
    I was able to work it out for my case.
    This XSL......
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <inside>
    <namestring>
    <xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text>
    <xsl:copy-of select="outside/name/*"/>
    <xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text>
    <xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
    </namestring>
    </inside>
    </xsl:template>
    </xsl:stylesheet>
    ...will transform this input....
    <?xml version="1.0" encoding="UTF-8"?>
    <outside>
    <name>
    <nameone>name1</nameone>
    <nametwo>name2</nametwo>
    <namethree>name3</namethree>
    </name>
    </outside>
    ...and put the whole lot into the CDATA element.
    Hope this helps you,
    Guy

  • Converting hexadecimal XML data to a string

    Hello!
    Until now I generated XML data with the FM 'SDIXML_DOM_TO_XML'.
    After that I did a loop over the xml_as_table in which I was casting each line of that table to a string.
    ASSIGN <line> TO <line_c> CASTING.
    After the inftroduction of unicode in our system I get a error:
    In the current program an error occured when setting the field symbol <LINE_C> with ASSIGN or ASSIGNING (maybe in combination with the CASTING addition).
    When converting the base entry of the field symbol <LINE_C> (number in base table: 32776), it was found that the target type requests a memory alignment of 2
    What does it mean? Does somebody have a solution.
    I need this function for sending this XML data as string over a simple old CPIC connection.
    Best regards
    Martin

    Hello Martin
    Perhaps my sample report ZUS_SDN_XML_XSTRING_TO_STRING provides a solution for your problem.
    *& Report  ZUS_SDN_XML_XSTRING_TO_STRING
    *& Thread: Converting hexadecimal XML data to a string
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1029652"></a>
    REPORT  zus_sdn_xml_xstring_to_string.
    *-- data
    *-- read the XML document from the frontend machine
    TYPES: BEGIN OF xml_line,
            data(256) TYPE x,
          END OF xml_line.
    DATA: xml_table TYPE TABLE OF xml_line.
    DATA: go_xml_doc       TYPE REF TO cl_xml_document,
          gd_xml_string    TYPE string,
          gd_rc            TYPE i.
    PARAMETERS:
      p_file  TYPE localfile  DEFAULT 'C:payload_idoc.xml'.
    START-OF-SELECTION.
      CREATE OBJECT go_xml_doc.
      " Load XML file from PC and get XML itab
      CALL METHOD go_xml_doc->import_from_file
        EXPORTING
          filename = p_file
        RECEIVING
          retcode  = gd_rc.
      CALL METHOD go_xml_doc->get_as_table
        IMPORTING
          table   = xml_table
    *      size    =
    *      retcode =
    " NOTE: simulate creation of XML itab
      go_xml_doc->display( ).
      create object go_xml_doc.
      CALL METHOD go_xml_doc->parse_table
        EXPORTING
          table   = xml_table
    *      size    = 0
        receiving
          retcode = gd_rc.
      CALL METHOD go_xml_doc->render_2_string
    *    EXPORTING
    *      pretty_print = 'X'
        IMPORTING
          retcode      = gd_rc
          stream       = gd_xml_string
    *      size         =
      write: / gd_xml_string.
    END-OF-SELECTION.
    Regards
      Uwe

  • Javax.xml.ws.Endpoint.publish(String address), the address should be escape

    Hi,
    javax.xml.ws.Endpoint.publish(String address), the address should be escaped or not?
    For example,
    Endpoint.publish("http://localhost:9090/test test", new TestImpl());
    or
    Endpoint.publish("http://localhost:9090/test+test", new TestImpl());
    or
    Endpoint.publish("http://localhost:9090/test%20test", new TestImpl());
    And in the WSDL, the service location should be
    <soap:address location="http://localhost:9090/test test" />
    or
    <soap:address location="http://localhost:9090/test+test" />
    or
    <soap:address location="http://localhost:9090/test%20test" />
    Any comment will be appreciated!
    -tong

    I spent some more time on this subject, and basically, if one steps out of the ordinary WebServices stuff (that is, using web.xml for declaring services, and deploying on a standard servlet container server like tomcat or websphere), then things are a bit more complicated. In the ordinary case with tomcat and others, it is the server that will take on an HTTP request, then instantiate the servlet, contain it in a container, and have the request handled. If you on the other hand want to define your servlets beforehand, and be ready to handle HTTP requests, the whole point is that one needs to find a servlet transport mechanism that can host the WebService. And there are not many options, with in fact the only one being referenced is the Apache CXF Servlet that is Spring disabled. It looks more as a dirty hack than anything else, but one does not have any other option, as there is no real servlet container implementation in javax(.servlet). Well, there is, e.g. the HttpServlet, but if you opt for that, then you need to do write your own SOAP handler to deal with WebServices.
    I will give it a try to have the Helios Thing Handlers bind the OSGi HttpService, and have them register themselves as Servlets on the already present Jetty. I am curious how this work in term of life-time management, e.g. HttpService being available, or not and so forth.
    In any case, the standard javax.ws API is working well, e.g. it creates a light and standard Sun provided http server, which is maybe not ideal, but it works wonderfully well.
    Maybe one day we will provide not only a full REST interface to OH, but maybe also a full SOAP WebService interface so that OH can be interconnected with other services or parties.

  • Number representation of a string..

    Hi all,
    I want to get a number representation of a string. The string could be anything.
    I do not need to be able to convert it back.
    How can I do this?
    No length or adding up the char codes is not good as ABD would be the same as BAD etc.
    Well - A hash would do.
    I've just found get_hash_value so that may be sufficient.
    Edited by: user10071099 on Jun 17, 2009 10:02 AM

    You could use rawtohex function for that ( or , if there should be no relation between string content and the number - you can use any of popular hash functions , such as sha1 or md5)
    Best regards
    Maxim

  • Parsing a parenthetic representation of a string to tree

    I have a little assignment and I have no thoughts at all anymore. I must convert a string ( like A(B,C) or A(B(C,D), E(F)) ) that represents a left-representation of binary tree. I must convert into a object and after that turn it around - I must make a right-representation of a string from object.
    I made a class below:
    import java.util.*;
    public class kodutoo_5 implements Enumeration<kodutoo_5> {
         private String name;
         private kodutoo_5 firstChild;
         private kodutoo_5 nextSibling;
         kodutoo_5(String n, kodutoo_5 d, kodutoo_5 r) {
              setName(n);
              setNextSibling(d);
              setFirstChild(r);
         kodutoo_5() {
              this("", null, null);
         kodutoo_5(String n) {
              this(n, null, null);
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
         public kodutoo_5 getFirstChild() {
              return firstChild;
         public void setFirstChild(kodutoo_5 firstChild) {
              this.firstChild = firstChild;
         public kodutoo_5 getNextSibling() {
              return nextSibling;
         public void setNextSibling(kodutoo_5 nextSibling) {
              this.nextSibling = nextSibling;
         public String toString() {
              return getName();
         public boolean hasMoreElements() {
              return (getNextSibling() != null);
         public kodutoo_5 nextElement() {
              return getNextSibling();
         public Enumeration<kodutoo_5> child() {
              return getFirstChild();
         private static kodutoo_5 addChild(kodutoo_5 parent, kodutoo_5 current, String nodeString) {
              kodutoo_5 result = current;
              //kui alluvaid ei ole, siis jarelikult juurtipp
              if(parent.getFirstChild() == null) {
                   //lisame alluva
                   parent.setFirstChild(new kodutoo_5(nodeString));
                   result = parent.getFirstChild();
              //alluvaid on
              } else {
                   result.setNextSibling(new kodutoo_5(nodeString));
                   result = result.getNextSibling();
              return result;
         public static kodutoo_5 parseTree(String s) {
              kodutoo_5 emptyRoot = new kodutoo_5();
              parseTree(emptyRoot, s);
              return emptyRoot.getFirstChild();
         private static void parseTree(kodutoo_5 parent, String s) {
              kodutoo_5 current = null;
              StringTokenizer st = new StringTokenizer(s, "(),", true);
              StringBuilder sb = new StringBuilder();
              while(st.hasMoreTokens()) {
                   String element = st.nextToken();
                   if(element.compareTo("(") == 0) {
                        if(sb.length() > 0) {
                             current = addChild(parent, current, sb.toString());
                             sb = new StringBuilder();
                   } else if(element.compareTo(")") == 0) {
                        if(sb.length() > 0) {
                             current = addChild(parent, current, sb.toString());
                             sb = new StringBuilder();
                   } else if(element.compareTo(",") == 0) {
                        if(sb.length() > 0) {
                             current = addChild(parent, current, sb.toString());
                             sb = new StringBuilder();
                   } else {
                        sb.append(element);
              if(sb.length() > 0) {
                   current = addChild(parent, current, sb.toString());
         public String rightParentheticRepresentation() {
              StringBuilder sb = new StringBuilder();
              //kontrollime kas juurtipp eksisteerib
              if (getName() == null) {
                   throw new NullPointerException("Puud ei eksisteeri!");
              //kontrollime ega juurtipp tuhi ei ole
              if (getName() == "") {
                   throw new RuntimeException("Puud ei eksisteeri!");
              //juurtipp eksisteerib, jarelikult ka puu
              if (getFirstChild() != null) {
                   sb.append("(");
                   sb.append(getFirstChild().rightParentheticRepresentation());
                   Enumeration<kodutoo_5> child = child();
                   while (child.hasMoreElements()) {
                        sb.append(",");
                        child = child.nextElement();
                        sb.append(((kodutoo_5) child).rightParentheticRepresentation());
                   sb.append(")");
              sb.append(getName());
              return sb.toString();
         public static void main(String[] args) {
              String s1 = "A(B,C)";
              //String s2 = "A(B(C,D),E(F))";
              kodutoo_5 t1 = kodutoo_5.parseTree(s1);
              //kodutoo_5 t2 = kodutoo_5.parseTree(s2);
              String v1 = t1.rightParentheticRepresentation();
              //String v2 = t2.rightParentheticRepresentation();
              System.out.println(s1 + " ==> " + v1);
              //System.out.println(s2 + " ==> " + v2);
    }But I can't make it right. Can anybody help me out to make this code work, please? Or point me what I'm doing wrong here?

    Add debugging statements to your code to see what it's doing and where it's going wrong.

  • Convert the IDOC XML file into single string?

    Hello All,
    I have a scenario, where i need to conver the IDOC XML  into single string, to send it to target.
    Please let me know how can we achive this, I dont know java coding.
    Please help me out to write the java code.
    Thanks and Regards,
    Chinna

    Hi Chinna,
    You can do this in two ways -
    1. Java mapping
    https://wiki.sdn.sap.com/wiki/display/XI/JavaMapping-ConverttheInputxmlto+String
    https://wiki.sdn.sap.com/wiki/display/Snippets/JavaMapping-ConverttheInputxmltoString
    2. XSLT mapping
    /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
    Regards,
    Sunil Chandra

  • Have XML data in a string, can't extract it to the XML bean class

    Hi All, I have a string that contains XML data, for example,
    string str has "<one>1<\one><two>2<\two>". i have the XML beans classes,
    but i am unable to get this data out of the string and add it to the xml bean
    classes.
    I anybody has a clue as to how to code this, please help ASAP.
    Thanks,
    kuneev

    Hi Kunnev,
    Lets say I have an xsd
    <?xml version="1.0"?>
    <xs:schema
         xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:bea="http://www.bea.com/xmlbeans/Sample.xsd"
         targetNamespace="http://www.bea.com/xmlbeans/Sample.xsd"
         elementFormDefault="qualified"
         attributeFormDefault="unqualified">
    <xs:element name="Person">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="FirstName" type="xs:string" />
    <xs:element name="LastName" type="xs:string" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    Now after I compile this I would get XMLBean classes
    Like Person is a xmlBean class. The code snippet below shows how I can convert
    a string into a xmlbean of type Person.
    XmlOptions xopt = new XmlOptions();
    xopt.setDocumentType(Person.type);
    Person x0 = (Person) XmlObject.Factory.parse(
    "<xml-fragment>" +
    "<FirstName>desc---1</FirstName>" +
    "<LastName>desc---2</LastName>" +
    "</xml-fragment>", xopt);
    Person pp = (Person)x0;
    Now pp is a XMLBean object which can be added to the tree.
    Let me know if you have any questions.
    Thanks a lot,
    Vimala
    "kuneev" <[email protected]> wrote:
    >
    Hi All, I have a string that contains XML data, for example,
    string str has "<one>1<\one><two>2<\two>". i have the XML beans classes,
    but i am unable to get this data out of the string and add it to the
    xml bean
    classes.
    I anybody has a clue as to how to code this, please help ASAP.
    Thanks,
    kuneev

  • What is LV c code representation of NULL string

    I know that through .so/.dll code the representation of any string is a structure of the length followed by the characters, I allocate a long blank string in the LV code and copy over my strings in the .so/.dll and that works fine. How do I return a LV NULL string?

    dgholstein wrote:
    > I know that through .so/.dll code the representation of any string is
    > a structure of the length followed by the characters, I allocate a
    > long blank string in the LV code and copy over my strings in the
    > so/.dll and that works fine. How do I return a LV NULL string?
    As long as LabVIEW is not supporting 64 bit platforms a NULL pointer is
    really just a 32 bit integer with the value 0.
    So if you want to call a dll/so function which allows for a NULL pointer
    as parameter, you configure that parameter to be a signed or unsigned 32
    bit integer and wire the value 0 to its input.
    As to the LabVIEW string itself if you call a DLL it is usually better
    to use a C string type instead of the native LabVIEW handle. Once you
    use a LabVIEW handle t
    hat DLL really is difficult to use in other
    environments than LabVIEW.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • XML output as pure string

    Hello,
    I have a requirement to do a MII BLS transaction exposed as Webservice... This WS should return a XML message as a string.
    Problem is that the returned string is xml encoded... But I need it as it!
    So for example, I did a very small transaction with a string output parameter, just containing "<", result is :
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soap:Body>
          <XacuteResponse xmlns="http://www.sap.com/xMII">
             <Rowset>
                <Row>
                   <e>&amp;lt;</e>
                </Row>
             </Rowset>
          </XacuteResponse>
       </soap:Body>
    </soap:Envelope>
    is there a way to avoid this ? And receive <e><</e> ?
    Thanks
    Olivier
    Edited by: Olivier Thiry on May 13, 2011 3:27 PM
    Edited by: Olivier Thiry on May 13, 2011 3:28 PM

    I do it exactly like you say : link xml to string, no encode/decode. In MII Workbench, no problem, it's pure string, but if you consume the WS from any other tool (we tried from SOAP UI, Webdynpro, .Net, or even running the transaction in browser user the SOAPRunner), the result is a XML encoded string.
    If you look at the exemple I provided, you see the response with e = "<" in my MII transaction...
    I think it's more related to SOAP transport, which doesn't allow to have xml inside a xml field...

  • XML output as a string

    Hello
    I am having a XSLT where I am transforming multilevel source XML to a single level target XML. XSLT works fine from XSLTTester utility from SAP.
    The same XSLT I reused in XI and its working fine over there too.But the problem is the output XML what it generates is to be passed as a string to target application class.The target application takes entire XML structure as a string.
    Can anyone knows how this can be done from XI? In ABAP CALL TRANSFORMATION function takes XML string and returns transformed XML string.
    Thanks in advance.
    Regards
    Rajeev

    Hello
    My sender is an XML file which users can upload from a web-page i.e. HTTPSender to XI. This file gets transformed to target XML file using XSLT. My receiver system is SAP R/3 where there is a custom built application which already has got XML interface.This interface is a ABAP-class which has a method to parse the XML.
    This method accepts XML as a string and then creates necessary objects.What I am doing currently is building an RFC in which I am instantiating this class and trying to use the same method to create its object.
    So I want to convert the target XML as one string then my RFC would have only one importing parameter which is string which I could pass to the custom method.
    Do let me know if u have idea about this.
    Thanks in advance.
    Regards
    Rajeev

Maybe you are looking for

  • How can I transfer from iPod (16GB) to new computer (Windows 7) without erasing iPod?

    My old computer (Windows 7) died and I have a new computer (Windows 7). I had my iTunes library backed up, but I can't get it to work on my new computer. Is there a way to transfer what is on my iPod Touch (16 gb) to my new computer without losing it

  • ADC to DVI Convertor

    Hi I have just bought a MacPro to be used as a server for a small office but want to use an old Apple 17 inch LCD Studio Display with an ADC connector. I was surprised to find that the MacPro only has DVI ports...? Anyway will one of these ADC-DVI co

  • Standard extractor for shipment cost information(appl.08)

    I need some clarification on "08" extractors. We are using BW30B with PI2003.1 on the SAP enterprise side. We need to transfer the shipment cost details like cost centre, business area, G/l account etc? We have shipment cost documents which have the

  • My FSG report drill down redirectly to PROD url in the cloned instance

    Hi All, Version : R12.1.3 DB : 11.2.0.3 My FSG drill down is giving error in my DEV instance ,as the drill down is taking me to wrong url(PRODUCTION) Anyone know where to define the hostname for drill down RG. Thanks

  • Aperture 3.4.3 "Loupe" bug

    On my new iMac running OSX 10.8.2 and Aperture 3.4.3 ... if "Use Centered Loupe" is selected, the Loupe appears, but if I try to move it, the Loupe zips to the upper left corner of the Aperture window and the entire Aperture window slides to the righ