Web service Response data - how to extract fields from XMl returned

Hi,
    I am using a web service in adobe forms to get currency , by entering country name. I generated the fields i form by clicking on 'Generate fields ' it automatically generated the biding.
The problem is that in response field , i get the whole XML , wheras i just need the currecny value.
Below is the o/p.
<NewDataSet>
  <Table>
    <Name>India</Name>
    <CountryCode>in</CountryCode>
    <Currency>Rupee</Currency>
    <CurrencyCode>INR</CurrencyCode>
  </Table>
  <Table>
    <Name>India</Name>
    <CountryCode>in</CountryCode>
    <Currency>Rupee</Currency>
    <CurrencyCode>INR</CurrencyCode>
  </Table>
</NewDataSet>
I just want INR to be shown in the text field?
Plz help..

You might have to tweak this code some to get it to work, but it should at least lay the groundwork for solving your problem:
Code Snippet
/* Declare an XmlNode object and initialize it with the XML response from the GetListItems method. The last parameter specifies the GUID of the Web site containing the list. Setting it to null causes the Web site specified by the Url property to be used.*/
            System.Xml.XmlNode nodeListItems =
                MyListsService.GetListItems
                (listName, viewName, query, viewFields, rowLimit, queryOptions, null);
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
xd.LoadXml(nodeListItems.OuterXml);
System.Xml.XmlNamespaceManager nm = new System.Xml.XmlNamespaceManager(xd.NameTable);
nm.AddNamespace("rs", "urn:schemas-microsoft-com:rowset");
nm.AddNamespace("z", "#RowsetSchema");
nm.AddNamespace("rootNS", "http://schemas.microsoft.com/sharepoint/soap");
System.Xml.XmlNodeList nl = xd.SelectNodes("/rootNS:listitems/rs:data/z:row", nm);
foreach(System.Xml.XmlNode listItem in nl)
  listBoxProsjekter.Items.Add(listItem.OuterXml);
I hope this helps!
Please look into the following site for more info:
http://msdn2.microsoft.com/en-us/library/4bektfx9(vs.80).aspx

