Xml string as property value in pipeline record

Hi,
We want to pass a XML-style string as a property value in the pipeline. but from the reference application, the property did not display, how should we handle such case in the input piplefile? do we need to do any transfamtion or encoding?
<STORES>
<RECORD>
<PROP NAME="store_hours">
     <PVAL><mon><![CDATA[7:00am-11:00pm]]></mon>
     <tue><![CDATA[7:00am-11:00pm]]></tue>
     <wed><![CDATA[7:00am-11:00pm]]></wed>
     <thu><![CDATA[7:00am-11:00pm]]></thu>
     <fri><![CDATA[7:00am-11:00pm]]></fri>
     <sat><![CDATA[7:00am-11:00pm]]></sat>
     <sun><![CDATA[7:00am-11:00pm]]></sun>
<PVAL>
</PROP>
</RECORD>
</STORES>
Thanks,
Bruce Xie
Edited by: user11899328 on 19/04/2013 13:49

Well I believe this is not officially mentioned anywhere, but this is the limitations for the java embedding activity. You can assign value to a single variable or to the single part element of variable only. I suggest you go with a java web service. you can check more details on java embedding activity @ http://docs.oracle.com/cd/E21764_01/integration.1111/e10224/bp_java.htm
void setVariableData(String name, Object value)
void setVariableData(String name, String part, Object value)
void setVariableData(String name, String part, String query, Object value)

