Problem passing a XML parameter

Mrs,
I need to pass a XML parameter from an OAF page to an external page. Below there is a piece of code where I did it at first (through parameters - GET). The problem: the XML has a variable length, so it can be bigger than GET limits.
How could I pass it via POST? Put it on an OAFormValueBean doesn't seems to be a good answer, since XML tags ("<" and ">") and accents (we use Portuguese - BR) get processed in &xxx; notation. Therefore, as you can see, the page it's only used to mount XML and call another page.
Dev Guide has a chapter "Posting to an OA Framework Page from a Different Technology". I think I need something like "POSTING FROM AN OA FRAMEWORK PAGE TO A DIFFERENT TECHNOLOGY".
Any ideas?
Tks.
Elner Ribeiro
CODE:
processRequest()
String xmlData = "<ReservaMultiGDSRoot>" + xmlPassag + xmlContato + "</ReservaMultiGDSRoot>";
HashMap par = new HashMap();
par.put("XmlData",xmlData);
par.put("UrlPostBack","https://oafHost/OA_HTML/OA.jsp?page=/oracle/apps/xx/xx/webui/xxPG");
pageContext.forwardImmediately("http://externalUrl/page.aspx",
OAWebBeanConstants.REMOVE_MENU_CONTEXT,
par,
false,
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
}

forwardImmediately would just forward the request to the indicated resource.
"POSTING FROM AN OA FRAMEWORK PAGE TO A DIFFERENT TECHNOLOGY".
doing this means you are leaving the apps context and going to a different location, which is out of apps security.As a workaround what you can do is:
1. Create a jsp in $OA_HTML
2. From your OA page, navigate to this jsp, as a normal url link destination
3. in the jsp, use ServletSessionManager.getURL ("<url>") and then post the data to the page you want to visit.
4. Remember to define a function in the same menu to navigate to the jsp.
Thanks
Tapash

