URLEncoder and URLDecoder for posting XML Strings

Hi All
I need to post an XML string to another website using POST.
I have some java code that generates the XML string and sets the request object with this parameter. In my JSP I need to assign this to a hidden form element so that when a user clicks on "Submit", the destination site can extract the xml string.
The problem i am facing is that while setting the hidden form element
e.g. <input type=hidden name=xmlstr value= //Set it by reading the parameter from the request object.
only the initial part of the string is picked up i.e. only upto the first double quotes " i.e. upto <?xml version=
I am thinking of using URLEncoding to encode the xml while posting and URLDecoding to decode this xml.
Is there a better way of doing this ?
Thanks
Bits

I think that is the 'correct' thing to do. parameter values must be URLEncoded whether being posted or not.

Similar Messages

  • Error while creating DocumentBuilderFactory object for parsing XML string

    When I try to execute the following statement in an EJB class,
    DocumentBuilderFactory df=DocumentBuilderFactory.newInstance();
    I get the following exception:
    javax.xml.parsers.FactoryConfigurationError: Provider org.apache.crimson.jaxp.DocumentBuilderFactoryImpl not found
    When the same statement is executed from a standalone java class, it works fine.
    The IDE used is Visual Age for Java.
    The JAXP package used is JAXP 1.0.1
    Can anybody please let me know how can we overcome this problem?
    Thanks and Regards,
    Shashi Anand B
    E-Mail : [email protected]

    javax.xml.parsers.FactoryConfigurationError: Provider
    org.apache.crimson.jaxp.DocumentBuilderFactoryImpl not
    foundI suspect that this may be due to a classpath issue and/or a Java version issue. Doe your Visual Age installation use Java 1.3? Do you have Sun Java 1.4 also installed on your system? It may be that when you are executing from a standalone Java class, that you are using the Java 1.4 runtime, which include the org.apach.crimson.* classes. Earlier version of Java do not include this, although it may be in the JAXP package.
    I think that your Visual Age IDE is configured such that the DocumentBuilderFactory is unable to find the appropriate implementation.
    I hope this helps!
    - David

  • Special charecters handling while Converting XML string to DOM

    Hi,
    I am using the following approach for converting XML string to DOM, but due to Special characters like "&", I am getting Exceptions:
    String xmlString;
    DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(new InputSource(new StringReader(xmlString)));
    Can anyone please help me out on how to handle the Special characters in the above code.

    If the XML doesn't parse, then the XML must be invalid. Show a sample of such a special character in the XML data. Please use \ tags to post the actual XML content and any other code.                                                                                                                                                                                                                                                                                                                                                                                           

  • Details on data types for posting data to DB2 on AS400 from XI

    Hi
       We have a scenario in which we post data from XI (3.0, SP23 ) to DB2 on AS400 and we are using jdbc adapters ( jdbc drivers from IBM deployed on XI J2EE server as per SAP's instructions )
    On AS400-DB2, there are two files F1 and F2  that we have to update in a particular library L1 - on a server S1.  Each of the two files has a single field with the same name as that of the file.
    I have the following questions :
    1. How do we construct/specify the data type in order to convert XML from XI to the sql that DB2 needs - I do understand there is a standard data type structure used to convert XML to sql calls when we use JDBC receiver adapter type communication channel. Do we use the same for posting XML data from XI to DB2 too ? 
    2. What is the url for the jdbc driver - to connect to DB2 on AS400 ?
    Please share experiences of XI -- > posting to DB2 using JDBC.

    Used standard xml -->SQL constructs

  • Convert XML string into XML

    Hi All,
    Can you please let me know for any sample code in xslt/java mapping for converting XML string into XML. We use SAP Pi 7.0
    My XML string starts like this
    <?xml version="1.0" encoding="UTF-8" ?> 
    - <ns0:MT_ReceiverFileStructure <namespace>"><Output><?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<xsl>"?><Tarih_Date Tarih="11.09.2014" Date="09/11/2014>
       Thanks,
       Pavithra

    Thanks Praveen. It worked.
    However, the xml i have is an extract from a exchange rate URL and it has the reference to a xsl in it as below
    <?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<ABC.xsl>"?>.
    So there is an error in sxmb_moni. Is it possible to remove this.

  • Is there a way to get the actual XML string when using the JAXP SAX Parser?

    Hi All,
    I am using a JAXP SAX xml parser and am looking for a way to get the actual line of xml that is being parsed from within a content handler.
    Here's my scenario. Consider the following example xml document.
    <formCollection>
       <form name="myForm">
          <text/>
          <selection/>
       </form>
       <form name="anotherForm">
          <text/>
       </form>
    </formCollection>My hope is to validate the entire document and then insert an xml string containing each "form" element (and its sub-elements) into a map for later use. My thought was to create a String as each "form" element is being parsed (begining with the form's startElement event and concatenating until the form's endElement event is reached) and then inserting this string into the map. Is there a way to get the actual line of xml that is being parsed, rather than just the element name and attribute values?

    DrClap wrote:
    YouRang wrote:
    2. The first handler would validate the entire XML document, extract the "type" attribute from each <form> element, and place each <form> element and its sub-elements into the map of Strings, using the "type" attribute as the key. The second handler would take a <form> element and parse it into a Form object for the display. This option was the impetus for my question because it relies on the first handler being able to access the entire <form> element XML String and write it to a map.I don't see why you need the raw data from the XML document here. You should already be abstracting your data into Java classes in the first handler, instead of making the second handler do the parsing all over again.Correct, I am not referring to XForms. In this case, it happens that I am using the XML to generate an SWT ScrolledForm object and, thus, the XML element name happens to be named "form." However, the concept/design problem could apply to any type of object and the XML element could be appropriately renamed.
    My experience with XSLT is limited and I haven't done anything with it for several years. With that said, it seems that it is primarily used for generating web content, which wouldn't apply in this case because this is for a client-server application. I could be off base on this one -- if XSLT applies to much broader translations and would be more appropriate for generating Java objects than my current methodology, I could certainly look into it further.
    I apologize that option two didn't make more sense; it is difficult to explain. Yes, optimally the data should be abstracted into Java classes in the first handler. This is really an elaboration that I failed to specify when explaining option one. The problem is that the user can choose to create any number of "forms" of any type. For instance, let's say that from the File -> New menu there are options for seven different types of forms and each form is used to send completely different data. The user can select form1, select form1 again, select form4, and select form7 (or any other combination) and bring up tabs that display the different forms. The user can then enter data and submit each form separately. When the user selects File -> New -> FormX, a SWT ScrolledForm object that corresponds with FormX must be given to the display. Because SWT ScrolledForm objects do not allow a deep copy, I cannot simply read the XML <form> elements at initialization, parse them into ScrolledForm objects, and pass deep copies of the ScrolledForm objects to the display each time the user clicks File -> New -> FormX. The only simple way I see of getting a new copy of a ScrolledForm object is to reparse the appropriate XML <form> element in order to create one each time the user selects File -> New -> FormX. As such, one handler would need to read the entire XML document and parse the <form> elements into a map (or some other data structure) and another handler would need to parse individual <form> elements into SWT ScrolledForm objects. The first handler would be called at initialization and the second handler would be called each time a user clicked on File -> New -> FormX. Once again, this isn't exactly my favorite implementation... but seems the simplest given that there is no way to do a deep copy of an SWT ScrolledForm object. Hopefully that makes a little more sense. No worries if it doesn't -- I just figured I'd throw this out there and see if anyone had a better idea.

  • Does anyone can help me to import XML string into a ORACLE database

    Hi guys!
    i have some problem that my friend wants me to convert XML string to Oracle relational database which means.
    let's say, there is a table that a row has XML string.
    so table has XML string with varchar type.
    what my friend want me to do is, the string needs to be solved as a relational database.
    like
    A table has 'ID', 'data', 'result' rows
    and Data column has XML string like <?xml version...............>
    then wants to convert that data column's XML data into TABLE B with structure normally XML has.
    i'm so confused and have no idea at all.. also i couldn't find any solution related to my stuff..
    if someone knows how to solve the problem, just let us know
    thx

    The database is 10.2.0
    What sort of example do u want me to give you..
    i thought i give all information on the post..
    i will explain it
    let's say there are 3 columns ID,Name,Code
    Id = normal integer
    Name= varchar
    Code= varchar
    and i need to conver that XML in the Code column into relational databases
    the code column has normal XML code which is starting from <?xml version.... and so on
    so does it explain?
    please help me!

  • Web Services Consumer Transformation does not expand xml string in WSDL

    I am trying to create a WebService Consumer transformation with a WSDL file which I have imported in Informatica PowerCenter.The WSDL file has complexType xml strings which are not getting expanded while I am importing the WSDL file, thus it’s not showing the input and output fields in the request and response respectively. I have xsd file definition for these xml strings separately and there is no way I can incorporate them with the main WSDL in PowerCenter.  While I looked into the Informatica Documentation I found that in the Developer tool I can create Web Service in Data Services, and incorporate xsd element definition with main WSDL file. But it’s not exactly working in the way its described in the documentation. Any help would be appreciated.

    Hello All, I have got a scenario to implement: I have a Character source column which I need to convert to Numeric(18,4) and load into table. My source and target is a Netezza table. If the conversion fails, we do not drop the record, instead insert NULL for those records,i.e. source and target has same number of records. I use an expression as below : DECODE(Input_String, NULL, NULL-- Check for alphabets IIF((UPPER(Input_String) != LOWER(Input_String)), NULL-- Check for special charactersIIF((INSTR(Input_String,',',1) > 0 || INSTR(Input_String,':',1) > 0 || INSTR(Input_String,'@',1) > 0),NULL, TO_DECIMAL(Input_String,4))    )       ) Now my question is, can we use a single INSTR statement and check for all the special characters? I want to avoid writing multiple INSTR statements. Please suggest me how to check multiple characters in a single INSTR statement. Thanks & RegardsBiswajeet.

  • Inserting XML String into Table with help of Stored Proc

    I will be getting XML String from JAVA, which I have to insert in Table A, XML String is as follows
    <?xml version = '1.0'?>
    < TableA>
    <mappings Record="3">
    < MESSAGEID >1</ MESSAGEID >
    < MESSAGE >This  is available at your address!</ MESSAGE>
    </mappings>
    <mappings Record="3">
    < MESSAGEID >2</ MESSAGEID>
    < MESSAGE >This isn’t available at your address. </ MESSAGE>
    </mappings>
    </ TableA >
    Table Structure*
    MESSAGEID     VARCHAR2(15 BYTE)
    MESSAGE     VARCHAR2(500 BYTE)
    This is the stored procedure which I have written to insert data into TableA, V_MESSAGE will be input parameter for inserting XML String 
    create or replace procedure   AP_DBI_PS_MESSAGE_INSERT
    V_MESSAGE VARCHAR2(1024)
    AS
    declare
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp integer;
    V_FILEHANDLE UTL_FILE.FILE_TYPE;
    begin
    -- the name of the table as specified in our DTD
    xmlgen.setRowsetTag('TableA');
    -- the name of the data set as specified in our DTD
    xmlgen.setRowTag('mappings');
    -- for getting the output on the screen
    dbms_output.enable(1000000);
    -- open the XML document in read only mode
    v_FileHandle := utl_file.fopen(V_MESSAGE);
    --v_FileHandle := V_MESSAGE;
    loop
    BEGIN
    utl_file.get_line(v_FileHandle, charString);
    exception
    when no_data_found then
    utl_file.fclose(v_FileHandle);
    exit;
    END;
    dbms_output.put_line(charString);
    if finalStr is not null then
    finalStr := finalStr || charString;
    else
    finalStr := charString;
    end if;
    end loop;
    -- for inserting the XML data into the table
    rowsp := xmlgen.insertXML('ONE.TableA',finalStr);
    dbms_output.put_line('INSERT DONE '||TO_CHAR(rowsp));
    xmlgen.resetOptions;
    end;Please Help
    Edited by: 846857 on Jul 18, 2011 10:55 PM

    with t as (select xmltype('<TableA >
                               <mappings Record="3">
                               <MessageId>1</MessageId>
                               <Message> This bundle is available at your address!</Message>
                               </mappings>
                               <mappings Record="3">
                               <MessageId>2</MessageId>
                               <Message>This isn’t available at your address. </Message>
                               </mappings>
                               </TableA  >') col FROM dual)
      --End Of sample data creation with subquery factoring.
      --You can use the query from here with your table and column name.
    select EXTRACTVALUE(X1.column_value,'/mappings/MessageId') MESSAGEID
          ,EXTRACTVALUE(X1.column_value,'/mappings/Message') MESSAGE
    from t,table(XMLSEQUENCE(extract(t.COL,'/TableA/mappings'))) X1;Above Code works as i get result
    MESSAGEID     MESSAGE
    1             This bundle is available at your address!
    2             This isn’t available at your address.
    _____________________________________________ now I want to insert the result into Table A... How to proceed... Please help
    Edited by: 846857 on Jul 19, 2011 12:15 AM

  • How do I read the XML string using Http response/request?

    When my HTTP POST action is perform, the action will return me a XML string as shown in the link, https://www.neteller.com/gateway/netdirectv4.cfm?amount=150.00&net_account=458415554241&secure_id=896365&bank_acct_num=6789&currency=USD&merchant_id=1234&merch_transid=1102&merch_account=john123&custom_1=test123&custom_2=test123&custom_3=test123&test=1
    The above XML string will be send back by one of the payment gateway.
    How do I retrieve all the attribute name and value from the XML string so that it can be stored in my database?
    The XML string will be as shown below:
    <?xml version="1.0" encoding="ISO-8859-1"?><netdirect version="4.0">
              <approval>yes</approval>
              <amount>150.00</amount>
              <trans_id>403070</trans_id>
              <error>none</error>
              <fee>4.35</fee>
              <time>{ts '2006-06-23 06:14:19'}</time>
              <firstname>Test</firstname>
              <lastname>Test</lastname>
              <email>[email protected]</email>
              <custom_1>test123</custom_1>
              <custom_2>test123</custom_2>
              <custom_3>test123</custom_3>
              <dafee>0.00</dafee>
              <client_currency>USD</client_currency>
              <client_amount>150.00</client_amount>
              <merchant_currency>USD</merchant_currency>
              <merchant_amount>150.00</merchant_amount>
              <fxrate>1.0</fxrate>
              </netdirect>

    How about parsing the XML? Check out JAXP.
    http://java.sun.com/webservices/jaxp/index.jsp

  • Creating XML String DOM

    Hi ppl,
    I need some help with DOM Object. I have a xml file which I parse with dom and when I do some changes in dom object like adding new element or changing the values of existing object and now when I try to transorm the dom object back to a xml string. It puts everything in one line. for example say my xml file is like:-
    <student>
        <name>john</name>
        <result>pass</result>
    </student>Now when I add new element <address> to it , change value of existing element and try to get xml string i get something like this
    <student><name>smith</name><address>412Miam</address><result>pass</result></student>
    Whole xml in one or two lines, instead of proper xml with one element and its value in one line.
    Any ideas how to achieve this?

    Ddosot,
    Thank you very much. I was looking for this from long time.
    Honeslty I have searched news group many times but couldnt get an answer, may be my search words were not correct.
    you could have saved all this writing by running a
    little search on this forum, as this questions is
    asked once per day.
    anyway, here is your answer:
    transformer.setOutputProperty(OutputKeys.INDENT,
    "yes");
    transformer.setOutputProperty("{http://xml.apache.org/x
    lt}indent-amount", "1");

  • XML String to JavaBean

    Hello All,
    I used the java.beans.XMLEncoder to transform a java bean to XML string and created the following xml string
    <?xml version="1.0" encoding="UTF-8"?>
    <java version="1.5.0" class="java.beans.XMLDecoder">
    <object class="test.proj.testTransferObject">
    <void property="userLastName">
    <string>lastname</string>
    </void>
    <void property="userLastName">
    <string>firstname</string>
    </void>
    </object>
    </java>
    Now i want this xml string to be transformed to another Java bean abcproj.abcTransferObject, i tried the following code and it is failing as it could not find the same class :
    java.beans.XMLDecoder d = new java.beans.XMLDecoder(new java.io.ByteArrayInputStream(xmlString.getBytes() ));
         abcproj.abcTransferObjectresult = d.readObject();
    Help is greatly appreciated ...
    thanks

    i don't think you understand my question. you encoded a "test.proj.testTransferObject", why do you think you can decode it as "abcproj.abcTransferObject"?
    like i said above, if you really want to decode as a different object type but with (presumably) similar property structure, you are going to have to muck with the xml.

  • Process for posting inventory difference

    Dear sir,
    Can i know the process and transactions for posting differences of inventory in SAP

    Hi,
    You can Post Inventory Difference through Physical Inventory Count.
    Tcode MI01 - Create PI Document
    MI04 - Enter Count - This is where you actually enter the Counted Inventory(Stock)
    MI07 - Post Inventory Document - The Qty you enter gets posted in the system.
    This is for matching the actual Inventory viz a viz the Inventory in the system.
    e.g.
    You have a material # 100XXXXXX lying in a Plant XXX SLoc YYY and the Qty in system is 100 Nos.
    The Actual Physical Stock in Plant XXXX SLoc YYY is 104 Nos.
    You would need to match the System Stock with the Actual Stock, and therefore you will Create the PI document, Enter the actual count (104 Nos.) and Post it . The Books are matched with the Physical Stock of that Item.
    Check the Stock in Report MB52 or MB5B
    Hope this helps,
    Amit Bakshi

  • Logic Pro or Soundtrack Pro for Post Production (In a Pro Tools world)?

    Hey guys,
    How many of you out there, is using Logic for Post Production (or Soundtrack Pro)? I know a couple of people myself, out there using Logic Pro for Post and absolutely love it. Wanted to see if there are more of you out there and what your experiences have been with Logic Pro in the area of TV, motion picture and video sound. How is it, working in a majority Pro Tools realm? Are you finding it harder to interface with other studios, running Pro Tools?
    Message was edited by: Syrcle

    I find that Logic is not a substitute for Pro Tools as a post editor DAW. Having been a Logic user since 96' and a ProTools user since 92' , I cannot imagine trying to post something other than music using Logic. Of course, it could be done but, it is a matter of interchange ability and the simple editing found in Pro Tools that is easy for Post applications. Conversely, I would not be tempted to make music in a Pro Tools session,unless it was an all audio scenario without virtual midi plugins.
    I love Logic for music and ProTools for post and this comes after years of messing with both in everyday real commercial environments . If you have success using Logic as a good Post audio editorial
    device,then enlighten me! But,right now, I wouldn't want to make music without Logic and I would never try to mix a movie on anything else but ProTools because these are the devices I use everyday.
    GF

  • Who uses Logic 8 for Post ?

    I have started using it more and more for post & sound design duties particularly since version 8.
    Anyone else ?

    I do as well. Its alright. I still think i might like protools better but for the price difference and ability to use different equipment you can help but take a serious look at Logic.

Maybe you are looking for

  • Windows 7 64 bit intel hd 3000

    İs there driver for intel hd 3000 for windows 7 64 bit bootcamp in my mac it seems my graphic card is 256 mb so ı'm only using amd 6490m ı installed bootcamp driver cd but it didn't solve the problem how can ı use intel graphic driver too?

  • 2 sounds in a flash movie

    hello, i have 2 sounds in a flash movie, music and narration. I have this script in frame 1 for narration sound: _root.my_sound = new Sound(); _root.my_sound.attachSound("antedespacho"); _root.my_sound.start(); and i have a MC, in frame 1 of movie, a

  • Combo box in UI (drop down)

    hai, i am new to UI, i connect a datasource to combo box, when i navigate move first, next & last the records changing in combo, but i have a problem that "The contents of Combobox cannot drop down /Listed" can any one help me, its Urgent ?

  • Best Codek !

    Hi all, What is the best software Codek (Compressor-decompressor) to : 1) Save My own movies in the best possible quality, 2) Save My own movies in the lower possible size, 3) Make these movies more usuable in the dimension of pepole (export them in

  • Sprite sheet from PhotoShop CC 2014 layers to Edge Animate?

    Hi The Photoshop CC 2014 script that takes layers and generates a sprite sheet to the latest Edge Animate does not appear to work correctly. Unless I"m missing something very obvious (that isn't in the instructions below provided by Adobe), it doesn'