Similar Messages

  • Can "SPML Web Service Complex Data Type field" take multiple values ?

    In Generic Technology Connector's -SPML design parameters section, Can we give multiple values in SPML Web Service Complex Data Type field?
    If not, how can i call methods directly instead of calling them through a values of the "name" attribute of the "complexType" element in SPML Web Service Complex Data Type?
    I need 'SPML Web Service Complex Data Type' to hold multiple values.And based on the request it has to initiate appropriate method of action.
    Presently i have three methods add,modify and delete which i am calling through a single value of the "name" attribute of the "complexType" element in SPML Web Service Complex Data Type.
    I want to replace this single value with multiple menthods , so that a direct interaction between the method,OIM and target can be established.
    Edited by: 821054 on 16/02/2011 04:23

    Thanks Robert.
    You'll need to create your own interface to the webapp database for those kind of data operations
    by this, are you speaking of the internal BC database which stores web app schema data? That would be great if it were possible to update that programmatically because I need to use the List (Checkbox List) field type (for the search functionality), but I need to supply the checkbox options from a web app rather than by manually updating the list entered in the Fields view of the web app settings (shown below).
    I'm curious if anyone else has tried this?
    Again, my reason for needing to use the List (Checkbox List) field type is that the page which processes searches knows to expect a comma separated list for this field type and then appears to be parsing out the individual values for searching out web app items with 1 or more matching values. You're right that text fields (string and multiline) just check for 'string contains' matches, and this would be ok if I was only ever needing to search just one value at a time. Here's an example of what I might do:
    Web App item field value (as recorded against the List (Checkbox List) field type:
    8294877,8294878
    Web App Search value (for this same field):
    8294879,8294877,8294885
    The search would return this web app item because the field contains 2 (1 or more) individual values even though they were entered into the search field in a different order. If this web app item were just a Text (string or multiline) field, the searched value is not a substring of the web app item's stored value, so it would not find a match. Hence the need to use Checkbox List field type.
    The web app will have thousands if not 10s of thousands of records, so dumping them all into one big array or object and searching on the front-end won't be practical (though it works great on smaller datasets).

  • How to use a Web Service Response

    In the snps_users documentation it seems to be really easy but in fact...
    After invoking my web service I retrieve a XML file which is my response then we would like to use it.
    As written in the documentation I Export Response in XSD file, I create my XML Model but How to reverse the XSD ???
    There's 4 references to XSD into all the snps_users documentation but no one talking about.
    Moreover it's written See Creating and Reverse-Engineering a
    Model for an XML file for more information and that's what I'm doing but no way...
    So without the XSD I m trying to use the Response file like an XML file but I always have an error which looks like :
    java.sql.SQLException: No root found in the DTD file
    The Web Service Response XML File use NameSpace could the problem come from here ???
    If someone ever use it ...
    Thanks in advance.
    BM

    When I specify the XSD It raises another error,
    my URL is :
    jdbc:snps:xml?f=C:/Temp/File.xml&d=C:/Temp/File.xsd&s=REPON&nspg=xml
    Error message:
    java.sql.SQLException: A SAXException was caught while reading the model saying [Element value has no type]
    The XSD and the XML are generated by ODI after invoking a Web Service...
    Any idea ???

  • Set listbox items from web service response

    Hi All
    I am trying to set list box items from a web service response. Couple of issues over here:
    1. The user should be able to select multiple items from the list. Hence if I set "Allow multiple values" and set Commit on "exit", then after the web service returns the output, no data is displayed in the listbox. I need to click inside the list box to see the data returned by the web service. How to overcome this..??  ( However this problem (clicking inside the listbox to see the items) does not exist if "Allow multiple values" is unchecked and Commit is set on "Select". )
    2. After the list box is filled up, certain default values should be selected. This selection is based on one of the response field (which is actually a table with multiple values... ). Hence, how to capture this response field and set the default values in the above list..??
    3. The same case for a dropdown. The values are visible in dropdown. However, a default value should be selected and displayed after returning a response from web service. Again, this default value is dependant on another field in the response as in point no.2
    I am trying to use postExecute event as described in [this|http://forms.stefcameron.com/2009/03/23/pre-process-web-service-responses/] link...however not able to achieve the functionality. Please provide suggestions / inputs.
    Thanks
    Deepak

    Hello,
    first: I don´t know anything about the right solution. I am unaware of the existence of the solution, because there were quite many of question about this multiple selection problem and I don´t remember a single "answer".
    I can recommend you to simplify everything and create the functionality yourself. I have done that before to avoid these "Adobe-standard" problems. If you have a problem with autofill of the object, ask your WS to send you a single string and pass it yourself using scripting (JS).
    And if you have problems with multiple selection, create your own field/ object. Get the string of values, parse it, create multiple lines of the dynamic table with some suitable tool to check/ select the rows you need (use checkbox for example, and your text as a table row). This way you can selected anything you want with no problems at all. It wil only cost you some extra work.
    Regards, Otto

  • Retrieve error message of SAP provided web service in web service response

    Hi All,
    We have a SAP provided web service that sometimes fails to process data it is called with. This is not a problem as the data sometimes is just plain wrong (i.e. date field contains text). However, the error is only logged in SAP and can only be queried using SRT_UTIL.
    The problem is that the error is not reported back via the response. How can we set up the web service so that the error could be displayed by the calling party without logging into SAP?
    Thanks for the help in advance.
    Best Regards,
    Daniel

    Hi Calvin,
    The WS is indeed synchronous. The problem is not whether the error is captured or not. It is captured indeed but it is logged inside SAP only and not returned via the Web Service response mechanism. The error message says that error message can be retrieved using SRT_UTIL.
    This is a major problem as the users of the outside system calling SAP have no right to use SRT_UTIL to track down the error. They need to contact SAP basis in order to get to the end of it.
    What we need to achieve is to get back the same error message that can be seen with SRT_UTIL via the web service.
    Thanks.

  • Web service response contains SOAP Headers with "mustUnderstand" true

    Hi
    I have a requirement where in I have to consume a web service as adaptive web service model, and while executing the service pass a mandatory parameter to the soap header. We are able to set the mandatory parameter to the soad header. We got the code snippet to do this from a wiki link
    http://wiki.sdn.sap.com/wiki/display/WDJava/FAQ-Models-AdaptiveWebService#FAQ-Models-AdaptiveWebService-WhatarethefunctionalgapsofthecurrentAdpativeWSModelImporter%3F
    On executing the service now through web dynpro we are getting the below error
    "Web service response contains SOAP Headers with "mustUnderstand" true which are not handled by the client runtime"
    Any thoughts on how to handle this mustUnderstand attribute with some code snippet? Appreciate all help.
    Thanks,
    KN.

    Hi
    Have you found the workaround?
    Sorry for refreshing topic. Flag mustUnderstand ='1' in response is unussual thing.
    BR

  • Web Service as Data Service of a Combo Box?

    Hi,
    I tried to use a Web Service as Data Service for a dynamic entry list of a Combo Box. The problem is that I can’t see any entry in the resulting iView.
    The Web Service is working for sure; I can present the containing data in a table. I also tested BAPIS as Data Service for my Combo Box they are working properly.
    Has anyone an idea how to solve this problem?
    Thanks in advance
    Robert

    Hi Jarrod,
    I tried a drop down list instead, still the same Problem. The connection to the web service works properly there is no problem. I can choose it and the data service test is working fine.
    I also tried to use a value help instead of a drop down list, there encounters the problem that it’s not possible to select any of my data services, neither web services nor BAPI’s.
    Any idea?
    Robert

  • Invalidate Adaptive Web Service Meta Data Cache?

    As the subject says - how can I invalidate the Adaptive Web Service meta data cache?  Currently, the only way we can invalidate the cache is to restart the app server, which takes quite a while.
    I've tried restarting the Web Dynpro Runtime service, but this didn't do anything.
    We're running nw70.

    Hi,
    Please consider the following:
    For JCO Models running on NW 7.2 you go to:
    1) NWA
    2) Availability and Performance Management --> Resource Monitoring
    3) JCO Monitoring
    4) Metadata Cache
    5) Click on clear of the desired cache region.
    For WebServices Cache, please follow the instructions as per notes below:
    Note 1088382 - WSIL results are cached after search
    Note 1123574 - Caching functionality of the Web service connector
    Cheers,
    Ivan

  • Web service response processing inside a BPM

    Hi Experts,
    Please can you let me know if it is possible to achieve the following inside a BPM:
    u2022     Once you getting the web service  SOAP response, determine if itu2019s a SOAP fault or a normal web service response.
    u2022     If itu2019s a SOAP fault, create a retry loop with a wait step inside the BPM to try and retry the process (perhaps 5 times in 1 minute intervals).
    u2022     After the retry intervals, if the message is still in a failed step, force the BPM to go into an error state
    u2022     If the Web Service returns a normal response, log the response inside a database table and end the BPM
    If it is possible, please can you provide an example?
    Thank you,
    Brendon

    Hi
    Have you found the workaround?
    Sorry for refreshing topic. Flag mustUnderstand ='1' in response is unussual thing.
    BR

  • How to extract text from a PDF file?

    Hello Suners,
    i need to know how to extract text from a pdf file?
    does anyone know what is the character encoding in pdf file, when i use an input stream to read the file it gives encrypted characters not the original text in the file.
    is there any procedures i should do while reading a pdf file,
    File f=new File("D:/File.pdf");
                   FileReader fr=new FileReader(f);
                   BufferedReader br=new BufferedReader(fr);
                   String s=br.readLine();any help will be deeply appreciated.

    jverd wrote:
    First, you set i once, and then loop without ever changing it. So your loop body will execute either 0 times or infinitely many times, writing the same byte every time. Actually, maybe it'll execute once and then throw an ArrayIndexOutOfBoundsException. That's basic java looping, and you're going to need a firm grip on that before you try to do anything as advanced as PDF reading. the case.oops you are absolutely right that was a silly mistake to forget that,
    Second, what do the docs for getPageContent say? Do they say that it simply gives you the text on the page as if the thing were a simple text doc? I'd be surprised if that's the case.getPageContent return array of bytes so the question will be:
    how to get text from this array? i was thinking of :
        private void jButton1_actionPerformed(ActionEvent e) {
            PdfReader read;
            StringBuffer buff=new StringBuffer();
            try {
                read = new PdfReader("d:/getjobid2727.pdf");
                read.getMetaData();
                byte[] data=read.getPageContent(1);
                int i=0;
                while(i>-1){ 
                    buff.append(data);
    i++;
    String str=buff.toString();
    FileOutputStream fos = new FileOutputStream("D:/test.txt");
    Writer out = new OutputStreamWriter(fos, "UTF8");
    out.write(str);
    out.close();
    read.close();
    } catch (Exception f) {
    f.printStackTrace();
    "D:/test.txt"  hasn't been created!! when i ran the program,
    is my steps right?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to extract certificates from IE for digital signature

    hi
    how to extract certificates from the cert store provided by Internet Explorer 6.0 and use it to read & verify the digital signatures present in the pc.this is needed in my web based application n i have no idea!!!
    pls help me out
    i have studied a lot about all JCA n JCE but the extraction part still baffles me!!!
    my application will be java based so i can make an applet/ servlet/ jsp
    drop your ideas as soon as u get time as i am stuck in the initial phase itself
    priya_16

    hi
    i've the same problem. i've found this solution, but you need download a JCE Provider that allow you to read the explorer certificate store.
    You can try this one: https://download.assembla.se/jceprovider/
    and the code:
    import se.assembla.*;
    public class Listcerts {  
         public static void list() throws Exception{
              java.security.Security.insertProviderAt(new se.assembla.jce.provider.ms.MSProvider(), 2);
              KeyStore ks = KeyStore.getInstance("MSKS","assembla");
              ks.load(null,null);
              X509Certificate cert=null;
              String alias=null;
              int count=0;
              for (java.util.Enumeration e=ks.aliases();e.hasMoreElements();){
                        alias=(String)e.nextElement();
                        cert=(X509Certificate)ks.getCertificate(alias);
                        System.out.println("\n Certificado alias"+alias+":");
                        System.out.println(cert);
                   count++;
              System.out.println ("NUM CERTS="+count);
    now, i need the same solution for Firefox browser XP
    good luck
    Message was edited by:
    meteko

  • How to join  fields from different internal tables and display into one int

    hai i have one doubt...
    how to join  fields from different internal tables and display into one internal table..
    if anybody know the ans for this qus tell me......

    hii
    you can read data as per condition and then can join in one internal table using READ and APPEND statement..refer to following code.
    SELECT bwkey                         " Valuation Area
             bukrs                         " Company Code
        FROM t001k
        INTO TABLE i_t001k
       WHERE bukrs IN s_bukrs.
      IF sy-subrc EQ 0.
        SELECT bwkey                       " Valuation Area
               werks                       " Plant
          FROM t001w
          INTO TABLE i_t001w
           FOR ALL ENTRIES IN i_t001k
         WHERE bwkey = i_t001k-bwkey
           AND werks IN s_werks.
        IF sy-subrc EQ 0.
          LOOP AT i_output INTO wa_output.
            READ TABLE i_t001w INTO wa_t001w WITH KEY werks = wa_output-werks.
            READ TABLE i_t001k INTO wa_t001k WITH KEY bwkey = wa_t001w-bwkey.
            wa_output-bukrs = wa_t001k-bukrs.
            MODIFY i_output FROM wa_output.
            CLEAR wa_output.
          ENDLOOP.                         " LOOP AT i_output
        ENDIF.                             " IF sy-subrc EQ 0
    regards
    twinkal

  • How to extract text from a PDF file using php?

    How to extract text from a PDF file using php?
    thanks
    fabio

    > Do you know of any other way this can be done?
    There are many ways. But this out of scope of this forum. You can try this forum: http://forum.planetpdf.com/

  • How to extract the actual XML document from soap message?

    My problem is " how to extract the actual XML document from soap message? "
    i just want to extract the attachment i.e. (pure XML document without any soap header or envolope).
    i could be ver thank full if u could solve my problem.
    [email protected]

    Hi,
    This is some skeleton code for extracting an attachment from a SOAPMessage.
    import javax.activation.DataHandler.;
    import javax.xml.soap.*;
    import javax.xml.message.*;
    Iterator allAttachments = message.getAttachments();
    AttachmentPart ap1 = null;
    while(allAttachments.hasNext()){
    ap1 = (AttachmentPart)allAttachments.next();
    //Check that the attachment is correct one. By looking at its mime headers
    //Convert the attachment part into its DOM representation:
    if(ap1.getContentType() == "text/xml"){
    //Use the activation dataHandler class to extract the content, then create a StreamSource from
    //the content.
    DataHandler attachmentContent = ap1.getDataHandler();
    StreamSource attachmentStream = new StreamSource(attachmentContent.getInputStream());
    DOMResult domAttachment = getDOMResult(attachmentStream);
    domAttachment holds an xml representation of the attachment.
    Hope this helps.

  • How to extract controlfile from backup set?

    Hi
    If I use this "INCLUDE CURRENT CONTROLFILE" in backup command direct to tape and no catalog, How to extract controlfile from backup set from tape?
    Thanks,
    Taohiko
    Edited by: taohiko on Sep 17, 2009 7:54 AM

    yes
    list backup of controlfile
    will show you where controlfile backup piece reside with backup piece name
    after then
    restore controlfile from 'backup_piece_naem_with_its_full_path_from_above_command_result';Khurram

Maybe you are looking for

  • Address bar dissapeared

    Hi, suddenly today I hit something and my address bar is gone, I've looked everywhere through the system preferences, and the safari toolbar and can't find it ANYWHERE! Can anyone help?

  • My apple tv doesnt turn on, there isnt any light

    My apple tv doesn´t turn on, It isnt a electricity problem, I cant see any light, I pushed the control  for some seconds, but doesnt work

  • Motion 5 with Final Cut Express?

    It will let me download Motion 5 from the app store, but will it work with the newest version of Final Cut Express?  Meaning can I use it for smoother slow motion and import into FCE? Thanks!

  • ZIP file

    I developed a 1 page Xmas comic using 'comic life' and photos dragged from iPhoto. I exported it to PDF so it was easier to email to people. The size of the PDF is 12 Mb. However when I tried to compress it using the inbuilt leopard features, the zip

  • DBCA did not see the ASM disk group in NODE 2 but see in NODE 1

    Are there anyone who encountered creating a database using DBCA with ASM as file system? Our issue before is in both nodes the DBCA did not see the ASM disk group. But after setting the TNS_ADMIN in both nodes and running the DBCA as administrator in