Similar Messages

  • XSLT problem passing raw XML

    Hello,
    I've a problem passing a piece of raw XML code to an external assembly to do some tasks.
    The problem is that if I use an XSLT like this:
    <xsl:template name="xml-to-string-called-template">
       <xsl:param name="param1" />
              <xsl:element name="ns0:Root">
                  <xsl:variable name="tryThisTemplate">
                      <xsl:text disable-output-escaping="yes"></xsl:text>
                          <xsl:call-template name="identity" />
                      <xsl:text disable-output-escaping="yes"></xsl:text>
                  </xsl:variable>
    <xsl:copy-of select="$tryThisTemplate" />
               </xsl:element>
    </xsl:template>
    <xsl:template name="identity" match="@*|node()">
       <xsl:copy>
    <xsl:apply-templates select="@*|node()" />
       </xsl:copy>
     </xsl:template>
    I have as output the XML with all tags like expected (the TestFunction take a string as input ad return the same string as output), like this:
    <ns0:Root xmlns:ns0="http://BizTalk_Server_ProjectDemo.SchemaOut1Node">
    - <ns0:Travel xmlns:ns0="http://BizTalk_Server_ProjectDemo.SchemaIN">
      <DateTimeStart>1999-05-31T13:20:00.000-05:00</DateTimeStart>
      <Field>Field_0</Field>
      </ns0:Travel>
     </ns0:Root>
    The problem is that if I try to pass the variable to my external assembly, in this way:
    <xsl:template name="xml-to-string-called-template">
       <xsl:param name="param1" />
              <xsl:element name="ns0:Root">
                  <xsl:variable name="tryThisTemplate">
                      <xsl:text disable-output-escaping="yes"></xsl:text>
                          <xsl:call-template name="identity" />
                      <xsl:text disable-output-escaping="yes"></xsl:text>
                  </xsl:variable>
                  <xsl:variable name="pCC" xmlns:ScriptNS0="http://schemas.microsoft.com/BizTalk/2003/ScriptNS0"
    select="ScriptNS0:TestFunction($tryThisTemplate)" />
                    <xsl:text disable-output-escaping="yes"></xsl:text>
    <xsl:copy-of select="$pCC" />
                    <xsl:text disable-output-escaping="yes"></xsl:text>
               </xsl:element>
    </xsl:template>
    saving its return value and printing it, I have as output the values of fields contained in $tryThisTemplate variable, and not all the XML like I need:
    <ns0:Root xmlns:ns0="http://BizTalk_Server_ProjectDemo.SchemaOut1Node">1999-05-31T13:20:00.000-05:00
    Field_0</ns0:Root>
    What can I do to pass all the raw XML to my function and not the values of its fields?
    I tried to declare the output method as like xml than html or text but nothing changed

    First, of all your input xml has invalid namespace declaration, is this like below what mean to say:
    <ns0:Root xmlns:ns0="http://BizTalk_Server_ProjectDemo.SchemaOut1Node">
      <ns1:Travel xmlns:ns1="http://BizTalk_Server_ProjectDemo.SchemaIN">
        <DateTimeStart>1999-05-31T13:20:00.000-05:00</DateTimeStart>
        <Field>Field_0</Field>
      </ns1:Travel>
    </ns0:Root>
    Second, you can achieve what you are trying to map using very simple map like below:
    and you can see the xslt is generated like below:
    <?xml version="1.0" encoding="UTF-16"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var s0 userCSharp" version="1.0" xmlns:s0="http://BizTalk_Server_ProjectDemo.SchemaIN" xmlns:ns0="http://BizTalk_Server_ProjectDemo.SchemaOut1Node" xmlns:userCSharp="http://schemas.microsoft.com/BizTalk/2003/userCSharp">  <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />  <xsl:template match="/">    <xsl:apply-templates select="/ns0:Root" />  </xsl:template>  <xsl:template match="/ns0:Root">    <xsl:variable name="var:v1" select="userCSharp:StringConcat(string(s0:Travel/DateTimeStart/text()) , &quot;  &quot; , string(s0:Travel/Field/text()))" />    <ns0:Root>      <xsl:value-of select="$var:v1" />    </ns0:Root>  </xsl:template>  <msxsl:script language="C#" implements-prefix="userCSharp"><![CDATA[public string StringConcat(string param0, string param1, string param2){   return param0 + param1 + param2;}]]></msxsl:script></xsl:stylesheet>
    Third, if you are really interested passing your whole using xslt, then probably this artical will be helpful to you
    http://connectedpawns.wordpress.com/2009/08/01/how-to-copy-the-entire-node-to-element-of-string-type-in-a-map/
    Please mark it as Answer if this answers your question
    Thanks.
    Mo
    The contents I write here is my personal views, not the view of my employer and anyone else.
    Thank you, yes you're right about the namespaces, but this is only a proof of concept ant I have to adjust it.
    What is the functoid you put in the map? And can I pass its output to an external assembly as parameter? (I need to do it and return the output to a certain schema node).
    Thank you

  • Problem passing a table parameter in rfc call using the function control

    I try to pass a Table as parameter to a Function Module using the SAP.Functions library (part of SAP frontend controls) from a Visual Basic (VBA) program.
    The function module has been verified to work when invoked from SAP FrontEnd Function Builder.
    The SAP RFC Control is created with
    Set sapFunctions=CreateObject("SAP.Functions")
    Following code snippet shows how I attempt to set exports and add a table row before calling the function module:
    sapFunctions.Connection = sapConnection
    Set sapMaterialUpd = sapFunctions.Add("Z_SD_BAPI_SALES_DATA_UPD")
    With sapMaterialUpd
    <i>'set exports</i>
         .Exports("PA_GLPUPDLEVEL") = "S"
         .Exports("PA_VKORG") = "FI14"
    <i>'append table row</i>
         .Tables("IT_SALES_DATA_UPD").AppendRow
         .Tables("IT_SALES_DATA_UPD")(1, "VKORG") = "FI14"
         .Tables("IT_SALES_DATA_UPD")(1, "MATNR") = "W_3100"
         .Tables("IT_SALES_DATA_UPD")(1, "DATBI") = "99991231"
         .Tables("IT_SALES_DATA_UPD")(1, "DATAB") = "20041231"
         .Tables("IT_SALES_DATA_UPD")(1, "KBETR") = "2222"
         .Tables("IT_SALES_DATA_UPD")(1, "KONWA") = "EUR"
    End With
    <i>'call the function module</i>
    If sapMaterialUpd.Call() = True Then
        <i>'do something with the return tables here...</i>Else
        Debug.Print sapMaterialUpd.Exception
    End If
    The Call() returns <b>FALSE</b> and the exception is <b>"SYSTEM_FAILURE"</b>. The connection also resets.
    The local logfile that the control generates shows that an exception occurs at the point of the call:
    <i>10.02.2005  17:54:20.766 Packing Parameters for Z_SD_BAPI_SALES_DATA_UPD
    Packing Parameter PA_GLPUPDLEVEL.
    Packing Parameter PA_VKORG.
    Packing Table 0.
    Packing Table 1.
      10.02.2005  17:54:20.766 *** Calling  RFC Function 'Z_SD_BAPI_SALES_DATA_UPD'
      10.02.2005  17:54:20.986 RFC CALL status = RFC_SYS_EXCEPTION
      10.02.2005  17:54:20.986 RFC Error: RFC_IO27
      -Status:CODE=CM_DEALLOCATED_NORMAL STATUS=CM_NO_STATUS_RECEIVED DATA=CM_COMPLETE_DATA_RECEIVED ID=69415076
      -Message:connection closed
      -Internal Status:IO HANDLE=23 DRV=EXT LINE=1420 CODE=27 : GET ID=ffff LINE=861 CODE=7
      10.02.2005  17:54:20.986 Function call finished.</i>
    Seen next code snippet. If the Table object is not touched, the function call goes through without any problems:
    sapFunctions.Connection = sapConnection
    Set sapMaterialUpd = sapFunctions.Add("Z_SD_BAPI_SALES_DATA_UPD")
    With sapMaterialUpd
    'set exports
        .Exports("PA_GLPUPDLEVEL") = "S"
        .Exports("PA_VKORG") = "FI14"
        'do <b>not</b> append a table row, for testing only ;-)</b>
    End With
    <i>'call the function module</i>
    If sapMaterialUpd.Call() = True Then
    <i>    'do something with the return tables here...</i>
    Else
        Debug.Print sapMaterialUpd.Exception
    End If
    This code works perfectly when calling the function. It returns TRUE and behaves normally. The function module returns descriptive response text in a table telling that the table was empty, according to the BAPI implementation.
    So is there something special needed here <i>after</i> appending the table row and <i>before</i> making the Call to properly attach the table as a parameter for the function module?
    Can this be a bug in the SAP RFC Control? The version of the wdtfuncs.ocx is 6206.6.45.54.
    Any hints are welcome!

    hi All partner,
    who solved this problem , I meet it too and
    can't clear it.
    SAPfunc := sapfunctions1.Add('z_get_sfcs_dn_mo');    
    SAPitab := sapfunc.tables.item ('I_DNMO');
    SAPitab.appendrow;                                       SAPitab.value(1,'MANDT') := '220'; 
    SAPitab.Value(1,'VBELN') := '2150000001';
    SAPitab.Value(1,'POSNR') := '50';
    SAPitab.value(1,'MATNR') := '19-99999-00'; 
    SAPitab.value(1,'AUFNR') := '921241512001';
    SAPitab.value(1,'DEDAT') := '2005/09/09';
    SAPitab.value(1,'LFIMG') := '100';  
    IF  SAPfunc.call = true then
      begin
      end
    else
        begin
        showmessage('call fail!!') ;
        end;
    end;
    RFC source code as below
    FUNCTION z_get_sfcs_dn_mo.
    ""Local interface:
    *"  TABLES
    *"      I_DNMO STRUCTURE  ZDN_MO
      data: wa type zdn_mo.
      LOOP AT i_dnmo.
        wa-mandt = i_dnmo-mandt.
        wa-vbeln = i_dnmo-vbeln.
        wa-posnr = i_dnmo-posnr.
        wa-matnr = i_dnmo-matnr.
        wa-aufnr = i_dnmo-aufnr.
        wa-dedat = i_dnmo-dedat.
        wa-lfimg = i_dnmo-lfimg.
       modify  zdn_mo from wa.
        insert into zdn_mo values wa.  --dump at here
        commit work.
      ENDLOOP.
    T/C: ST22 error message say at
      insert into zdn_mo values wa. ---dump at here
    the sapfunc.call returns fail.
    Message was edited by: jorry wang

  • XML : Parameter passing

    Hi All,
    I would wish to pass a number as a parameter to the XML query.
    For example:
    <Id>4</Id> where 4 is the parameter.
    Now I know this works but I need a solution such that I could pass different values in a loop as parameter to the XML query.
    The query works fine when I pass a single parameter but if I try to pass a number of parameters in a loop or using with clause, the query retrieves unwanted result set.
    Could you please help me with the same.
    Example:
    with T as
    select 1 id from dual union all
    select 2 id from dual
    SELECT
    EXTRACTVALUE(VALUE(SR), '/Activity/empid','xmlns="urn:/crmondemand/xml/activity"') AS ACCOUNTNAME,
    EXTRACTVALUE(VALUE(SR), '/Activity/empname','xmlns="urn:/crmondemand/xml/activity"') AS SUBJECT,
    FROM T,
    TABLE(XMLSEQUENCE(EXTRACT(
    WEB_SERVICE('<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:crmondemand/ws/activity/10/2004" xmlns:act="urn:/crmondemand/xml/activity">
    <soapenv:Header/>
    <soapenv:Body>
    <ns:ActivityNWS_Activity_QueryPage_Input>
    <PageSize>100</PageSize>
    <act:ListOfActivity>
         <act:Activity>
    <empid> T.id </empid>
    <empname />
    </act:Activity>
    </act:ListOfActivity>
    <ns:StartRowNum>0</ns:StartRowNum>
    </ns:ActivityNWS_Activity_QueryPage_Input>
    </soapenv:Body>
    </soapenv:Envelope>'
    ,'document/urn:crmondemand/ws/activity/10/2004:Activity_QueryPage',:GLOBAL_SID),
    '/soap:Envelope/soap:Body/*/*/*','xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/'))) SR
    I want to pass the values in the with clause (T.id) as parameter to the query. Also this T.id is a number.
    Could you please help with this.
    Regards,
    Jitesh
    Edited by: Jitesh Gurnani on Nov 15, 2012 10:31 PM

    any example what do you have and what do you want
    as example
    SQL> with t as
      2  (
      3  select 1 id from dual union all
      4  select 2 id from dual
      5  )
      6  select xmlelement("Id", id) from t
      7  /
    XMLELEMENT("ID",ID)
    <Id>1</Id>
    <Id>2</Id>
    SQL>
    SQL>
    SQL> with t as
      2  (
      3  select 1 id from dual union all
      4  select 2 id from dual
      5  )
      6  select xmlelement("root", xmlagg(xmlelement("Id", id))) from t
      7  /
    XMLELEMENT("ROOT",XMLAGG(XMLEL
    <root><Id>1</Id><Id>2</Id></root>
    SQL>

  • Problem when using WEB.SHOW_DOCUMENT and passing in lexical parameter

    Hi,
    I got a blank page with error "An error has occured while trying to use this document" when I tried to use web.show_document and passing a lexical parameter to 10g report on 10gAS. The URL in the web.show_document is:
    http://<srvname>:<portnum>/reports/rwservlet?server=repserver90&report=myrpt.rdf&destype=Cache&desformat=pdf&userid=<usr>/<pw>@<db>&where_clause=where%20product_type%20in%20('REPORT')
    If I change the desformat to htmlcss, it is fine to display the report. But doesn't work with desformat=pdf. The pdf file has been generated in the cache. Why can't it display on the screen.
    Also I tried to use double quote the value for where_clause. The pdf report showed up. But it ignored the where clause.
    Experts please help.
    Ying

    I use lexical parameters and they work fine, but I use a parameter list. The code is contained in a form that is called by all forms that wish to run a report. This way you only need the logic for printing in a single form. If you want the form, email me at [email protected]

  • Problems passing xml to svg

    Hi, i tried to pass a xml to svg but the program is blocking, but when i go to work admin in windows, i show the process that i lunch, and it's waiting for the processor.
    When i stop the application, the xml process runs, like jave stop it. I prove with an inputstream and a bufferedreader ...but nothing, Here is my code, (the process that pass svg to png is similiar and it works!!!)
      String aux1="c:\\hlocal\\GOPIRO\\XML\\ProgTransformacionAsvg\\xml tr      c:\\hlocal\\GOPIRO\\XML\\osmarender.xsl c:\\hlocal\\GOPIRO\\XML\\osm-map-features-z17.xml > c:\\hlocal\\GOPIRO\\Imagen\\map.svg";
      Process p1 = Runtime.getRuntime().exec(aux1);
                p1.waitFor();
                InputStream is1=p1.getInputStream();
                BufferedReader br = new BufferedReader (new InputStreamReader (is1));
                String aux_1 = br.readLine();
                while (aux_1!=null)
                    System.out.println (aux_1);
                    aux_1 = br.readLine();
                }Thank you everybody

    I also tried that way without any luck :(
    It would be great to find solution.

  • Passing an XML file from WebDynpro app to ABAP function module

    Hi all,
    I'm stuck with a problem, and am hoping one of you could let me know how to proceed:
    I need to pass an XML file (or at least the entire content of the XML) from my WebDynpro application to a backend ABAP function module. What I tried was this:
    In my WebDynpro app, I read the XML and convert the content into one long string (using java.io.FileReader and java.io.BufferedReader). In my ABAP function module I created an import parameter of type String. I then imported the ABAP Function module into my WebDynpro app as a model. I then tried to pass the XML string to the ABAP module. What happens is this:
    If the size of the string (XML) happens to be less than 255 characters, then it works. That is, the string is passed to the ABAP function module and I can see the contents. However, if the XML string happens to be greater than 255 characters, then it does not work. The string at the ABAP side is empty. Surprisingly, the ABAP module does not throw an error either. It just displays an empty string.
    Could you please tell me what the problem is?
    Thanks & Regards,
    Biju

    Hi Biju ,
    Welcome to SDN.
    If the import parameter is defined as type string it should work, however did you check whether your application pass it properly?
    I have applications using strings as import parameters working fine. (webapplications (BSP) to RFC)
    Regards
    Raja

  • Problem passing param to a java function from xslt

    HI all,
    A thousand thankyou's to any who can help me.
    Documentation is scarce, and I got to bed late last night. It has been a hard day of fruitless searching for a solution to this.
    Problem:
    Calling a named template in xsl using the with-param tag to pass in a parameter.
    attempting to call a java function, specifying that parameter as an argument.
    getting parse error:
    ERROR: 'Cannot convert argument/return type in call to method 'java.lang.String.new(java.util.Date)''
    sample code:
    calling the named template
              <xsl:call-template name="calc-age">
                   <xsl:with-param name="dob">
                        <xsl:value-of select="/FullRecord/Patient/dob"/>
                   </xsl:with-param>
              </xsl:call-template>the template itself
         <xsl:template name="calc-age">
              <xsl:param name="dob"/>          
             <xsl:variable name="date" select="java:util.Date.new()"/>
             <xsl:value-of select="java:toString($date)"/>
              <xsl:variable name="sdob" select="java:lang.String.new($date)"/>
         </xsl:template>          the error
    ERROR:  'Cannot convert argument/return type in call to method 'java.lang.String.new(java.util.Date)''
    FATAL ERROR:  'Could not compile stylesheet'
    javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:824)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:613)does anyone know what is wrong here?
    And if they do, where I can find examples or a reference on how this is supposed to work?
    It's driving me mad!
    Thanks all!
    svaens
    Edited by: svaens on Apr 14, 2008 9:16 AM

    ok.
    What I had pasted was wrong, But I was it was only confused because I had tried quite a few different things to get it working, and had made a mistake somewhere along the way.
    HOWEVER!!!
    This code, I believe should work, (below) but doesn't.
    the error is different, but similar.
    The call to the template remains the same, but the template itself is now different.
    What is wrong with it?
    Do i need to convert a xml document string to a java string somehow?
    template:     <xsl:template name="calc-age">
              <xsl:param name="dob"/>          
             <xsl:variable name="sdob" select="java:lang.String.new($dob)"/>
             <xsl:value-of select="java:toString($sdob)"/>        
         </xsl:template>     the error:
    ERROR:  'Cannot convert argument/return type in call to method 'java.lang.String.new(reference)''
    FATAL ERROR:  'Could not compile stylesheet'To be more clear, I am translating XML via XSL which is transformed using Java 6, and the packages:
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;

  • How to pass a date parameter from report builder query designer to oracle database

    i'm using report builder 3.0 connected to oracle database. i'm trying to pass a date parameter in the query with no success, i don't
    know the exact syntax. I've tried :
    SELECT * FROM igeneral.GCL_CLAIMS where CREATED_BY IN (:CREATED_BY) AND CLAIM_YEAR IN(:UW_YEAR) AND (LOSS_DATE) >To_Date('01/01/2014','mm/dd/yyyy')
    it worked perfectly.
    However if i try to put a date parameter "From" instead of 01/01/2014 it will not work, a Define Query Parameter popup window appear and error occurred after i fill
    the values (usually i shouldnt get this popup i should enter the value when i run the report)
    SELECT * FROM igeneral.GCL_CLAIMS where CREATED_BY IN (:CREATED_BY) AND CLAIM_YEAR IN(:UW_YEAR) AND (LOSS_DATE) >To_Date(:From,'mm/dd/yyyy')
    appreciate your assistance

    Hi Gorgo,
    According to your description, you have problem when in passing a parameter for running a Oracle Query. Right?
    Based on my knowledge, it use "&" as synax for parameter in Oracle, like we use "@" in SQL Server. In this scenario, maybe you can try '01/01/2014' when inputing in "From". We are not sure if there's any limitation for To_Date()
    function. For your self-testing, you can try the query in sqlplus/sql delveloper. Since your issue is related to Oracle query, we suggest you post this thread onto Oracle forum.
    Best Regards,
    Simon Hou

  • Got problem in loading xml

    Hi All,
    Because of your help I am doing small application and I am new in xml I gets small small problem and by the your help i cam solve it.
    Now i have last problem when i solve it then my tool gets complete. I have attached small code of it and its working. The problem is when i fill one methods parameter information its comes in all methods. Which is wrong.
    I want output like:
    <?xml version="1.0" encoding="UTF-8"?>
    <interface>
        <name>the name of package</name>
        <className>The name of class</className>
        <methods>
               <name>the name of the method</name>
              <invokeKind/>
              <returnType>the return type of the method</returnType>
              <optionalParameters/>   
              <parameters>
                       <name>Param1</name>
                       <type>Void</type>
               </parameters>
         </methods>
         <methods>
                <name>the name of the method22</name>
               <returnType>the return type of the method22</returnType>
               <parameters/>
          </methods>
    </interface>But output comes like
    <?xml version="1.0" encoding="UTF-8"?><interface>
    <name>the name of package</name>
    <className>The name of class</className>
    <methods>
    <name>the name of the method</name>
    <invokeKind/>
    <returnType>the return type of the method</returnType>
    <optionalParameters/>
    <parameters>
    <name>Param1</name>
    <type>Void</type>
    </parameters>
    </methods>
    <methods>
    <name>the name of the method22</name>
    <returnType>the return type of the method22</returnType>
    <parameters>
    <name>Param1</name>
    <type>Void</type>
    </parameters>
    </methods>
    </interface>
    I have not given parameter in second method but given in first method but replicates in second thats y i am stucked,
    Please help me.
    Code is ::
    import java.io.File;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.DocumentFragment;
    import org.w3c.dom.Node;
    public class TryXML
         public static void main(String args[])
              try
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                DocumentBuilder parser = factory.newDocumentBuilder();
                Document methoddoc = parser.parse(new File("methodinfo.xml"));
                Document packageDoc = parser.parse(new File("interface.xml"));          
                //***Package information           
                Node packagenameNode = packageDoc.getElementsByTagName("name").item(0);
                Node packageclassNode = packageDoc.getElementsByTagName("className").item(0);
                packagenameNode.setTextContent("the name of package");
                packageclassNode.setTextContent("The name of class");
                //***First method information
                Node nameNode = methoddoc.getElementsByTagName("name").item(0);
                Node returnTypeNode = methoddoc.getElementsByTagName("returnType").item(0);
                nameNode.setTextContent("the name of the method");
                returnTypeNode.setTextContent("the return type of the method");
                //**Parameter Informtion of this method.
                Document parameterDoc = parser.parse(new File("parameter.xml"));
                Node paramnameNode = parameterDoc.getElementsByTagName("name").item(0);
                Node paramreturnTypeNode = parameterDoc.getElementsByTagName("type").item(0);
                paramnameNode.setTextContent("Param1");
                paramreturnTypeNode.setTextContent("Void");
              //***adding parameter information into method.
                Node methodaddnode = methoddoc.importNode(parameterDoc.getDocumentElement(), true);
                DocumentFragment docfrag = methoddoc.createDocumentFragment();
               //***Move the nodes into the fragment
               while (methodaddnode.hasChildNodes())
                    docfrag.appendChild(methodaddnode.removeChild(methodaddnode.getFirstChild()));
               Node paramNode = methoddoc.createElement("parameters");
               methoddoc.getDocumentElement().appendChild(paramNode);
               paramNode.appendChild(docfrag);
               //***adding first methode's information into package.
               Node node = packageDoc.importNode(methoddoc.getDocumentElement(), true);
               docfrag = packageDoc.createDocumentFragment();
              while (node.hasChildNodes())
                  docfrag.appendChild(node.removeChild(node.getFirstChild()));
              Node methodnode = packageDoc.createElement("methods");
              packageDoc.getDocumentElement().appendChild(methodnode);
              methodnode.appendChild(docfrag);
              //***adding second methode's information into package.
              nameNode.setTextContent("the name of the method22");
                returnTypeNode.setTextContent("the return type of the method22");
                node = packageDoc.importNode(methoddoc.getDocumentElement(), true);
                docfrag = packageDoc.createDocumentFragment();
              while (node.hasChildNodes())
                  docfrag.appendChild(node.removeChild(node.getFirstChild()));
              Node methodnode2 = packageDoc.createElement("methods");
              packageDoc.getDocumentElement().appendChild(methodnode2);
              methodnode2.appendChild(docfrag);
              //**Display
                DOMSource source = new DOMSource(packageDoc);
                StreamResult result = new StreamResult(System.out);
                TransformerFactory transformerFactory = TransformerFactory.newInstance();
                Transformer transformer = transformerFactory.newTransformer();
                System.out.println("This is the content of the XML document:\n");
                transformer.transform(source, result);
              catch (Exception e)
    }regards
    -bunty

    my problem was, if i dont have parameters for second method then also parameters of first methods comes into 2nd method. I think its headache for me.
    Parmeter.xml:
    <parameter>
        <name></name>
        <type></type>
    </parameter>Method.xml
    <method>
        <name></name>
        <returnType></returnType>
         <parameters>
        </parameters>
    </method>So my quetion is, I have put whole parameter.xml into method.xml's parameter node. In previous post u said refresh it. How can i refresh it ? not get this point .
    Code is :
    import java.io.File;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    public class TryXML
         public static void main(String args[])
              try
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                DocumentBuilder parser = factory.newDocumentBuilder();
                Document methoddoc = parser.parse(new File("method.xml"));
                Document packageDoc = parser.parse(new File("interface.xml"));
                Document parmerterDoc=parser.parse(new File("parameter.xml"));
                //***Package information           
                Node packagenameNode = packageDoc.getElementsByTagName("name").item(0);
                Node packageclassNode = packageDoc.getElementsByTagName("className").item(0);
                packagenameNode.setTextContent("package1");
                packageclassNode.setTextContent("class1");
                //***First method information
                Node nameNode = methoddoc.getElementsByTagName("name").item(0);
                Node returnTypeNode = methoddoc.getElementsByTagName("returnType").item(0);
                nameNode.setTextContent("method1");
                returnTypeNode.setTextContent("int");
                //**Parameter Informtion of this method.
                Node paramnameNode = parmerterDoc.getElementsByTagName("name").item(0);
                Node paramreturnTypeNode = parmerterDoc.getElementsByTagName("type").item(0);
                paramnameNode.setTextContent("Param1");
                paramreturnTypeNode.setTextContent("Void");
                NodeList list = parmerterDoc.getElementsByTagName("parameter");
                Element element = (Element)list.item(0);
                NodeList list1 = methoddoc.getElementsByTagName("parameters");
                Element element1 = (Element)list1.item(0);
                // Make a copy of the element subtree suitable for inserting into doc2
                Node dup = methoddoc.importNode(element, true);
                // Insert the copy into doc2
                element1.appendChild(dup);
                NodeList methodlist = methoddoc.getElementsByTagName("method");
                Element methodelement = (Element)methodlist.item(0);
                NodeList methodlist1 = packageDoc.getElementsByTagName("methods");
                Element methodelement1 = (Element)methodlist1.item(0);
                // Make a copy of the element subtree suitable for inserting into doc2
                Node methoddup = packageDoc.importNode(methodelement, true);
                // Insert the copy into doc2
                methodelement1.appendChild(methoddup);
    //          ***Second method information
                nameNode = methoddoc.getElementsByTagName("name").item(0);
                returnTypeNode = methoddoc.getElementsByTagName("returnType").item(0);
                nameNode.setTextContent("method2");
                returnTypeNode.setTextContent("short");
                //**Parameter Informtion of this method.
                 methodlist = methoddoc.getElementsByTagName("method");
                 methodelement = (Element)methodlist.item(0);
                 methodlist1 = packageDoc.getElementsByTagName("methods");
                 methodelement1 = (Element)methodlist1.item(0);
                // Make a copy of the element subtree suitable for inserting into doc2
                 methoddup = packageDoc.importNode(methodelement, true);
                // Insert the copy into doc2
                methodelement1.appendChild(methoddup);
              //**Display
                DOMSource source = new DOMSource(packageDoc);
                StreamResult result = new StreamResult(System.out);
                TransformerFactory transformerFactory = TransformerFactory.newInstance();
                Transformer transformer = transformerFactory.newTransformer();
                System.out.println("This is the content of the XML document:\n");
                transformer.transform(source, result);
              catch (Exception e)
                   e.printStackTrace();
    }Message was edited by:
    bunty_barge

  • RFC Receiver Adapter Problem- Sending Blank XML Node

    Hi,
    I'm using the RFC receiver adapter to call a RFC in R/3 from XI 3.0
    In the payload XML one node is blank as I want to pass a blank parameter to the RFC. But in R/3 the blank node is getting converted to #
    Can anyone suggest how can I pass a blank node while calling the RFC using RFC receiver adapter in XI 3.0?
    Thanks in advance,
    Dipankar

    Hey
    Please check the outbound payload in sxmb_moni and RWB,if the field is blank there,then it means that PI is passing correct value to ECC.its possible that RFC has been coded in such a way that it converts blank spaces to #.Please look at RFC documentation in that case and see if it helps more.
    If the outbound payload itself in PI is showing as # instead of blank,then check the message mapping in PI.
    Thanx
    Aamir

  • OpenDocument.aspx - pass multi value parameter when report type is actx

    We are running Crystal Reports XI R2 against a business objects infoview server.
    We have been successfully using the OpenDocuments method for opening crystal reports but have run into a snag.  When using a multi-value parameter, we can only get it to work when the viewer is set to HTML.  Setting to ActiveX prompts us to enter in the parameter values manually.
    This address works (using sViewer=HTML):
    http://vsx2af0x/businessobjects/enterprise115/infoview/scripts/opendocument.aspx?sType=rpt&sViewer=html&lsMpSiteIDs=[1235880],[1235891],[1235902],[1235913]&sPath=[Development][CGIS][Intranet Mapping][COS_Base]&sDocName=DetailedSite&sRefresh=Y
    This address does not work (using sVIewer=actx):
    http://vsx2af0x/businessobjects/enterprise115/infoview/scripts/opendocument.aspx?sType=rpt&sViewer=actx&lsMpSiteIDs=[1235880],[1235891],[1235902],[1235913]&sPath=[Development][CGIS][Intranet Mapping][COS_Base]&sDocName=DetailedSite&sRefresh=Y
    Any thoughts on the problem?

    As I understand what you need is to use LookupSet function. 
    Suppose if your dataset is like this (for simplicity I'm showing only required fields)
    PersonID Project Company
    ID1 P1 C1
    ID1 P2 C1
    ID1 P3 C2
    ID1 P4 C2
    ID1 P5 C3
    If you want to get the full project list for the person just send the PersonID alone and filter using it in the subreport. You can keep the project/company parameters optional in that case and put a default value. This would be the easiest thing.
    Now if you want pass the project parameter also you need to pass it like this
    =Join(LookupSet(Fields!Person.Value,Fields!Person.Value,Fields!Project.Value,"DatasetName"),",")
     This would act like a self lookup and return you full list of projects for the person and then you can use this to set the parameter value in the subreport.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to pass a xml CDATA in string element when OSB calling a webservice?

    How to pass a xml CDATA in string element when OSB calling a webservice?
    I have a business service (biz) that route to operation of a webservice.
    A example of request to this webservice legacy:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:eg="example">
    <soapenv:Header/>
    <soapenv:Body>
    <ex:execute>
    <ex:arg><![CDATA[<searchCustomerByDocumentNumber>
    <documentNumber>12345678909</documentNumber>
    </searchCustomerByDocumentNumber>]]></ex:arg>
    </ex:execute>
    </soapenv:Body>
    </soapenv:Envelope>
    the type of ex:arg is a string.
    How to pass this CDATA structure to webservice in OSB?

    Steps to solve this problem:
    1. Create a XML Schema. E.g.:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         elementFormDefault="unqualified">
         <xs:complexType name="searchCustomerByDocumentNumber">
              <xs:sequence>
                   <xs:element name="documentNumber" minOccurs="0">
                        <xs:annotation>
                             <xs:documentation>
                             </xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                             <xs:restriction base="xs:string" />
                        </xs:simpleType>
                   </xs:element>
         </xs:sequence>
         </xs:complexType>
         <xs:element name="searchCustomerByDocumentNumber" type="searchCustomerByDocumentNumber"></xs:element>
    </xs:schema>
    With this XSD, the XML can be generate:
    <?xml version="1.0" encoding="UTF-8"?>
    <searchCustomerByDocumentNumber xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="searchCustomerByDocumentNumber.xsd">
    <documentNumber>documentNumber</documentNumber>
    </searchCustomerByDocumentNumber>
    2. Create a XQuery to create a searchCustomerByDocumentNumber ComplexType. E.g.:
    (:: pragma bea:global-element-return element="searchCustomerByDocumentNumber" location="searchCustomerByDocumentNumber.xsd" ::)
    declare namespace xf = "http://tempuri.org/NovoSia/CreateSearchCustomerByDocumentNumber/";
    declare function xf:CreateSearchCustomerByDocumentNumber($documentNumber as xs:string)
    as element(searchCustomerByDocumentNumber) {
    <searchCustomerByDocumentNumber>
    <documentNumber>{ $documentNumber }</documentNumber>
    </searchCustomerByDocumentNumber>
    declare variable $documentNumber as xs:string external;
    xf:CreateSearchCustomerByDocumentNumber($documentNumber)
    3. In your stage in pipeline proxy add a assign calling the XQuery created passing the document number of your payload.
    Assign to a variable (e.g.: called searchCustomerByDocumentNumberRequest)
    4. Create another XQuery Transformation (XQ) to create a request to the webservice legacy. E.g.:
    <ex:arg>{fn-bea:serialize($searchCustomerByDocumentNumberRequest)}</ex:arg>
    For more information about xquery serialize function:
    41.2.6 fn-bea:serialize()
    You can use the fn-bea:serialize() function if you need to represent an XML document as a string instead of as an XML element. For example, you may want to exchange an XML document through an EJB interface and the EJB method takes String as argument. The function has the following signature:
    fn-bea:serialize($input as item()) as xs:string
    Source: http://docs.oracle.com/cd/E14571_01/doc.1111/e15867/xquery.htm

  • How can I pass a BLOB parameter 32K from VB to a stored procedure?

    I am using Visual Basic 6 and the Oracle database 10g to call stored procedures. I am passing a XML input parameter to this stored proc. This variable has been defined as BLOB in stored proc and as XMLType in the table to which it finally gets stored through procedure.
    But there seems to be a limit to the size of a parameter you can pass in. This seems to be 32K!!! It works fine as long as my input is < 32k but once it becomes > 32k, Oracle gives the following error:-
    "ORA-01460: unimplemented or unreasonable conversion requested"
    I searched on net and found lots of examples for a workaround with .Net (using OracleLob). For Vb6, the only examples I found were using AppendChunk method etc through a loop, where each call will insert 32k chunk. But, that would mean lots of calls to stored proc, as we need to do this for thousands of files and each file of size > 100k.. So, this method would not be acceptable.
    Can someone please help me with this.

    Mofizur,
    You can achieve the same using Session variable.
    If u are not executing the VO after PR. Then you will be able to get the same value as u are using in PR
    String transactionId = (String) vo_trans.first().getAttribute("Getnexttrans");
    Note - You have a few of the threads left open, mark it as answered if solved.
    Regards,
    Gyan

  • Create a Panel skin (Spark) with a background fill color I can pass as a parameter

    Hi,
    I'm trying to create a Panel skin (Spark) with a background fill color I can pass as a parameter.
    (See in bold:)
    <?xml version="1.0" encoding="utf-8"?>
    <s:SparkSkin name="CustomPanelSkin"
                                   xmlns:fx="http://ns.adobe.com/mxml/2009"
                                   xmlns:s="library://ns.adobe.com/flex/spark"
                                   xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
                                   blendMode="normal">
              <s:states>
                        <s:State name="normal" />
                        <s:State name="disabled" />
                        <s:State name="normalWithControlBar" stateGroups="withControls" />
                        <s:State name="disabledWithControlBar" stateGroups="withControls" />
              </s:states>
              <fx:Metadata>
                        [HostComponent("spark.components.Panel")]
              </fx:Metadata>
              <s:Group left="0" right="0" top="0" bottom="0">
                        <s:Rect
                                  left="0" right="0"
                                  top="0" bottom="0"
                                  radiusX="12" radiusY="12">
                                  <s:fill>
                                            <s:SolidColor color="#184c81" />
                                  </s:fill>
                        </s:Rect>
                        <s:Group id="contents"
                                             left="1" right="1" top="1" bottom="1">
                                  <s:layout>
                                            <s:VerticalLayout gap="0" horizontalAlign="justify" />
                                  </s:layout>
                                  <s:Group id="contentGroup"
                                                       width="100%" height="100%" minWidth="0" minHeight="0">
                                  </s:Group>
                        </s:Group>
              </s:Group>
    </s:SparkSkin>
    From what I read I should create a subclass, but there is not much material on the subject.
    I would later on want to use this skin in many Panel controls I have in my application.
    Thanks for the help.

    Did you read this?
    http://www.adobe.com/devnet/flex/articles/flex4_sparkintro.html

Maybe you are looking for

  • Can no longer read the base station configuration

    I am seting up a Airport Extreme N. I was able to read the configuration file twice with no problem. Now AirPort Utility "sees" the base station and tells me the Name, IP, Version, and AirPort ID but when I select the continue button AirPort Unitlity

  • How to restore display on MacBook Pro to original settings after faulty external display connection

    Rookie question, 2009 MacBook Pro.  We bought a dvi-VGA adapter to connect to an external display. Got a picture on the external monitor but very poor resolution.  Meanwhile the display on the MacBook Pro re-set itself and we were not able to restore

  • Install Oracle 8.1.6 on new workstation fails

    When trying to install Oracle 8.1.6 on a new Compaq EVO Pentium 4 1.7 ghz workstation in a Windows 2000 enviroment nothing happens. Install works fine on Compaq EN pentium 3 1.2 ghz workstation. Has anyone ran into this and if so what was the resolut

  • How can I get a better deal for cheaper?

    I've been a customer with you for many years, and have to say I thought I was getting a great deal- Until speaking with other people on different providers I'm rather concerned about how much I'm paying for what I'm getting.  

  • Iphone 3GS syncing issues with Blueant Supertooth 3

    Anyone having troubles syncing contacts to the ST3? My old iphone 3G (running the OS beofore 3.0) worked great, but with the new Iphone 3GS I'm gettting a "phone not supported" error from the bluetooth unit. your thoughts...