Decode XML from WebServices

Hello ! :
I need to do an application in Java. This application will receive and XML from WebServices.
But, I never did anything like that. So,I have some questions about this :
1- The webservice will return the execution of an RFC, so, how get Java this XML Code that contains the information of the parameters and tables? With tags?.
2- How i can traduce this xml code / tags, for example, to print a grid with the information received of the table parameter?
3- Will you have an example of xml that comes from a webservice or rfc?
4- Where do I get the information that is contained in the tables and parameters?
As you can see.. i really need your help.
Sorry about my english and thanks for reading.
Bye!

Your questions are confusing. Can you simply say what  needs to be done ?
Edited by: Hussain Sehorewala on Sep 4, 2011 1:26 PM

Similar Messages

  • Decode an XML from WebServices

    Hello ! :
    I need to do an application in Java. This application will receive and XML from WebServices.
    But, I never did anything like that. So,I have some questions about this :
    1- The webservice will return the execution of an RFC, so, how get Java this XML Code that contains the information of the parameters and tables? With tags?.
    2- How i can traduce this xml code / tags, for example, to print a grid with the information received of the table parameter?
    3- Will you have an example of xml that comes from a webservice or rfc?
    As you can see.. i really need your help.
    Sorry about my english and  thanks for reading.
    Bye!

    Hi,
    For instance, here I have used BAPI_BANK_GETLIST. I generated a WSDL, then I did a "loopback" by generating a client proxy so that to know how to call it, started the ICF recording (SICF), tested the proxy, and I obtain that:
    Request:
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
      <soap-env:Header>
        <n0:Trace xmlns:n0="http://www.sap.com/webas/630/soap/features/runtime/tracing/">
          <TraceLevel xmlns="http://www.sap.com/webas/630/soap/features/runtime/tracing/">Error</TraceLevel>
        </n0:Trace>
      </soap-env:Header>
      <soap-env:Body>
        <nr1:BankGetlist xmlns:nr1="urn:sap-com:document:sap:soap:functions:mc-style">
          <BankCtry>FR</BankCtry>
          <BankList></BankList>
          <MaxRows>0</MaxRows>
        </nr1:BankGetlist>
      </soap-env:Body>
    </soap-env:Envelope>
    Response:
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
    <soap-env:Body>
      <n0:BankGetlistResponse xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style">
        <BankList>
          <item>
            <BankCtry>FR</BankCtry>
            <BankKey>1234567890</BankKey>
            <BankName>AAAAAAAAAAAAA</BankName>
          </item>
        </BankList>
        <Return>
          <Type></Type>
        </Return>
      </n0:BankGetlistResponse>
    </soap-env:Body>
    </soap-env:Envelope>
    Sandra

  • Could I get result in xml from webservice (my client is java application)?

    Hi,
    I have a client which is a java application to call to my existed webservice and webservice return object result is okie. But I would like to get the result which is wrapped in xml file, not object? Can webservice do that? (If not, I have to wrap the result in xml by hand).
    Anyone who know please help me. Very urgent, I have to have answer in 1 day.
    Thank in advance.

    The result when we call to my webservice is an object which contain data, I don't want to get this object, I would like to gain an equivalent xml instead of object ( I don't know if webservice support this).
    Yes, the last way is convert result java object to xml. But I think web service should support get xml results because client call to webservice is whatever, right?

  • Extracting XML from webservice result with Namespaces using E4X

    Hi,
    I need to extract some data from proprietary Web Service (to be fed to HierarchicalData for dataProvider of ADG).
    So I made service.returnType=’e4x’;
    In that case it returns data as XML.
    I need to get useful data from it after Snapshot:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header xmlns:msdwHdr="http://xml.msdw.com/ns/appmw/soap/1.0/header">
    <msdw:RequestID xmlns:msdw="http://xml.msdw.com/ns/appmw/soap/1.0/header">restsoap#1390182244050#197728273958044232</msdw:RequestID>
    <msdwHdr:FinalMessage>true</msdwHdr:FinalMessage>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    <ADSSnapshotResponse xmlns="http://xml.ms.com/ns/appmw/dataserver/1.0">
    <Snapshot seqNo="0">
    <BASE_ELEMENT_NAME BASE_ELEMENT_NAME="4.11.2.0">
    Using E4X, like:
    var root:XML = event.result as XML; //good!
    var xmlRoot1:XMLList = root['SOAP-ENV:Body'].ADSSnapshotResponse.Snapshot.BASE_ELEMENT_NAME;
    it does return XMLList (tried different variants), but debugger shows nothing at all inside that XMLList.
    var root1:XMLList = root.children();  // that returns valid XMLList with 2 XML elements inside
    But all other data I could not get if I use any E4X:
    Can I skip Envelope, going to Body as one of its children?  suppose I can...
    a) root.SOAP-ENV:Body would give compilation errors because of ‘-‘, ‘:’
    b) root.Body gives blank XMLList
    c) root.Body[0] returns NULL  
    Any idea how to extract the load from ADS Response (envelope)?
    What can I do regarding XML Namespaces in E4X ?
    If I set service.returnType="xml" it returns data as XMLNode's.
    But I prefer to use E4X if possible.
    Please help!
    TIA,
    Oleg.
    P.S.: using Flex 4.5.1 with Flex3 ADG.

    not an implementable option for us and cost prohibitive.

  • Error while posting XML from a scheduled transaction to another transaction

    When I try posting an XML from one transaction to another in a different project by calling it as a webservice, it doen't hit the other transaction.
    I see this in the Netweaver error logs:
    java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:111)
    at java.util.zip.ZipFile.<init>(ZipFile.java:127)  [see details]
    XML AssignXml Parse Error
    [EXCEPTION]
    org.xml.sax.SAXParseException: Premature end of file.... [see details]
    AND
    [Fatal Error] :-1:-1: Premature end of file.
    More interestingly it happens ONLY when I schedule the parent transaction, when I trigger it manual everything works fine.
    Any help appreciated.

    Hi Srinivas,
    I see that this post was marked as answered. Could you please elaborate on how this problem was fixed?
    I am experiencing a similar issue:
    I am trying to get the Active Portal application running in MII 12.1.7 (also 12.1.8) and all went well up to the point where the ActivePortalMonitor transaction is scheduled. In the logs I also receive the  org.xml.sax.SAXParseException.
    The culprit is the XMLQuery block in that txn. Just like with your situation, when ran from workbench it works; when scheduled it doesn't.
    I tried replacing the XMLQuery with other blocks that get the same result, i.e. XMLLoader or HTTPLoader + StringToXMLParser; and in all cases the XML fetching element bombs out.
    I also built a simple txn that does an XMLQuery on another txn and then dumps the output in a file. Same thing: when run from workbench it runs fine; from scheduler it gives "SAX" error
    I would post the specific error log, but it is always varying, here is one example:
    [ERROR] [Untitled_0]org.xml.sax.SAXParseException: Open quote is expected for attribute "DIR" associated with an element type "HTML".
    Any help/hints are much appreciated
    Kind Regards,
    Fanie

  • Invoking BPEL from Webservice

    Hello,
    I'm trying to change BPEL process state from webservice. The code:
    public void switchProcessOf(String name) throws Exception
    Hashtable contextProps = new Hashtable();
    contextProps.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    contextProps.put(javax.naming.Context.SECURITY_PRINCIPAL, "admin");
    contextProps.put(javax.naming.Context.SECURITY_CREDENTIALS, "manager");
    contextProps.put(javax.naming.Context.PROVIDER_URL, "ormi://localhost:23791/orabpel");
    locator = new Locator("default","bpel", contextProps);
    IBPELProcessHandle scHandle = locator.lookupProcess(name);
    BPELProcessRevisionInfo ri = scHandle.getRevision();
    ri.setState(IBPELProcessHandle.STATE_OFF);
    scHandle.updateRevision(ri);
    I invoke the websvc and when I log in the BPEL console I get the following error:
    "javax.naming.NameNotFoundException: ejb/collaxa/system/ServerBean not found
         at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:164)
         at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:333)
         at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:120)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at com.oracle.bpel.client.util.BeanRegistry.lookupServerBean(BeanRegistry.java:95)
         at com.oracle.bpel.client.Server.getServerBean(Server.java:463)
         at com.oracle.bpel.client.Server.isDomainListingEnabled(Server.java:419)
         at _login._jspService(_login.java:90)
    Any ideas?
    Thanks,
    Rogerio

    Hi Clemens,
    I actually checked the way the entry is required, and it was the same we used here.
    I am listing the entries here. Let me know if I am going wrong somewhere.
    In Server.xml,
    <application
    name="customer"
    path="../applications/customer.ear"
    parent="orabpel"
    auto-start="true"/>
    In http-web-site.xml,
    <web-app
    application="customer"
    name="customer"
    load-on-startup="true"
    root="/customer"/>
    <web-app
    application="customer "
    name="customer"
    root="/customer"/>
    The customer.ear application has just only one cutomer.war file. It fails this way as well as other way where we deploy just the cutomer.war file standalone as a web application.
    1. Am I missing any entries ?
    2. We need to make duplicate web-app entry with just an additional attribute. What is the reason for this?
    Thanks in advance.
    |Soumen|

  • Retun of object or Array From webservice

    Thanks pekka,
    you are right...
    It is also possible to manage the ByteStream by returning the byte[] array from web services, but the issue is when the response reaches to the client... the invoke method returns object ...as
    byte[] ret = (byte[]) call.invoke( new Object[] { "Any String" } );
    At this point the axis server throws an error.... regarding the cast of Object type to byte array... (ClassCastException)... Due to this error i thought to return ByreArrayOutputStream object from webservice function......
    Although the return of byte[] will also work for me.... but the wholw issue struck at client at client side during typecasting of returned object from web services.....
    please suggest any solution.... for its casting...
    Thanks Very much...
    Gaurav

    Dear jpday,
    Have you seen this tutorial?
    Web Services in LabVIEW 
    http://zone.ni.com/devzone/cda/tut/p/id/7350
    attached to it you will find a zip file named webservicesdemo. This demo contains a VI called Function Generator Main, which shows how to convert an array to an XML string, which you can then output from the web service VI (Function Generator Main shows how to do this). 
    Hope this helps!
    ~Nate 

  • Extracting the xml from string and parse it

    Hi all,
    I have a webservice, and calling one of the methods, returns xml data but store this data in a string.
    For example:
    String str = keysstub.getUserLMLArray(UserID,hash, Provider, Filter.ALL,TimeStampString).getXmlResults();returns <id>123456</id><id>123457</id><id>123458</id><id>123459</id><id>123461</id>and stores it in str.
    I have to take read this xml from the string and parse it accordingly to retreive the data from it.
    Please suggest how i can parse this xml from the string. it will be of great help. Code snippets from anyone would be of great help
    Thanks and Regards,
    Shikha

          * Get DOM document from a string containing valid XML.
          * @param string String to read XML content from.
         * @param varargs Optional arguments: 1: Validating?, 2: NamespaceAware?
          * @return DOM document or null if failed.
         * @throws Exception if failed.
         static public Document toDocument(String string, boolean... varargs) throws Exception {
            Document result = null;
            if (string != null) {
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                if (varargs != null && varargs.length > 0) {
                    int count = varargs.length;
                    if (count > 0) {
                        factory.setValidating(varargs[0]);  //needs error handler
                    if (count > 1) {
                        factory.setNamespaceAware(varargs[1]);
                DocumentBuilder db = factory.newDocumentBuilder();
                result = db.parse(new InputSource(new StringReader(string)));
            }//else: input unavailable
            return result;
        }//toDocument()and don't forget that the string must be valid xml, so in your example the header is missing and the first element must embrace all subsequent elements, e.g.
    <?xml version="1.0"?>
    <ids>
    <id>123456</id><id>123457</id><id>123458</id><id>123459</id><id>123461</id>
    </ids>

  • Hide name space of generated xml from xml bean

    Hi,
    how can i hide the namespace of the generated xml from xml bean, cause im having problems with jaxb parses.

    The targetNamespace is for webservice and not for the user defined classes.
    Sorry for the confusion
    Ajay
    "Ajay" <[email protected]> wrote in message
    news:[email protected]..
    There is a targetNamespace attribute in the autotyp ant task. But there
    was a bug in 8.1. Contact the support for a patch.
    The following mail explains that
    This looks like a bug. There is an undocument, not officially
    supported workaround: add the following java doc
    to yours source code -
    * @wlws:webservice targetNamespace="http://foo.bar"
    public class MyService {
    Details here:
    http://www.manojc.com/tutorial/sample3/source2wsdd.html
    Regards,
    -manoj
    http://manojc.com
    "Mark Fine" <[email protected]> wrote in message
    news:[email protected]..
    The attribute targetNamespace (of the autotype task) doesn't seem to putany
    information into the types file and later my deployment descriptor (viathe
    source2wsdd task) contains an invalid targetNamespace attribute with a
    http://tempuri.org:
    eg.
    <web-services>
    <web-service name="IndexService"
    targetNamespace="http://tempuri.org/"
    uri="/IndexWebService">
    I don't think this causes any problems but there should be a way tospecify
    the namespace.
    Has anyone else seen this is WLS8.1?
    "Siva" <[email protected]> wrote in message
    news:[email protected]..
    By default the autotype or the servicegen ant task seem to be creating anamespace
    from the java package name (like java:com.ventaso.external.common) for
    xml
    mapping
    of user defined java classes. Is there a way to change this to name
    space
    I want
    ? Specifying the targetnamespace doesn't seem to help.
    Thanks,
    Siva

  • Generating an xml from a pl/sql procedure

    Hi Friends,
    I have come up with a requirement to generate an xml from a pl/sql procedure.
    I did some R & D and also got some sample procedures but could not understand the datatypes being used.
    The procedure declares variables like this:
    doc                  xmldom.DOMDocument;
    mainNode         xmldom.DOMNode;
    headerElem      xmldom.DOMElement; Pls could anyone tell what do these xmldom.DOMDocument, xmldom.DOMNode and xmldom.DOMElement mean?
    Later in the procedure, these variables are assigned values like
    doc      := xmldom.newDOMDocument;
    mainNode := xmldom.makenode(doc); This went a bouncer on me.
    Pls help.
    Thanks in advance ...!

    You can check this one -- Learned this from michael.
    satyaki>
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    satyaki>
    satyaki>
    satyaki>with person_h
      2  as
      3    (
      4      select 1 id, 'M' gender, 'W' race, '170' weight from dual union all
      5      select 1, 'M', 'W', '170' from dual union all
      6      select 1, 'M', 'W', '180' from dual union all
      7      select 1, 'M', NULL, '175' from dual union all
      8      select 1, NULL, 'W', NULL from dual
      9    )
    10    select xmlelement("Person",(
    11                                 select xmlagg(xmlelement("Sex", gender))
    12                                 from (
    13                                        select distinct gender
    14                                        from person_h
    15                                        where id = 1
    16                                        and gender is not null
    17                                      ) pg
    18                                ),
    19                                (
    20                                  select xmlagg(xmlforest(race as "Race"))
    21                                  from (
    22                                         select distinct race
    23                                         from person_h
    24                                         where id = 1
    25                                       ) pg
    26                                ),
    27                                (
    28                                  select xmlagg(xmlforest(weight as "Weight"))
    29                                  from (
    30                                         select distinct weight
    31                                         from person_h
    32                                         where id = 1
    33                                       ) pg
    34                                 )
    35                     ).getstringval() Res
    36    from dual;
    RES
    <Person><Sex>M</Sex><Race>W</Race><Weight>170</Weight><Weight>175</Weight><Weight>180</Weight></Person>
    satyaki>Regards.
    Satyaki De.

  • How to generate XML from EBusiness suite ARXSGPO

    Could someone tell me how I can generate XML from the EBusiness Suite Accounts Receivable report ARXSGPO.rdf I understand this report is called by a C program. I have tried changing the concurrent request to output format to XML the result does not resemble XML. Does anyone have any suggestions how I can generate XML from the ARXSGPO report?
    Thanks,
    Mark

    Hi Mark
    the next release of XMLP will have last page only support. The problem is that at the template layer you do not know how many lines are going to fit on the page, so you never know what is going to be the last page. The only way around it for now is to specify the number of lines to a page and then check when all the lines have been rendered and then render the remit portion.
    I have a sample invoice that does the same, drop me a mail, you can work out the email from my name and the fact I work for XMLP Im sure.
    Tim

  • How to generate XML from SQL query

    possible ways to generate XML from SQL qury.
    i want to generate XML of following query. "Select * from emp,dep wher emp.deptno=dept.deptno"

    Hello.
    Can you try:
    SQL> set pages 0
    SQL> set linesize 150
    SQL> set long 9999999
    SQL> set head off
    SQL> select dbms_xmlgen.getxml('Select * from emp,dep wher emp.deptno=dept.deptno') from dual;
    It works fine for me.
    Octavio

  • How to update the Sent Idoc Status based on the Response From Webservice

    Hi All,
    I have to develop Idoc--SOAP Sync Process Scenario Using BPM .
    I have configured every thing using BPM and mapped
    MATMAS----SOAP Request
    SOAP Resp----STATUS.SYSTAT01
    In R/3  the Main Idoc Number(MATMAS) Status needs to be update , but it is creating the new Idoc with STATUS.SYSTAT01.
    I have used STATUS.SYSTAT01 Idoc to Update the status of the Original idoc based on the Response that is coming from webservice .
    I was posted the same thread a days ago and there Bhavesh suggested me some sugessions.
    How can we make the status of the Idoc based on some response Text
    iam unable to follow OR not able to clear my self on this.
    Please suggest me or give some over view kind of thing on this
    Regards

    Hi Suman,
    It is clearly mentioned in SAP help that "SAP Intermediate Documents (IDOCS) are EDI like documents that are asynchronous in nature."
    So Your Scenario is Asynch(receive) - Synch(WS call) -Transformation (Multimapping)- Asynch(Send to R/3).
    now go in this way:
    you can develop all the message Interfaces  of  Abstract catagory (not manditory )
    MI_AA_MATMAS   -> Abstract Asynchronous message    interface for your Matmas IDOC
    MI_AS_SOAP_ReqandResp  -> Abstarct Syncronous MI for SOAP request and response.
    MI_AA_STATUS ->Abstract Asyncronous MI for Status Idoc
    MI_AA_SOAP_Req ->  Abstarct Asyncronous MI for SOAP request .
    MI_AA_SOAP_Res ->  Abstarct Asyncronous MI for SOAP response .
    Thats all in Message interface.
    your first reciever :
    (This will receive the message asynchronously from R/3)
    create a conatainer varaiable (say preceive) and assign it message interface MI_AA_MATMAS
    Now in thw Propert TAB of this step: give this message name.
    Step2: Synchronous call :
    create container Variable psoaprequest and psoapresponse  give abstract message interface MI_AA_SOAP_Req and MI_AA_SOAP_Req  resp.
    Now in thw Propert TAB of this step:
    Synchronous Interface : MI_AS_SOAP_ReqandResp
    Request Message : psoaprequest
    Response Message: psoapresponse
    Transformation Step :
    Here you will specify Interface Mapping that will conatain Multimapping between Synch Response - MATMAs and STATUS
    Let's name it as IM_ResandMatmasToStatus
    create a container variable as pstatus and assign it abstract interface MI_AA_STATUS.
    In Property pan of this step :
    Interface mapping :IM_ResandMatmasToStatus
    Source Message :psoapresponse
                                preceive
    (IT will ask you for two source messages as IM selected in this transformation has 2 source messages)
    Target Message :pstatus
    Send step:
    Select a message as pstatus.
    thats all in IR.
    If have doubt in ID just let me know.
    Thanks
    Sunil Singh

  • Can I copy XML from one RDL file to another

    Hi
    I have created one report, worked on it as a prototype for a project - added datasets , params etc
    I now want to start again - from a template that we have just created - with professional layout, images etc - but want to copy the datasets, parameters from the original prototype to a new report (created from the template).
    Can I just copy sections of the XML from the original RDL file to the new one ?- like the Datasets and parameters sections 
    Regards
    Greg

    Hi,
    Yes, you can.
    If you copy less or more then need you'll see an error.

  • Not able to create XML from an existing relational database

    Hi,
    I am trying to create and xml from an existing relational database. I am not able to get any XML data, I receive "XMLTYPE()" as the result.
    Here's the query -
    SQL> select o.order_id, XMLELEMENT("order", XMLATTRIBUTES(o.order_id as ID)) AS "result" from order_
    info o where order_id=2793;
    ORDER_ID
    result()
    +2793+
    XMLTYPE()
    I was expecting to get +<order id=2793 />+ instead of XMLTYPE().
    I am using -
    SQLPlus: Release 9.0.1.0.1*
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
    I have also run some checks to confirm XML DB installation -
    SQL> select 1 from all_users where username  = 'XDB';
    +1+
    +1+
    SQL> desc RESOURCE_VIEW;
    Name                                      Null?    Type
    RES                                                SYS.XMLTYPE
    ANY_PATH                                           VARCHAR2(4000)
    RESID                                              RAW(16)
    I think, I have something wrong with installation or configuration.
    Any idea about what have I done wrong here?

    Works fine now. Got the result "<order ID="2793"></order>".
    Thanks. :-)

Maybe you are looking for

  • Font Licensing Restriction Issue

    I recently transferred a lot of ttf and otf fonts (originally purchased for and used on a Windows NT machine) to Mac Book Pro. When I try to use the fonts in Abode CS5.5 (In illustrator) I'm told I need a license. Won't let me embed the fonts, for ex

  • RecordSet.getString truncating data ?

    I'm trying to read a MS SQL Server 2000 table as a XML document using the code below. rs.getString always returns a string of maximum length 2033 no matter what the table is. I have tried it with different JDBC drivers with the same result. Any point

  • IH01 Transaction

    Looking for suggestion to modify IH01 variant, Currently we have following variant combination (SAP_TCODE_IH01) Functional location : Required field Valid from : current date Location Hierarchy : Check mark Equipment installed : Uncheck Equipment hie

  • NullPointerException when running jspx page

    Hi All, I get the following error message while trying to run the dashboard.jspx of a deployed application. We are using JDev 11g, Weblogic 10.1.3 and ADF Any one can please help? Thanks, Line 88 of doLogin method in Login.java is String user = Faces

  • Proxy settings for update

    I'm using Multisim 10 Educational in Windows XP. I would update through a proxy but I can set only IP address and port, no way to set username and password. Whithout them proxy don't allow internet connection.