Similar Messages

  • Parsing an xml string into id-value pair format

    Hi,
    I am new in oracle BPEL.
    My requirement is that I need to parse an xml string containing tag name and coressponding value into an 'id -value' pair.
    For example-
    The input xml format is -
    <employee>
    <empid>12345</empid>
    <name>xyz</name>
    <city>London</city>
    </employee>
    The required xml format is-
    <employee>
    <item id="empid" value="12345"/>
    <item id="name" value="xyz"/>
    <item id="city" value="London"/>
    </employee>
    Please let me know if there is a work-around for this.
    Thanks

    Something like this (have not tested):
    <xsl:for-each select="//employee">
    <employee>
    <xsl:for-each select="./*">
    <item>
    <xsl:attribute name="id">
    <xsl:value-of select="name()"/>
    </xsl:attribute>
    <xsl:attribute name="value">
    <xsl:value-of select="text()"/>
    </xsl:attribute>
    </item>
    </xsl:for-each>
    </employee>
    </xsl:for-each>

  • Update xml string values.

    Hi,
    I'm on 11.2.0.2 and got table with nclob column which stores long xml string .
    {code}
    "<?xml version="1.0" encoding="UTF-8"?>
    <?fuego version="6.5.2" build="101272"?>
    <set>
    <configuration name="TEST Database" type="SQL" subtype="DDORACLE">
      <property name="jdbc.pool.idle_timeout" value="5"/>
      <property name="jdbc.pool.entry.max" value="10"/>
      <property name="oracle.dateEqualsTimestamp" value="false"/>
      <property name="jdbc.schema" value="user1"/>
      <property name="jdbc.host" value="hostname"/>
      <property name="user" value="user1"/>
      <property name="jdbc.port" value="1521"/>
      <property name="jdbc.pool.min" value="0"/>
      <property name="jdbc.pool.maxopencursors" value="50"/>
      <property name="oracle.sid" value="dbsid"/>
      <property name="password" value="user101"/>
      <property name="jdbc.xa" value="false"/>
      <property name="jdbc.pool.max" value="10"/>
    </configuration>
    <configuration name="TEST Database2" type="SQL" subtype="DDORACLE">
      <property name="jdbc.pool.idle_timeout" value="5"/>
      <property name="jdbc.pool.entry.max" value="10"/>
      <property name="oracle.dateEqualsTimestamp" value="false"/>
      <property name="jdbc.schema" value="user2"/>
      <property name="jdbc.host" value="hostname"/>
      <property name="user" value="user2"/>
      <property name="jdbc.port" value="1521"/>
      <property name="jdbc.pool.min" value="0"/>
      <property name="jdbc.pool.maxopencursors" value="50"/>
      <property name="oracle.sid" value="dbsid2"/>
      <property name="password" value="user201"/>
      <property name="jdbc.xa" value="false"/>
      <property name="jdbc.pool.max" value="10"/>
    </configuration>
    </set>
    {code}
    My goal is to update password value in such way that it equals to value from jdbc.schema value  <property name="jdbc.schema" value="user2"/>   so in this case user2 || '01'
    <property name="password" value="user201"/>   <-- that is my goal .
    Regards
    Greg

    Hi,
    You can find a few methods here : How To : Update XML nodes with values from the same document | Odie's Oracle Blog
    They're not all applicable to your version and settings though.
    Here's the first one applied to your case :
    declare
      v_xmldoc   xmltype;
    begin
      select xmlparse(document to_clob(t.xmldoc))
      into v_xmldoc
      from my_nclob_table t
      where t.id = 1;
      for r in (
        select idx, schema_name
        from my_nclob_table t
           , xmltable(
               '/set/configuration'
               passing v_xmldoc
               columns idx         for ordinality
                     , schema_name varchar2(30) path 'property[@name="jdbc.schema"]/@value'
      loop
        select updatexml(
                 v_xmldoc
               , '/set/configuration['||to_char(r.idx)||']/property[@name="password"]/@value'
               , r.schema_name || '01'
        into v_xmldoc
        from dual ;
      end loop;
      update my_nclob_table t
      set t.xmldoc = to_nclob(xmlserialize(document v_xmldoc indent))
      where t.id = 1;
    end;
    Here's another one, using DOM :
    declare
      doc   clob;
      p        dbms_xmlparser.Parser;
      domdoc   dbms_xmldom.DOMDocument;
      docnode  dbms_xmldom.DOMNode;
      conf_list      dbms_xmldom.DOMNodeList;
      conf_node      dbms_xmldom.DOMNode;
      password_node  dbms_xmldom.DOMNode;
      schema_name     varchar2(30);
      password_value  varchar2(256);
    begin
      select to_clob(xmldoc)
      into doc
      from my_nclob_table
      where id = 1 ;
      p := dbms_xmlparser.newParser;
      dbms_xmlparser.parseClob(p, doc);
      domdoc := dbms_xmlparser.getDocument(p);
      dbms_xmlparser.freeParser(p);
      docnode := dbms_xmldom.makeNode(domdoc);
      conf_list := dbms_xslprocessor.selectNodes(docnode, '/set/configuration');
      for i in 0 .. dbms_xmldom.getLength(conf_list) - 1 loop
        conf_node := dbms_xmldom.item(conf_list, i);
        dbms_xslprocessor.valueOf(conf_node, 'property[@name="jdbc.schema"]/@value', schema_name);
        password_node := dbms_xslprocessor.selectSingleNode(conf_node, 'property[@name="password"]/@value');
        dbms_xmldom.setNodeValue(password_node, schema_name || '01');
      end loop;
      dbms_xmldom.writeToClob(domdoc, doc);
      dbms_xmldom.freeDocument(domdoc);
      update my_nclob_table t
      set t.xmldoc = to_nclob(doc)
      where t.id = 1;
    end;
    Message was edited by: odie_63 - added DOM example

  • "Property value is not valid" when PropertyGridView tries to convert a string to a custom object type.

    Hi,
    I have a problem with an PropertyGrid enum property that uses a type converter.
    In general it works, but when I double clicking or using the scoll wheel,  an error message appears:
    "Property value is not valid"
    Details: "Object of type 'System.String' cannot be converted to type 'myCompany.myProject.CC_myCustomProperty."
    I noticed that the CommitValue method (in PropertyGridView.cs) tries to convert a string value to a CC_myCustomProperty object.
    Here is the code that causes the error (see line 33):
    (Using the .net symbols from the PropertyGridView.cs file)
    1
            internal bool CommitValue(GridEntry ipeCur, object value) {   
    2
    3
                Debug.WriteLineIf(CompModSwitches.DebugGridView.TraceVerbose,  "PropertyGridView:CommitValue(" + (value==null ? "null" :value.ToString()) + ")");   
    4
    5
                int propCount = ipeCur.ChildCount;  
    6
                bool capture = Edit.HookMouseDown;  
    7
                object originalValue = null;   
    8
    9
                try {   
    10
                    originalValue = ipeCur.PropertyValue;   
    11
    12
                catch {   
    13
                    // if the getter is failing, we still want to let  
    14
                    // the set happen.  
    15
    16
    17
                try {  
    18
                    try {   
    19
                        SetFlag(FlagInPropertySet, true);   
    20
    21
                        //if this propentry is enumerable, then once a value is selected from the editor,   
    22
                        //we'll want to close the drop down (like true/false).  Otherwise, if we're  
    23
                        //working with Anchor for ex., then we should be able to select different values  
    24
                        //from the editor, without having it close every time.  
    25
                        if (ipeCur != null &&   
    26
                            ipeCur.Enumerable) {  
    27
                               CloseDropDown();   
    28
    29
    30
                        try {   
    31
                            Edit.DisableMouseHook = true;  
    32
    /*** This Step fails because the commit method is trying to convert a string to myCustom objet ***/ 
    33
                            ipeCur.PropertyValue = value;   
    34
    35
                        finally {   
    36
                            Edit.DisableMouseHook = false;  
    37
                            Edit.HookMouseDown = capture;   
    38
    39
    40
                    catch (Exception ex) {   
    41
                        SetCommitError(ERROR_THROWN);  
    42
                        ShowInvalidMessage(ipeCur.PropertyLabel, value, ex);  
    43
                        return false;  
    44
    I'm stuck.
    I was wondering is there a way to work around this? Maybe extend the string converter class to accept this?
    Thanks in advance,
    Eric

     
    Hi,
    Thank you for your post!  I would suggest posting your question in one of the MS Forums,
     MSDN Forums » Windows Forms » Windows Forms General
     located here:http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=8&SiteID=1.
    Have a great day!

  • Getting null value while parsing "XML String" with  encoding WINDOWS-1252.

    Hi,
    when I am converting the Follwoing "xml string " to Document, I am getting the "null" as a document value.
        String strXML =  "<?xml version="1.0" encoding="WINDOWS-1252"?>
                              <category name="SearchByAttributes" value="Search By Attributes">
                                <item name="ORDER_LINE_ID" description="Application Search Attributes" >
                                   <attribute name="Sequence" value="0001"/>
                                 </item>
                                </category>"      
    My "xml string" has the encoding vaule: WINDOWS-1252.
    I am using the following code to convert the "xml string" to Document. I am getting the Document values as a "null" while converting the above "string xml"
            String strXML = //my above string xml.
            DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
            docBuilderFactory.setIgnoringElementContentWhitespace(true);
            docBuilder = docBuilderFactory.newDocumentBuilder();
            doc = docBuilder.parse(new InputSource(new StringReader(strXML)));              
            System.out.println("doc value.."+doc)//I am getting null value for "doc".
    Can anyone help me to resolve the issue.

    Thagelapally wrote:
    I am coverting the below "XML string" to Document, once it is converted I am reading that Document,which have an "attribue" Element in.
      String strXML = "<?xml version="1.0" encoding="WINDOWS-1252"?>
    <category name="SearchByAttributes" value="Search By Attributes">
    <item name="ORDER_LINE_ID" description="Application Search Attributes" >
    <attribute name="Sequence" value="0001"/>
    </item>
    </category>" I am using the above code to read the Document. When run the code in "OC4J Server" and using Jdeveloper as an editor,I am able to perfectly read the "attribute" element in the document with out any problem.Println statement printing as I expected.
    System.out.println("Element Name..."+listOfAtt.getNodeName());
    //getting Element Name as...."attribute"(as expected)
    System.out.println("Element Attibrute list....."+elementAtt);
    //getting Element Attribute list as an...."oracle.xml.parser.v2.XMLAttrList@afe"But when run the same code(reading the same Document) in Tomcat and Eclipse,println satatement not printing as i expected.
    System.out.println("Element Name..."+listOfAtt.getNodeName());
    //getting Element Name as...."#text"(I am expecting output value "attribute" but it is printing "#text" which i don't know)
    System.out.println("Element Attibrute list....."+elementAtt);
    //getting Element Attribute list as an...."null"(I am expecting output value object reference but it is printing "null"
    (without the rest of the code, i'm guessing that) most likely you are grabbing the first child node of the item element. however, you are not accounting for some text nodes that are most likely in that list, like the whitespace between the item element and the attribute element. please go read some tutorials on xml, there are thousands of them out there, and they will answer all you initial questions much more efficiently than posting each step to the forums.

  • AppleScript- filtering a list of records by a property value possible?

    How can a list of records like the one below (except each list has 82 items) be filtered by a field's value so that the resulting list contains only records with a given property value?
    e.g.
    set recordList to (*input follows*) {{fnum:1, fname:"Admin", fval:"", isCustom:true},{fnum:8, fname:"Cataloged", fval:"4/18/12 4:04 PM", isCustom:false}}
    I tried:
    items of recordList where isCustom is true
    but instead of the desired result( below) I got "variable isCustom not defined."
    {{fnum:1, fname:"Admin", fval:"", isCustom:true}} --desired result
    Is there a better way to do this than loop through the list and build a new list by evaluating the labeled pair of each record in the list?
    Thanks in advance for any insights.

    Hello Thomas Camilleri,
    Short answer is no.
    Filter reference form is only applicable to application objects and processed by the application.
    Long answer is that you can define some handlers to make code concise though you cannot avoid iteration through the list. After all, even the filter reference form invokes iteration behind the scene, so the ultimate question here would be how well we can hide the iteration from the scene.
    E.g., something like the codes below. Inevitable iteration is hidden in general-purpose handlers map() or match() and you may only define the filter1() or pattern1() handlers for your specific purpose. SCRIPT 2 would be better fit for your object.
    Regards,
    H
    -- SCRIPT 1
    set rr to {{key1:10, key2:true}, {key1:14, key2:false}, {key1:16, key2:true}}
    set rr1 to map(filter1, rr)'s records
    return rr1 -- {{key1:16, key2:true}}
    on filter1(x)
        if x's key2 and x's key1 > 11 then return x
        return missing value
    end filter1
    on map(func, aa)
        script o
            property xx : aa's contents
            property yy : {}
            property f : func
            repeat with x in my xx
                set end of my yy to my f(x's contents)
            end repeat
            return my yy's contents
        end script
        tell o to run
    end map
    -- END OF SCRIPT 1
    -- SCRIPT 2
    set rr to {{key1:10, key2:true}, {key1:14, key2:false}, {key1:16, key2:true}}
    set rr2 to match(pattern1, rr)
    return rr2 -- {{key1:16, key2:true}}
    on pattern1(x)
        x's key2 and x's key1 > 11
    end pattern1
    on match(pat, aa)
        script o
            property xx : aa's contents
            property yy : {}
            property f : pat
            repeat with x in my xx
                set x to x's contents
                if f(x) then set end of my yy to x
            end repeat
            return my yy's contents
        end script
        tell o to run
    end match
    -- END OF SCRIPT 2

  • Memory leak in "get property value (string)" ?

    Hi,
    I'm not sure which forum to post this to because it involves a combination of labview and teststand.  The error I'm getting is more teststand related so it is here.
    In our application, we have a labview queued state machine launched by a teststand step using "launch vi asynchronously".  In one of the states of this state machine, we are looping grabbing frames from a camera, querying a teststand using "get property value (string)", to overylay on the video on each frame.  This is so when we post process the video, we can tell what step(s) teststand was performing (we are writing a status string to a property from teststand as well).  Since this string has to be overlayed on the video for each frame to be visible when played back, this happens many many thousands of times over the multi hour test runs of the platform.  
    My problem is, after 22 hours or so of running, I get an error generated from the "get property value (string)", saying cannot create any more threads.  The only thing wired to this tool in our vi is sequence context, which is passed in when the vi is launched from teststand.  When opening the "get property value (string)" vi itself, it is very simple, consisting of a "aspropertyvalue" casting, reading of the string from the proprety, closing the aspropertyvalue reference, and exiting.  It does not seem like there should be any "threads" being created here, except for perhaps the vi itself executing. But in that case I would assume the OS itself would clean up after itself. 
    BTW, the OS I am testing on is win7 x64.  I did see this though running on our xp box once as well though, same amount of time.  It is very repeatable.  My next plan is to disable this get property value using a disable case, and run again, but I"m still wondering why this error is occurring.  Any help or insight will be appreciated.
    Thanks
    David Jenkinson
    Hi,I'm not sure which forum to post this to because it involves a combination of labview and teststand.  The error I'm getting is more teststand related so it is here.
    In our application, we have a labview queued state machine launched by a teststand step using "launch vi asynchronously".  In one of the states of this state machine, we are looping grabbing frames from a camera, querying a teststand using "get property value (string)", to overylay on the video on each frame.  This is so when we post process the video, we can tell what step(s) teststand was performing (we are writing a status string to a property from teststand as well).  Since this string has to be overlayed on the video for each frame to be visible when played back, this happens many many thousands of times over the multi hour test runs of the platform.  My problem is, after 22 hours or so of running, I get an error generated from the "get property value (string)", saying cannot create any more threads.  The only thing wired to this tool in our vi is sequence context, which is passed in when the vi is launched from teststand.  When opening the "get property value (string)" vi itself, it is very simple, consisting of a "aspropertyvalue" casting, reading of the string from the proprety, closing the aspropertyvalue reference, and exiting.  It does not seem like there should be any "threads" being created here, except for perhaps the vi itself executing.  There seems to be something going on behind the scenes of this get property value tool that isn't cleaning up after itself?
    BTW, the OS I am testing on is win7 x64.  I did see this though running on our xp box once as well though, same amount of time.  It is very repeatable.  My next plan is to disable this get property value using a disable case, and run again, but I"m still wondering why this error is occurring.  Any help or insight will be appreciated.
    Thanks
    David Jenkinson

    Hi David,
    Have you tried just using property node | Method Nodes instead of using the VI. There should be no difference but I think that VI is polymorphic ie the input with change depending on what's wired to it eg string, double etc.
    Regards
    Ray Farmer

  • Is it possible to pass the property value dynamically to composite.xml

    Hi,
    Is it possible to pass the property value dynamically to composite.xml from bpel?
    For ex:
    <property name="bpel.config.auditLevel">$variable</property>
    I will get a different $variable value every time to bpel.
    Also, when I included the following code inside .bpel
    invoke name="InvokeListFileFTPAdapter-ListFiles"
    partnerLink="ListFilesFTPAdapter"
    portType="ns3:FileListing_ptt" operation="FileListing"
    inputVariable="listfilesRequest"
    outputVariable="listfilesResponse" bpelx:invokeAsDetail="no">
    <bpelx:toProperties>
    <bpelx:toProperty name="bpel.auditLevel"
    variable="AuditVariable"/>
    </bpelx:toProperties>
    </invoke>
    where auditvariable='Off'
    I don't see any change in em. The invoke activity is showing full payload, Can't we turn off the audit level from .bpel not from composite.xml

    Hi,
    You can use bpel preferences for that:
    1.
    In the composite add a property, for ex:
    <component name="test">
    <implementation.bpel src="test.bpel"/>
    <property name="bpel.preference.exam">abc</property>
    </component>
    2.
    To get the value within your bpel process use: ora:getPreference(exam)
    3.
    Then, you can change the value in the EM:
    Under Farm_soa_domain>weblogic domain>your_domain>soa_server1
    Right click on menu>system Mbean browser>oracle.soa.config>server:soa_server1>SCAComposite>your project>SCAComposite.SCAComponent>processName>
    Now, click on the properties attribute : you can see the exam property and change the value.
    Arik

  • Sorting records with property values

    Hi Friends,
    Can anybody please suggest a solution/approach for this requirement?
    Lets say,I have 100 records displayed in a non-search results page which are inter-related but they have 2 different inventory properties ex:online_inventory and store_inventory.We are sorting the products by online_inventory property and we are seeing the products displayed in the following order:
    online_instock items--->online_outofstock items--->store_instock items--->store_outofstock items.
    Now,our requirement is to show the products in following order:
    online_instock items--->store_instock items--->online_outofstock items--->store_outofstock items.
    The basic idea is to push the out of stock items at last irrespective of whether it is an online or store product?
    Please note that due to some limitations,we cannot maintain a single inventory property combining online and store inventories.
    Is it possible to apply a sort key here based on a property value or how can we achieve this requirement?
    Regards
    Shreyas

    Shreyas,
    You can do it another way :
    Create a Property say P_combain_sort and enabled for sort, add a manipulator for retrieving the value of online_instock and store_instock.
    check if online_instock  and store_instock value is 1 then add source property combain_sort and its value 1 otherwise 0 with record.
    In Property mapper map property combain_sort to P_combain_sort and apply sort in newly created property.
    Hope this will help you.
    Thanks,
    Sunil

  • XML for Analysis parser: The 'Domain\User' value of the 'EffectiveUserName' XML for Analysis property is not valid.

    hi 
    i have sharepoint 2013 enterprise over sql server 2012 standard, and i want to create some reports trhought excel services and performance point using EffectiveUserName feature, but right actually my environment is not working, when a configure an excel
    to read a SSAS cube from my local machine the rol is ok, but when i published the excel and try to update from Internet Explorer this error is presenting
    XML for Analysis parser: The Domain\User' value of the 'EffectiveUserName' XML for Analysis property is not valid.
    Anybody can helpme is urgent find out for some solution
    thanks a lot

    Turns out that you need the SP Farm service account to be an admin on the SSAS server as well.  That fixed the problem for us.
    MS: Please update your documentation :)

  • Multiple values for a given property in a Master Record

    I have a requirement to maintain multiple values for a given property of a master data as shown in the above example. Appreciate your help on the above.
    Regards
    SAP BOSS

    Hi,
    As you said
    How do I use the property values in my input values.
    I thought you are talking about input form, that's why I said you can crate input form using dimension over ride.
    But if your requirement is about scrip logic then it is better to ask question with reference to  following guide by Vadim Kalinin so that we can understand your requirement properly and you will get right solution.
    http://scn.sap.com/community/epm/planning-and-consolidation-for-netweaver/blog/2014/01/31/how-to-ask-questions-about-script-logic-issues
    Regards,
    Shrikant

  • How to get an XML string from a Java Bean without wrting to a file first ?

    I know we can save a Java Bean to an XML file with XMLEncoder and then read it back with XMLDecoder.
    But how can I get an XML string of a Java Bean without writing to a file first ?
    For instance :
    My_Class A_Class = new My_Class("a",1,2,"Z", ...);
    String XML_String_Of_The_Class = an XML representation of A_Class ?
    Of course I can save it to a file with XMLEncoder, and read it in using XMLDecoder, then delete the file, I wonder if it is possible to skip all that and get the XML string directly ?
    Frank

    I think so too, but I am trying to send the object to a servlet as shown below, since I don't know how to send an object to a servlet, I can only turn it into a string and reconstruct it back to an object on the server side after receiving it :
    import java.io.*;
    import java.net.*;
    import java.util.*;
    class Servlet_Message        // Send a message to an HTTP servlet. The protocol is a GET or POST request with a URLEncoded string holding the arguments sent as name=value pairs.
      public static int GET=0;
      public static int POST=1;
      private URL servlet;
      // the URL of the servlet to send messages to
      public Servlet_Message(URL servlet) { this.servlet=servlet; }
      public String sendMessage(Properties args) throws IOException { return sendMessage(args,POST); }
      // Send the request. Return the input stream with the response if the request succeeds.
      // @param args the arguments to send to the servlet
      // @param method GET or POST
      // @exception IOException if error sending request
      // @return the response from the servlet to this message
      public String sendMessage(Properties args,int method) throws IOException
        String Input_Line;
        StringBuffer Result_Buf=new StringBuffer();
        // Set this up any way you want -- POST can be used for all calls, but request headers
        // cannot be set in JDK 1.0.2 so the query string still must be used to pass arguments.
        if (method==GET)
          URL url=new URL(servlet.toExternalForm()+"?"+toEncodedString(args));
          BufferedReader in=new BufferedReader(new InputStreamReader(url.openStream()));
          while ((Input_Line=in.readLine()) != null) Result_Buf.append(Input_Line+"\n");
        else     
          URLConnection conn=servlet.openConnection();
          conn.setDoInput(true);
          conn.setDoOutput(true);           
          conn.setUseCaches(false);
          // Work around a Netscape bug
          conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
          // POST the request data (html form encoded)
          DataOutputStream out=new DataOutputStream(conn.getOutputStream());
          if (args!=null && args.size()>0)
            out.writeBytes(toEncodedString(args));
    //        System.out.println("ServletMessage args: "+args);
    //        System.out.println("ServletMessage toEncString args: "+toEncodedString(args));     
          BufferedReader in=new BufferedReader(new InputStreamReader(conn.getInputStream()));
          while ((Input_Line=in.readLine()) != null) Result_Buf.append(Input_Line+"\n");
          out.flush();
          out.close(); // ESSENTIAL for this to work!          
        return Result_Buf.toString();               // Read the POST response data   
      // Encode the arguments in the property set as a URL-encoded string. Multiple name=value pairs are separated by ampersands.
      // @return the URLEncoded string with name=value pairs
      public String toEncodedString(Properties args)
        StringBuffer sb=new StringBuffer();
        if (args!=null)
          String sep="";
          Enumeration names=args.propertyNames();
          while (names.hasMoreElements())
            String name=(String)names.nextElement();
            try { sb.append(sep+URLEncoder.encode(name,"UTF-8")+"="+URLEncoder.encode(args.getProperty(name),"UTF-8")); }
    //        try { sb.append(sep+URLEncoder.encode(name,"UTF-16")+"="+URLEncoder.encode(args.getProperty(name),"UTF-16")); }
            catch (UnsupportedEncodingException e) { System.out.println(e); }
            sep="&";
        return sb.toString();
    }As shown above the servlet need to encode a string.
    Now my question becomes :
    <1> Is it possible to send an object to a servlet, if so how ? And at the receiving end how to get it back to an object ?
    <2> If it can't be done, how can I be sure to encode the string in the right format to send it over to the servlet ?
    Frank

  • Converting XML string to ABAP types

    Hello,
    I am having a requirement where i wanted to parse incoming XML string and i checked few of examples of CALL TRANSFORMATION id.
    but whatever examples i checked those were simple transformation with no hierarchy.
    My source structure
    <record>
    <firstname>XYZ</firstname>
    <position>Testposition</postion>
    </record>
    and i used
    CALL transformation id
    source xml lv_xml
    result firstname = lv_firstname position = lv_position.
    but lv_firstname and lv_position were blank. any idea whether it can be acheived through such method?
    thanks in advance.
    regards
    rajeev

    Hello Rajeev,
    Try using the following simple transformation
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="record"/>
      <tt:template name="record">
        <record>
          <firstname>
            <tt:value ref="record.firstname"/>
          </firstname>
          <position>
            <tt:value ref="record.position"/>
          </position>
        </record>
      </tt:template>
    </tt:transform>
    In your code you could define a structure like the following:
    TYPES: BEGIN OF record,
                  firstname TYPE char50,
                  position  TYPE char50,
                END OF record.
    And now you could use the CALL TRANSFORMATION in your code to convert the xml string into the structure and visa-versa.
    CALL TRANSFORMATION zcl_test_rec
          SOURCE XML lv_string
          RESULT record = ls_test.
    Where lv_string holds the xml as a string and ls_test is defined as a structure of type record (defined above).
    Hope this helps.
    Thank you,
    Ramneek

  • Exception setting property value with CGLIB ( in hibernate)

    My hbm.xml file is:
    <hibernate-mapping>
    <class name="com.dst.fourx.model.codeModel.CodeGroupDisplay" table="CODE_GROUP_DISPAY1">
    <composite-id name="codeGroupDisplayKey" class="com.dst.fourx.model.codeModel.CodeGroupDisplayKey">
    <key-property name="nlsLanguage" type="java.lang.String" column="LANG_CD" />
    <key-many-to-one name="codeGroupCode" class="com.dst.fourx.model.codeModel.CodesGroup" column="CD_GRP_CD" />
    </composite-id>
    <property name="createDate" column="CREATE_DT" type="java.util.Date" not-null="true"/>
    <property name="createUserCode" column="CREATE_USER_CD" type="java.lang.String" not-null="true"/>
    <property name="updateDate" column="LAST_MOD_DT" type="java.util.Date"/>
    <property name="updateUserCode" column="LAST_MOD_USER_CD" type="java.lang.String"/>
    <property name="displayText" column="DISPLAY_TXT" type="java.lang.String" not-null="true"/>
    </class>
    <query name="findAllEditableCodeGroups">
    <![CDATA[from CodeGroupDisplay]]>
         </query>
    </hibernate-mapping>
    I m getting the following error while running the above query:
    org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.dst.fourx.model.codeModel.CodeGroupDisplayKey.setCodeGroupCode
         at org.hibernate.tuple.PojoComponentTuplizer.setPropertyValues(PojoComponentTuplizer.java:63)
         at org.hibernate.type.ComponentType.setPropertyValues(ComponentType.java:262)
         at org.hibernate.type.ComponentType.resolve(ComponentType.java:447)
         at org.hibernate.type.ComponentType.nullSafeGet(ComponentType.java:182)
         at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:759)
         at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:292)
         at org.hibernate.loader.Loader.doQuery(Loader.java:412)
         at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
         at org.hibernate.loader.Loader.doList(Loader.java:1593)
         at org.hibernate.loader.Loader.list(Loader.java:1577)
         at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
         at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
         at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
         at com.dst.fourx.core.impl.ao.dao.actions.HibernateNamedQueryAction.execute(HibernateNamedQueryAction.java:79)
         at com.dst.fourx.core.impl.ao.dao.BaseDAOHibernate.execute(BaseDAOHibernate.java:129)
         at com.dst.fourx.core.impl.ao.dao.AddEditCodeDAO.getAllFundingTypes(AddEditCodeDAO.java:47)
         at com.dst.fourx.core.impl.ao.dao.AddEditDAOTest.testGetCreditBankAccts(AddEditDAOTest.java:29)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Caused by: net.sf.cglib.beans.BulkBeanException: com.dst.fourx.model.codeModel.CodesGroup$$EnhancerByCGLIB$$fd9c7e4e
         at com.dst.fourx.model.codeModel.CodeGroupDisplayKey$$BulkBeanByCGLIB$$ae2c0401_2.setPropertyValues(<generated>)
         at org.hibernate.tuple.PojoComponentTuplizer.setPropertyValues(PojoComponentTuplizer.java:59)
         ... 32 more
    Caused by: java.lang.ClassCastException: com.dst.fourx.model.codeModel.CodesGroup$$EnhancerByCGLIB$$fd9c7e4e
         ... 34 more

    check the setter method for the property LANG_CD in com.dst.fourx.model.codeModel.CodeGroupDisplay.
    it must be like -
    setNlsLanguage(CodesGroup xyz) { ... }
    The paremeters must be objects, not the type of the database column. We can specify the actual field in CodesGroup which acts as the foreign key in CodeGroupDisplay in the "property-ref" attribute of <many-to-one> element in the mapping file for CodeGroupDisplay.
    This worked for me. Hope it works for you too.

  • How to process a large XML string passed to a LONG variable?

    I am attempting to extract and loop through some XML that is stored in a variable (v_xml_string) that is defined as LONG data type. However, I am receiving an ORA-01460: unimplemented or unreasonable conversion requested when the string value exceeds 20 records in the XML layout below. When I performed a LENGHTB on a sample XML string containing 19 records (just below the threshold of erroring), I get 3895, which I'm assuming is in BYTES...this is not near the 32,760 byte limit of PL/SQL variables defined as LONG. I suppose my other alternative is that I use CLOB datatype instead of LONG.
    XML layout:
    <?xml version="1.0"?>
    <DocumentElement>
      <tblElections>
        <EmpID>872G4</EmpID>
        <MgrNTID>JohnDoe</MgrNTID>
        <Entity>050595</Entity>
        <AddlAmt>1000</AddlAmt>
        <CheckedForSave>Y</CheckedForSave>   
      </tblElections>
    </DocumentElement>sample of code where error appers to be occurring:
    DECLARE
      v_xml_string LONG;
    BEGIN
        FOR v_xml_rec IN (SELECT t.COLUMN_VALUE.extract('/tblElections/EmpID/text()') .getStringVal() EmpID,
                                 t.COLUMN_VALUE.extract('/tblElections/MgrNTID/text()') .getStringVal() MgrNTID,
                                 t.COLUMN_VALUE.extract('/tblElections/FAEntity/text()') .getStringVal() FAEntity,
                                 t.COLUMN_VALUE.extract('/tblElections/AddlSLEAAmt/text()') .getStringVal() AddlSLEAAmt,
                                 t.COLUMN_VALUE.extract('/tblElections/CheckedForSave/text()') .getStringVal() CheckedForSave
                            FROM TABLE(xmlsequence(XMLTYPE(v_xml_string) .extract('/DocumentElement/tblElections'))) t)
        LOOP
    ... <do some stuff here>
       END LOOP;
    END;

    Strings in SQL are limited to 4000 in length, the long variable will work up to 32K as long as it is not used in SQL, if it goes over 4000 you will get the error.
    SQL> declare
      2    l long;
      3  begin
      4    l := rpad('x',32000,'x');
      5    dbms_output.put_line('length is : ' || to_char(length(l)));
      6  end;
      7  /
    length is : 32000
    PL/SQL procedure successfully completed.
    SQL> edi
    Wrote file afiedt.sql
      1  declare
      2    l long;
      3    n number;
      4  begin
      5    l := rpad('x',32000,'x');
      6    select length(l) into n from dual;
      7    dbms_output.put_line('length is : ' || to_char(n));
      8* end;
    SQL> /
    declare
    ERROR at line 1:
    ORA-01460: unimplemented or unreasonable conversion requested
    ORA-06512: at line 6
    SQL> edi
    Wrote file afiedt.sql
      1  declare
      2    l long;
      3    n number;
      4  begin
      5    l := rpad('x',4000,'x');
      6    select length(l) into n from dual;
      7    dbms_output.put_line('length is : ' || to_char(n));
      8* end;
    SQL> /
    length is : 4000
    PL/SQL procedure successfully completed.
    SQL> edi
    Wrote file afiedt.sql
      1  declare
      2    l long;
      3    n number;
      4  begin
      5    l := rpad('x',4001,'x');
      6    select length(l) into n from dual;
      7    dbms_output.put_line('length is : ' || to_char(n));
      8* end;
    SQL> /
    declare
    ERROR at line 1:
    ORA-01460: unimplemented or unreasonable conversion requested
    ORA-06512: at line 6
    SQL>

Maybe you are looking for

  • ICloud   Proxy (SOCKS): not so magical?

    Sensing an accelerating move away from 10.6 by Cupertino I bit the bullet and migrated three of my machines 10.6.8 to 10.7.3. These were done as clean installs with selective restores of data from Time Machine backups. I also migrated from MobileMe t

  • How to get name from JButton?

    Hey Is it possible to get the name from a clicked JButton in the actionPerformed so that if i have for example 2 JButtons i can do an if statement to do different things when a button is clicked? For example if button1 is clicked the screen writes "Y

  • Re: No display, MSI Z97 PC Mate (New Build)

    from the lower screen shot it looks like the drive is empty! how have you formatted the disk and what format did you chose? is it in a USB 2.0 slot?

  • I have FIOS and the latest version of the Airport Extreme Basestation set up in bridge mode.

    OK need some technical answers I have FIOS and am forced to use their Router. I have WiFi turned off on the FIOS router and my New version Airport Exteme Basestation set up in Bridge Mode. I have CAD 5 running to all my Mac computers and a CAD 5 up t

  • Install error 0003-0005 for app world on playbook.

    App. World for my playbook, has this error message when trying to install an app: Install error (0003-0005) there was a problem during installation. Please try again, Help!! It's been like this for awhile now. Anyone else having this problem?