Read datas from a xml node

Hi,
I would read datas from a xml file, in example:
if the xml file is:
<FUNCTION>
<PARAM NAME="x"> 15 </PARAM>
<PARAM NAME="y"> 20 </PARAM>
</FUNCTION>
My program read the value between the xml tags (that is "15" and "20"), but I would read the value "x" and "y", how can I do?
My program is:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder =
factory.newDocumentBuilder();
Document document = builder.parse("xmlFile");
NodeList nl= document.getElementsByTagName("*");
for (int i=0; i<nl.getLength(); i++)
Node n=nl.item(i);
Node lc=n.getChild(...);
System.out.println(lc.getNodeValue());
Please help me

You want to get attribute nodes, which are technically not children of the node they appear in. The following method of Node looks helpful:
NamedNodeMap getAttributes()
A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.

Similar Messages

  • Error in Reading data from a xml file in ESB

    Hi,
    i created a inbound file adapter service which reads data from a xml file and passes it to the routing service and from there updates to the database.....
    (everything created in jdeveloper)
    But i am getting error....it is not getting updated to the database...when i check the database(select * from table) its showing one row selected but i couldnt find the data....
    Transformation mapping also i did...
    i think may be some error in reading the data from the xml file but not so sure.....
    please reply to this mail as soon as possible its very urgent

    Michael R wrote:
    The target table will be created when you execute the interface, if you set the option on the flow tab as instructed in step #6 of the "Setting up ODI Constraint on CLIENT Datastore" Section.
    Option     Value
    CREATE_TARG_TABLE      trueHi Michel,
    This was not my required answer.I am sorry that I was unable to clarify my question.Actually
    +This project executed successfully with some warning.Target Table is automatically created in database and also populated with data.But when I right-click Target Datastore(in >Mapping Tab of the Interface), and then select Data to View Data that needs to be inserted in the target table.I get some error like this:-...+This above line is the result of my project my problem is
    when I right-click Target Datastore(in Mapping Tab of the Interface), and then select Data to View Data that already inserted in the target table.Is not shown by the view data operation.
    I meant to say I am facing this error
    At the10(1010 written) step of
    Creating a New ODI Interface to Perform XML File to RDBMS Table Transformation
    wehre it says
    Open the Interface tab. Select Mapping tab, right-click Target Datastore - CLIENT, and then select Data. View Data inserted in the target table. Close Data Editor. Close the tabs...
    In my case when I use my sqldeveloper I can see data successfully inserted in my target table and also in error table (data that can't satisfy the constraint) .But I was unable to check this by following the above mentioned 10 th step and got this error.
    Thanks

  • EDGE SIMULATOR CAN'T READ DATA FROM SIMULATION.XML

    HI,
    i have installed the SES(10.1.3) and before that Application server 10.1.3 .
    I have followed all the steps given at the following link
    http://www.oracle.com/technology/obe/1013/fusion_middleware/integration/ses/configuringsimulator/configuresimulator.htm#t1
    It works works well till step 16 and edge is restarted successfully , I exit from enterprise manager by logging out and then logging in again for edge
    and then when i click on monitor events then it gives me nothing in the row( no data, no time , no id) just blank row...
    Mean it does not read data from Simulation.xml file
    my file (Simulation.xml) is residing in F:\oracleAS\10.1.3.1\OracleAS_1\j2ee\home\applications\edge\edge\config folder where 'edgerserver.xml' is residing.
    edgeserver.xml contains all driver details i guess.
    Can anyone help me to cope with the problem.
    thanks :-)

    Atlast i have overcome my problem , in order to read data from simulatin.xml file one has to change the "log level" in general settings to monitor and it will work .
    other options for log level are , error , warning, notify and debug etc .
    so change it to log level , then login as enterprise manager, restart edge , log out from emanagaer and again login to edge and click on monitor tab , u r done :-)

  • Reading data from a XML file.

    Hi,
      I am new user to webdynpro and has the task of reading data from XML file.The file is created using XML form Builder and is stored at a location.But my code gives me the path instead of the content in the data.
    The code is :
    try
          IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
           com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
    // create an ep5 user from the retrieved user
           IUser ep5User = WPUMFactory.getUserFactory().getEP5User(sapUser);
           IResourceContext context = new ResourceContext(ep5User);
    /Specify the path of ur document here./
           RID pathRID = RID.getRID("/documents/70f51182-84c3-2710-ce91-8d5fbfde713d.xml");
           //RID pathRID = RID.getRID("/documents/hol.txt");
           wdContext.currentContextElement().setSetDisp(pathRID.toString());
           IResource resource = ResourceFactory.getInstance().getResource(pathRID, context);                       
           InputStream in = resource.getContent().getInputStream();
           ByteArrayOutputStream out = new ByteArrayOutputStream();
           byte[] buffer = new byte[4096];
           int bytesread = 0;
           while ((bytesread = in.read(buffer)) != -1)
               out.write(buffer, 0, bytesread);
           String myData = out.toString();
    /*myFile will containS the content of the document./
           wdContext.currentContextElement().setSetDisp(myData);
           catch (Exception e)
            // wdContext.currentContextElement().setTextdisp("IO Error:" + e.getMessage());
    text data is read from the location but XML data is not read.
    Please help me out.

    hi SriRam,
      For some reasons you are not able to change the value of attribute SetDisp ahich you gave the default value as the path using the following statement
    wdContext.currentContextElement().setSetDisp(myData);
    Remove that line.First try to open the files using creating new window instance
    IWDWindow window =
                wdComponentAPI.getWindowManager().createExternalWindow(
                      "http://<server name>:<port no>/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs"
                            + "/documents/Public Documents/...."
                            + "/"
                            +<name>,
                      "from km repository",
                      false);
          window.open();
    Then we can be sure that the error is due to reading data using input stream
    Regards
    Rohit

  • How to Read data from a xml?

    Dear All,
    My Xml file has the following attributes,
    <UserLogSettings>
    <LogLaserActions>False</LogLaserActions>
    <LogAlways>True</LogAlways>
    <Current>True</Current>
    <Frequency>True</Frequency>
    <Shg>True</Shg>
    <Thg>True</Thg>
    <Temperature>True</Temperature>
    <LogFromDate>1/01/0001 12:00:00 AM</LogFromDate>
    <LogToDate>1/01/0001 12:00:00 AM</LogToDate>
    <ErrorLoggerSize>2</ErrorLoggerSize>
    <Seed>True</Seed>
     </UserLogSettings> 
    I want to read the above xml file and display each attribute separately, How can I do this?
    Gaya 

    Hi Gaya,
    you could read the text file and parse for the different XML tags. This has been asked before so you should find thread discussing the parsing part...
    Or you could dig into OpenG, they provide some powerful XML functions too...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • LPX-00601: Invalid token in: err while trying to read data from xml

    Hey ,
    While trying to read data from xml i got err:
    LPX-00601: Invalid token in: 'path'
    the proc. i'm using to read data from the xml is:
    procedure read_xml_file_test (in_filename in varchar2)
    is
    my_dir  varchar2(20) := 'XML_DIR;
      cur_emp2 number:=0;
      l_bfile   BFILE;
      l_clob    CLOB;
      l_parser  dbms_xmlparser.Parser;
      l_doc     dbms_xmldom.DOMDocument;
      l_nl      dbms_xmldom.DOMNodeList;
      l_nl2    dbms_xmldom.DOMNodeList;
      l_n       dbms_xmldom.DOMNode; 
      l_n2     dbms_xmldom.DOMNode;
      l_temp    VARCHAR2(1000);
    v_errors        internet_clients.errors%type; 
    src_csid       NUMBER := NLS_CHARSET_ID('UTF8'); 
    dest_offset    INTEGER := 1;
    src_offset     INTEGER := 1;
    lang_context   INTEGER := dbms_lob.default_lang_ctx;
    warning        INTEGER;
    v_count       number := 0;   --total records
    v_count_s      number := 0;   -- sucsess record
    v_count_f      number := 0;   -- failed record
    v_flag varchar2(1);
    v_char2 varchar2(1);
    v_l1 VARCHAR2(255);
    v_l2 VARCHAR2(255);
    v_l3 VARCHAR2(255);
    v_l4 VARCHAR2(255);
    v_l6 VARCHAR2(255);
    BEGIN
      l_bfile := BFileName(my_dir, in_filename);
      dbms_lob.createtemporary(l_clob, cache=>FALSE);
      dbms_lob.open(l_bfile, dbms_lob.lob_readonly);
      dbms_lob.loadclobfromfile(l_clob, l_bfile, dbms_lob.getlength(l_bfile), dest_offset,src_offset, src_csid, lang_context, warning);                        
      dbms_lob.close(l_bfile);
      -- make sure implicit date conversions are performed correctly
      dbms_session.set_nls('NLS_DATE_FORMAT','''DD/MM/RR HH24:MI:SS''');   
      -- Create a parser.
      l_parser := dbms_xmlparser.newParser;
      -- Parse the document and create a new DOM document.
        dbms_xmlparser.parseClob(l_parser, l_clob);
        l_doc := dbms_xmlparser.getDocument(l_parser);
      -- Free resources associated with the CLOB and Parser now they are no longer needed.
      dbms_lob.freetemporary(l_clob);
      dbms_xmlparser.freeParser(l_parser);  
      -- Get a list of all the  nodes in the document using the XPATH syntax.
      l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'soap:Envelope/soap:Body/GetFieldsNameResponse/GetFieldsNameResult/diffgr:diffgram/DataSet_FRM_GANERIC_PROP/FRM_GANERIC_PROP');
      -- Loop through the list and create a new record in a tble collection
      -- for each  record.
      FOR cur_emp IN 0 .. dbms_xmldom.getLength(l_nl) - 1 LOOP
       l_n := dbms_xmldom.item(l_nl, cur_emp);
       cur_emp2:=0;
       loop
         v_count := v_count + 1;
         begin
        -- Use XPATH syntax to assign values to he elements of the collection.
        dbms_xslprocessor.valueOf(l_n,'L1/text()',v_l1);
        dbms_xslprocessor.valueOf(l_n,'L2/text()',v_l2);
        dbms_xslprocessor.valueOf(l_n,'L3/text()',v_l3);
        dbms_xslprocessor.valueOf(l_n,'L4/text()',v_l4);
        dbms_xslprocessor.valueOf(l_n,'L6/text()',v_l6);
            exception
      when others then 
      null;
      end;
    exit when cur_emp2=dbms_xmldom.getLength(l_nl2);
      END LOOP;
      end loop;
      -- Free any resources associated with the document now it
      -- is no longer needed.
      dbms_xmldom.freeDocument(l_doc);
      --remove file to another directory   
          --COMMIT;  -- do not use the commit if you want to run this proc. from within the search_dir_list proc , because it execute a select from tmp table dir_list which contain a "on commit delete rows"  clause.    
      /*EXCEPTION
      /*WHEN OTHERS THEN
       dbms_lob.freetemporary(l_clob);
        dbms_xmlparser.freeParser(l_parser);
       dbms_xmldom.freeDocument(l_doc);
        null;
        ROLLBACK; */
    END;While trying to execute this i got:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in: 'soap:Envelope/soap:Body/GetFieldsNameResponse/GetFieldsNameResult/diffgr:diffgram/DataSet_FRM_GANERIC_PROP/FRM_GANERIC_PROP'
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 939
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 967
    ORA-06512: at "MARKET.READ_XML_FILE_TEST", line 51
    ORA-06512: at line 1
    i guess i mised somthing at the line
    l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'soap:Envelope/soap:Body/GetFieldsNameResponse/GetFieldsNameResult/diffgr:diffgram/DataSet_FRM_GANERIC_PROP/FRM_GANERIC_PROP');i attached here part of my xml:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <soap:Body>
    - <GetFieldsNameResponse xmlns="http://tempuri.org/">
    - <GetFieldsNameResult>
    - <xs:schema id="DataSet_FRM_GANERIC_PROP" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    - <xs:element name="DataSet_FRM_GANERIC_PROP" msdata:IsDataSet="true" msdata:Locale="he-IL">
    - <xs:complexType>
    - <xs:choice minOccurs="0" maxOccurs="unbounded">
    - <xs:element name="FRM_GANERIC_PROP">
    - <xs:complexType>
    - <xs:sequence>
      </xs:sequence>
      </xs:complexType>
      </xs:element>
      </xs:choice>
      </xs:complexType>
      </xs:element>
      </xs:schema>
    - <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
    - <DataSet_FRM_GANERIC_PROP xmlns="">
    - <FRM_GANERIC_PROP diffgr:id="FRM_GANERIC_PROP1" msdata:rowOrder="0">
      <L1>val1</L1>
      <L2>val2</L2>
      <L3>val3</L3>
      <L4>val4</L4>
      <L6>val6</L6>
      </FRM_GANERIC_PROP>
      </DataSet_FRM_GANERIC_PROP>
      </diffgr:diffgram>
      </GetFieldsNameResult>
      </GetFieldsNameResponse>
      </soap:Body>
      </soap:Envelope>I Guess it somthing that have to do with node definition ,
    but i have tried so many combinations and none ot those worked for me.
    i'm deeply stuck here.
    What do i miss here?
    THANKS yair
    Edited by: yair_k on 02:30 14/10/2010

    Hey , after got a lot of success with the xml reading part , i wonder if you
    can help me with a problem while trying to reading that xml from a web service.
    i use a procedure as followes:
    FUNCTION read_from_web_service(in_username in varchar2 , in_password in varchar2)
      RETURN CHAR
    AS
      l_service          UTL_DBWS.service;
      l_call             UTL_DBWS.call;
      l_a_ns                     VARCHAR2(32767);
      l_wsdl_url         VARCHAR2(32767);
      l_namespace        VARCHAR2(32767);
      l_service_qname    UTL_DBWS.qname;
      l_port_qname       UTL_DBWS.qname;
      l_operation_qname  UTL_DBWS.qname;
      l_xmltype_in       SYS.XMLTYPE;
      l_xmltype_out      SYS.XMLTYPE;
      l_return           VARCHAR2(32767);
    BEGIN
      l_wsdl_url        := 'http://www.company.com/publisherService/ServiceGetpublisherTable.asmx?wsdl';
      l_namespace       := 'http://tempuri.org/';
      l_service_qname   := UTL_DBWS.to_qname(l_namespace, 'ServiceGetpublisherTable');
      l_port_qname      := UTL_DBWS.to_qname(l_namespace, 'ServiceGetpublisherTableSoap');
      l_operation_qname := UTL_DBWS.to_qname(l_namespace, 'GetFieldsName');
      l_service := UTL_DBWS.create_service (
        wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
        service_name           => l_service_qname);
      l_call := UTL_DBWS.create_call (
        service_handle => l_service,
        port_name      => l_port_qname,
        operation_name => l_operation_qname);
      l_xmltype_in := SYS.XMLTYPE('<?xml version="1.0" encoding="utf-8"?>
        <GetFieldsName xmlns="' || l_namespace || '">
        <user>' || in_username || '</user>
        <password>'|| in_password || '</password>
        </GetFieldsName>');
      l_xmltype_out := UTL_DBWS.invoke(call_Handle => l_call,
                                       request     => l_xmltype_in);
      UTL_DBWS.release_call (call_handle => l_call);
      UTL_DBWS.release_service (service_handle => l_service);
      l_return := l_xmltype_out.extract('//GetFieldsName/text()').getstringVal();
       dbms_output.put_line(l_return);     
      RETURN l_return;
    END;but when i run it i got message:
    ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException: Server did not recognize the value of HTTP Header SOAPAction: .
    regarding the line:
    l_xmltype_out := UTL_DBWS.invoke(call_Handle => l_call,
    request => l_xmltype_in);
    So , i deeply stuck here!
    my web service description is:
      <?xml version="1.0" encoding="utf-8" ?>
    - <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    - <wsdl:types>
    - <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
    - <s:element name="GetFieldsName">
    - <s:complexType>
    - <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="user" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
      </s:sequence>
      </s:complexType>
      </s:element>
    - <s:element name="GetFieldsNameResponse">
    - <s:complexType>
    - <s:sequence>
    - <s:element minOccurs="0" maxOccurs="1" name="GetFieldsNameResult">
    - <s:complexType>
    - <s:sequence>
      <s:element ref="s:schema" />
      <s:any />
      </s:sequence>
      </s:complexType>
      </s:element>
      </s:sequence>
      </s:complexType>
      </s:element>
    - <s:element name="GetMSG_ByUser_Not_Readed">
    - <s:complexType>
    - <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="user" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
      </s:sequence>
      </s:complexType>
      </s:element>
    - <s:element name="GetMSG_ByUser_Not_ReadedResponse">
    - <s:complexType>
    - <s:sequence>
    - <s:element minOccurs="0" maxOccurs="1" name="GetMSG_ByUser_Not_ReadedResult">
    - <s:complexType>
    - <s:sequence>
      <s:element ref="s:schema" />
      <s:any />
      </s:sequence>
      </s:complexType>
      </s:element>
      </s:sequence>
      </s:complexType>
      </s:element>
    - <s:element name="SetMSG_ByUser_Not_Readed_As_Readed">
    - <s:complexType>
    - <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="user" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="Rec_Id" type="s:string" />
      </s:sequence>
      </s:complexType>
      </s:element>
    - <s:element name="SetMSG_ByUser_Not_Readed_As_ReadedResponse">
    - <s:complexType>
    - <s:sequence>
      <s:element minOccurs="1" maxOccurs="1" name="SetMSG_ByUser_Not_Readed_As_ReadedResult" type="s:boolean" />
      </s:sequence>
      </s:complexType>
      </s:element>
      </s:schema>
      </wsdl:types>
    - <wsdl:message name="GetFieldsNameSoapIn">
      <wsdl:part name="parameters" element="tns:GetFieldsName" />
      </wsdl:message>
    - <wsdl:message name="GetFieldsNameSoapOut">
      <wsdl:part name="parameters" element="tns:GetFieldsNameResponse" />
      </wsdl:message>
    - <wsdl:message name="GetMSG_ByUser_Not_ReadedSoapIn">
      <wsdl:part name="parameters" element="tns:GetMSG_ByUser_Not_Readed" />
      </wsdl:message>
    - <wsdl:message name="GetMSG_ByUser_Not_ReadedSoapOut">
      <wsdl:part name="parameters" element="tns:GetMSG_ByUser_Not_ReadedResponse" />
      </wsdl:message>
    - <wsdl:message name="SetMSG_ByUser_Not_Readed_As_ReadedSoapIn">
      <wsdl:part name="parameters" element="tns:SetMSG_ByUser_Not_Readed_As_Readed" />
      </wsdl:message>
    - <wsdl:message name="SetMSG_ByUser_Not_Readed_As_ReadedSoapOut">
      <wsdl:part name="parameters" element="tns:SetMSG_ByUser_Not_Readed_As_ReadedResponse" />
      </wsdl:message>
    - <wsdl:portType name="ServiceGetpublisherTableSoap">
    - <wsdl:operation name="GetFieldsName">
      <wsdl:input message="tns:GetFieldsNameSoapIn" />
      <wsdl:output message="tns:GetFieldsNameSoapOut" />
      </wsdl:operation>
    - <wsdl:operation name="GetMSG_ByUser_Not_Readed">
      <wsdl:input message="tns:GetMSG_ByUser_Not_ReadedSoapIn" />
      <wsdl:output message="tns:GetMSG_ByUser_Not_ReadedSoapOut" />
      </wsdl:operation>
    - <wsdl:operation name="SetMSG_ByUser_Not_Readed_As_Readed">
      <wsdl:input message="tns:SetMSG_ByUser_Not_Readed_As_ReadedSoapIn" />
      <wsdl:output message="tns:SetMSG_ByUser_Not_Readed_As_ReadedSoapOut" />
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="ServiceGetpublisherTableSoap" type="tns:ServiceGetpublisherTableSoap">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="GetFieldsName">
      <soap:operation soapAction="http://tempuri.org/GetFieldsName" style="document" />
    - <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="GetMSG_ByUser_Not_Readed">
      <soap:operation soapAction="http://tempuri.org/GetMSG_ByUser_Not_Readed" style="document" />
    - <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="SetMSG_ByUser_Not_Readed_As_Readed">
      <soap:operation soapAction="http://tempuri.org/SetMSG_ByUser_Not_Readed_As_Readed" style="document" />
    - <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:binding name="ServiceGetpublisherTableSoap12" type="tns:ServiceGetpublisherTableSoap">
      <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="GetFieldsName">
      <soap12:operation soapAction="http://tempuri.org/GetFieldsName" style="document" />
    - <wsdl:input>
      <soap12:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap12:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="GetMSG_ByUser_Not_Readed">
      <soap12:operation soapAction="http://tempuri.org/GetMSG_ByUser_Not_Readed" style="document" />
    - <wsdl:input>
      <soap12:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap12:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="SetMSG_ByUser_Not_Readed_As_Readed">
      <soap12:operation soapAction="http://tempuri.org/SetMSG_ByUser_Not_Readed_As_Readed" style="document" />
    - <wsdl:input>
      <soap12:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap12:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="ServiceGetpublisherTable">
    - <wsdl:port name="ServiceGetpublisherTableSoap" binding="tns:ServiceGetpublisherTableSoap">
      <soap:address location="http://www.company.com/publisherService/ServiceGetpublisherTable.asmx" />
      </wsdl:port>
    - <wsdl:port name="ServiceGetpublisherTableSoap12" binding="tns:ServiceGetpublisherTableSoap12">
      <soap12:address location="http://www.company.com/publisherService/ServiceGetpublisherTable.asmx" />
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>also i have to mention that i have changed publisher references inside the code , and i also canot
    supply username and password , so i guess you canot test it. still i not shure if my definitions (namespace est.) inside my code defined correctly.
    hope you can help me with this.
    regards
    yair

  • Reading data from XML

    Hello!
    I want my program to read data from external XML file. I know
    that Flash has an XML class, but I just don't get the way it
    reads and writes data from/to it.
    I have a following XML file (a part of it):
    <?xml version="1.0"?>
    <configuration>
    <soundvolume>66</soundvolume>
    </configuration>
    I have created an XML class:
    xml_data = new XML();
    xml_data.load("config.xml");
    How to make Flash read this value of 66 and add it to some
    variable?
    By logic, it would seem to be:
    _global.volume =
    xml_data.configuration.soundvolume.nodeValue();
    But it's not.
    Also, what are commands for writing data to an XML files.
    Help...
    Thanks in advance.

    Hi!
    Flash can't write to an xml file (or write anything at all
    for that matter)
    on its own. You'd need some serverside script to do that
    (.php, .asp, etc).
    As for the processing of the xml file, you might want to read
    up a bit in
    the help documentation under the xml class. To handle the
    different nodes in
    an xml file you use childNode
    , firstChild and such. Attributes in an xml
    file can be reached with
    childNode.attributes.{attributename} (without
    the {} brackets).
    Below is an example copy/paste of a processig code I've got.
    function processXML(XMLObj:XML):Void {
    var thisClass = this;
    thisClass.RawData = XMLObj;
    thisClass.Data = new Object();
    var node = thisClass.RawData.firstChild;
    for (var i = 0; i < node.childNodes.length; i++) {
    thisClass.Data[node.childNodes
    .nodeName] =
    node.childNodes.childNodes[0].nodeValue;
    If you run this on your xml file then you should end up with:
    this.Data[soundvolume] == 66.
    /Jensen/
    "Kolja1987" <[email protected]> wrote in
    message
    news:egu92e$r0f$[email protected]..
    > Hello!
    >
    > I want my program to read data from external XML file. I
    know that Flash
    > has
    > an XML class, but I just don't get the way it
    >
    > reads and writes data from/to it.
    >
    > I have a following XML file (a part of it):
    >
    > <?xml version="1.0"?>
    > <configuration>
    > <soundvolume>66</soundvolume>
    > </configuration>
    >
    > I have created an XML class:
    >
    > xml_data = new XML();
    > xml_data.load("config.xml");
    >
    > How to make Flash read this value of 66 and add it to
    some variable?
    >
    > By logic, it would seem to be:
    >
    > _global.volume =
    xml_data.configuration.soundvolume.nodeValue();
    >
    > But it's not.
    >
    > Also, what are commands for writing data to an XML
    files.
    >
    > Help...
    >
    > Thanks in advance.
    >

  • Reading data From XML file and setting into ViewObject to Pouplate ADF UI

    Hi,
    I have following requirement.
    I would like to read data from XML file and populate the data in ViewObject so that the data can be displayed in the ADF UI.
    Also when user modifies the data in the ADF UI, it should be modified back into to ViewObject.
    Here is an example - XML file contains Book Title and Author. I would like to read Book Title and Author from XML file and set it into ViewObject Attribute and then display Book title and Author in ADF UI page. Also when user modifies Book title and Author, I would like to store it back in View Object.
    Please help me with this requirement and let me know if any solution exist in ADF, for populating the ADF UI screen fields with external XML file data.
    Thanks

    Read chapter 42 http://download.oracle.com/docs/cd/E16162_01/web.1112/e16182/bcadvvo.htm of the fusion developer guide
    Section 42.7, "Reading and Writing XML"
    Section 42.8, "Using Programmatic View Objects for Alternative Data Sources"
    Timo

  • Read data From XML

    hi
    I am new to XML.I want to read data from XML input ....For test purpose i have writte following
    procedure , but when i print output value it shows ...NO ROWS SELECTED
    Actually i want to read [ trd_relate ] value from following XML Input
    '<ROOT><TRD trd_relate = "somevalue" trd_mainid = "152" trd_rate = "0.0000"/></ROOT>'
    plese help me to solve this problem.
    Thanks
    create or replace procedure xml_test1(p_xml clob,rc1 in out mypkg.rc)
    as
    aaa xmltype;
    begin
    aaa :=xmltype(p_xml);
    open rc1 for
    SELECT extractValue(aaa, '/ROOT/TRD/trd_mainid') SOME_NAME
    FROM table(XMLSequence(extract(aaa, '/ROOT/TRD/trd_mainid'))) ResultSet;
    end xml_test1;
    var a refcursor;
    exec xml_test1('<ROOT><TRD trd_relate = "" trd_mainid = "152" trd_rate = "0.0000"/></ROOT>',:a);
    print a;
    **************************************

    Hi,
    try this:
    1 create or replace function test(xml xmltype, qry varchar2) return varchar2 is
    2 xx varchar2(100);
    3 begin
    4 select extractValue(xml, qry)
    5 into xx
    6 from dual;
    7 return xx;
    8* end;
    SQL> /
    Function created.
    SQL> variable out varchar2(100)
    SQL> exec :out := test(xmltype('<ROOT><TRD trd_relate = "somevalue" trd_mainid = "152" trd_rate = "0.0000"/></ROOT>'), '/ROOT/TRD/@trd_relate');
    SQL> print out
    OUT
    somevalue
    Bartek

  • Error when reading data from XML using JAXB?

    Hi all,
    I get the error message when reading data from XML using JAXB.
    [org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.]
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException
    (AbstractUnmarshallerImpl.java:315)
         at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:481)
         at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:199)
         at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:168)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:142)
    I don't find the reason, please help!
    Thanks in advance!

    The problem is sovled.

  • Read data from XML file

    I have column (CLOB data type) with XML data in it. How to read data from that column and insert into myTable? This XML represent one report divided by Location. Every location has analytic data and total at the end.
    How to get something like this:
    bilbo bagins Total BBB (tran: 6) 12.00 13.00 14.10
    bilbo bagins Total EEE (tran: 2) 12.50 44.59 72.52
    bilbo bagins Total bilbo bagins (tran: 8) 34.89 17.85
    Data in CLOB column:
    <?xml version="1.0" encoding="UTF-8" ?>
    <CrystalReport xmlns="urn:crystal-reports:schemas:report-detail" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:crystal-reports:schemas:report-detail http://www.businessobjects.com/products/xml/CR2008Schema.xsd">
    <ReportHeader>
    <Section SectionNumber="0">
    </Section>
    </ReportHeader>
    <Group Level="1">
    <GroupHeader>
    <Section SectionNumber="0">
    <Field Name="GroupNameLocation1" FieldName="GroupName ({SubAgentSettlement.Location})"><FormattedValue>bilbo bagins</FormattedValue><Value>bilbo bagins</Value></Field>
    </Section>
    </GroupHeader>
    <Group Level="2">
    <GroupHeader>
    <Section SectionNumber="0">
    </Section>
    </GroupHeader>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="GroupFooterText1" FieldName="{@GroupFooterText}"><FormattedValue>Total BBB (tran: 6)</FormattedValue><Value>Total BBB (tran: 6)</Value></Field>
    <Field Name="SumofCommission1" FieldName="Sum ({SubAgentSettlement.Commission}, {SubAgentSettlement.Currency})"><FormattedValue>12.00</FormattedValue><Value>12.00</Value></Field>
    <Field Name="SumofCommissionBbb1" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Currency})"><FormattedValue>13.00</FormattedValue><Value>13.00</Value></Field>
    <Field Name="SumofCommissionEee1" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Currency})"><FormattedValue>14.10</FormattedValue><Value>14.10</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <Group Level="2">
    <GroupHeader>
    <Section SectionNumber="0">
    </Section>
    </GroupHeader>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="GroupFooterText1" FieldName="{@GroupFooterText}"><FormattedValue>Total EEE (tran: 2)</FormattedValue><Value>Total EEE (tran: 2)</Value></Field>
    <Field Name="SumofCommission1" FieldName="Sum ({SubAgentSettlement.Commission}, {SubAgentSettlement.Currency})"><FormattedValue>12.50</FormattedValue><Value>12.50</Value></Field>
    <Field Name="SumofCommissionBbb1" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Currency})"><FormattedValue>44.59</FormattedValue><Value>44.59</Value></Field>
    <Field Name="SumofCommissionEee1" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Currency})"><FormattedValue>72.52</FormattedValue><Value>72.52</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="LocationGroupFooterText1" FieldName="{@LocationGroupFooterText}"><FormattedValue>Total bilbo bagins (tran: 8)</FormattedValue><Value>Total bilbo bagins (tran: 8)</Value></Field>
    <Field Name="SumofCommissionBbb2" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Location})"><FormattedValue>34.89</FormattedValue><Value>34.89</Value></Field>
    <Field Name="SumofCommissionEee2" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Location})"><FormattedValue>17.85</FormattedValue><Value>17.85</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <Group Level="1">
    <GroupHeader>
    <Section SectionNumber="0">
    <Field Name="GroupNameLocation1" FieldName="GroupName ({SubAgentSettlement.Location})"><FormattedValue>Bruce Lee</FormattedValue><Value>Bruce Lee</Value></Field>
    </Section>
    </GroupHeader>
    <Group Level="2">
    <GroupHeader>
    <Section SectionNumber="0">
    </Section>
    </GroupHeader>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="GroupFooterText1" FieldName="{@GroupFooterText}"><FormattedValue>Total BBB (tran: 5)</FormattedValue><Value>Total BBB (tran: 5)</Value></Field>
    <Field Name="SumofCommission1" FieldName="Sum ({SubAgentSettlement.Commission}, {SubAgentSettlement.Currency})"><FormattedValue>18.11</FormattedValue><Value>18.11</Value></Field>
    <Field Name="SumofCommissionBbb1" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Currency})"><FormattedValue>3.24</FormattedValue><Value>3.24</Value></Field>
    <Field Name="SumofCommissionEee1" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Currency})"><FormattedValue>1.33</FormattedValue><Value>1.33</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <Group Level="2">
    <GroupHeader>
    <Section SectionNumber="0">
    </Section>
    </GroupHeader>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="GroupFooterText1" FieldName="{@GroupFooterText}"><FormattedValue>Total EEE (tran: 8)</FormattedValue><Value>Total EEE (tran: 8)</Value></Field>
    <Field Name="SumofCommission1" FieldName="Sum ({SubAgentSettlement.Commission}, {SubAgentSettlement.Currency})"><FormattedValue>10.17</FormattedValue><Value>10.17</Value></Field>
    <Field Name="SumofCommissionBbb1" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Currency})"><FormattedValue>7.62</FormattedValue><Value>7.62</Value></Field>
    <Field Name="SumofCommissionEee1" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Currency})"><FormattedValue>1.53</FormattedValue><Value>1.53</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <Group Level="2">
    <GroupHeader>
    <Section SectionNumber="0">
    </Section>
    </GroupHeader>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="GroupFooterText1" FieldName="{@GroupFooterText}"><FormattedValue>Total UUU (transactions: 7)</FormattedValue><Value>Total UUU (transactions: 7)</Value></Field>
    <Field Name="SumofCommission1" FieldName="Sum ({SubAgentSettlement.Commission}, {SubAgentSettlement.Currency})"><FormattedValue>2.01</FormattedValue><Value>2.01</Value></Field>
    <Field Name="SumofCommissionBbb1" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Currency})"><FormattedValue>3.71</FormattedValue><Value>3.71</Value></Field>
    <Field Name="SumofCommissionEee1" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Currency})"><FormattedValue>2.58</FormattedValue><Value>2.58</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="LocationGroupFooterText1" FieldName="{@LocationGroupFooterText}"><FormattedValue>Total Bruce Lee (tran: 60)</FormattedValue><Value>Total Bruce Lee (tran: 60)</Value></Field>
    <Field Name="SumofCommissionBbb2" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Location})"><FormattedValue>99.74</FormattedValue><Value>99.74</Value></Field>
    <Field Name="SumofCommissionEee2" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Location})"><FormattedValue>55.81</FormattedValue><Value>55.81</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <Group Level="1">
    <GroupHeader>
    <Section SectionNumber="0">
    <Field Name="GroupNameLocation1" FieldName="GroupName ({SubAgentSettlement.Location})"><FormattedValue>Katar pipin</FormattedValue><Value>Katar pipin</Value></Field>
    </Section>
    </GroupHeader>
    <Group Level="2">
    <GroupHeader>
    <Section SectionNumber="0">
    </Section>
    </GroupHeader>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="GroupFooterText1" FieldName="{@GroupFooterText}"><FormattedValue>Total BBB (tran: 5)</FormattedValue><Value>Total BBB (tran: 5)</Value></Field>
    <Field Name="SumofCommission1" FieldName="Sum ({SubAgentSettlement.Commission}, {SubAgentSettlement.Currency})"><FormattedValue>7.00</FormattedValue><Value>7.00</Value></Field>
    <Field Name="SumofCommissionBbb1" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Currency})"><FormattedValue>7.00</FormattedValue><Value>7.00</Value></Field>
    <Field Name="SumofCommissionEee1" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Currency})"><FormattedValue>3.82</FormattedValue><Value>3.82</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <Group Level="2">
    <GroupHeader>
    <Section SectionNumber="0">
    </Section>
    </GroupHeader>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="GroupFooterText1" FieldName="{@GroupFooterText}"><FormattedValue>Total EEE (tran: 3)</FormattedValue><Value>Total EEE (tran: 3)</Value></Field>
    <Field Name="SumofCommission1" FieldName="Sum ({SubAgentSettlement.Commission}, {SubAgentSettlement.Currency})"><FormattedValue>65.50</FormattedValue><Value>65.50</Value></Field>
    <Field Name="SumofCommissionBbb1" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Currency})"><FormattedValue>1.75</FormattedValue><Value>1.75</Value></Field>
    <Field Name="SumofCommissionEee1" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Currency})"><FormattedValue>55.50</FormattedValue><Value>55.50</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <Group Level="2">
    <GroupHeader>
    <Section SectionNumber="0">
    </Section>
    </GroupHeader>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="GroupFooterText1" FieldName="{@GroupFooterText}"><FormattedValue>Total UUU (tran: 1)</FormattedValue><Value>Total UUU (tran: 1)</Value></Field>
    <Field Name="SumofCommission1" FieldName="Sum ({SubAgentSettlement.Commission}, {SubAgentSettlement.Currency})"><FormattedValue>1.00</FormattedValue><Value>1.00</Value></Field>
    <Field Name="SumofCommissionBbb1" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Currency})"><FormattedValue>17.35</FormattedValue><Value>17.35</Value></Field>
    <Field Name="SumofCommissionEee1" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Currency})"><FormattedValue>10.69</FormattedValue><Value>10.69</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="LocationGroupFooterText1" FieldName="{@LocationGroupFooterText}"><FormattedValue>Total Katar pipin (tran: 9)</FormattedValue><Value>Total Katar pipin (tran: 9)</Value></Field>
    <Field Name="SumofCommissionBbb2" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Location})"><FormattedValue>9.10</FormattedValue><Value>9.10</Value></Field>
    <Field Name="SumofCommissionEee2" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Location})"><FormattedValue>2.01</FormattedValue><Value>2.01</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <Group Level="1">
    <GroupHeader>
    <Section SectionNumber="0">
    <Field Name="GroupNameLocation1" FieldName="GroupName ({SubAgentSettlement.Location})"><FormattedValue>Samsung</FormattedValue><Value>Samsung</Value></Field>
    </Section>
    </GroupHeader>
    <Group Level="2">
    <GroupHeader>
    <Section SectionNumber="0">
    </Section>
    </GroupHeader>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="GroupFooterText1" FieldName="{@GroupFooterText}"><FormattedValue>Total BBB (tran: 5)</FormattedValue><Value>Total BBB (tran: 5)</Value></Field>
    <Field Name="SumofCommission1" FieldName="Sum ({SubAgentSettlement.Commission}, {SubAgentSettlement.Currency})"><FormattedValue>16.00</FormattedValue><Value>16.00</Value></Field>
    <Field Name="SumofCommissionBbb1" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Currency})"><FormattedValue>17.00</FormattedValue><Value>17.00</Value></Field>
    <Field Name="SumofCommissionEee1" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Currency})"><FormattedValue>17.46</FormattedValue><Value>17.46</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="LocationGroupFooterText1" FieldName="{@LocationGroupFooterText}"><FormattedValue>Total Samsung (tran: 15)</FormattedValue><Value>Total Samsung (tran: 5)</Value></Field>
    <Field Name="SumofCommissionBbb2" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Location})"><FormattedValue>5.00</FormattedValue><Value>5.00</Value></Field>
    <Field Name="SumofCommissionEee2" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Location})"><FormattedValue>17.46</FormattedValue><Value>17.46</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <Group Level="1">
    <GroupHeader>
    <Section SectionNumber="0">
    <Field Name="GroupNameLocation1" FieldName="GroupName ({SubAgentSettlement.Location})"><FormattedValue>Erica</FormattedValue><Value>Erica</Value></Field>
    </Section>
    </GroupHeader>
    <Group Level="2">
    <GroupHeader>
    <Section SectionNumber="0">
    </Section>
    </GroupHeader>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="GroupFooterText1" FieldName="{@GroupFooterText}"><FormattedValue>Total BBB (tran: 5)</FormattedValue><Value>Total BBB (tran: 5)</Value></Field>
    <Field Name="SumofCommission1" FieldName="Sum ({SubAgentSettlement.Commission}, {SubAgentSettlement.Currency})"><FormattedValue>6.10</FormattedValue><Value>6.10</Value></Field>
    <Field Name="SumofCommissionBbb1" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Currency})"><FormattedValue>6.12</FormattedValue><Value>6.12</Value></Field>
    <Field Name="SumofCommissionEee1" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Currency})"><FormattedValue>88.08</FormattedValue><Value>88.08</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <Group Level="2">
    <GroupHeader>
    <Section SectionNumber="0">
    </Section>
    </GroupHeader>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="GroupFooterText1" FieldName="{@GroupFooterText}"><FormattedValue>Total EEE (tran: 2)</FormattedValue><Value>Total EEE (tran: 2)</Value></Field>
    <Field Name="SumofCommission1" FieldName="Sum ({SubAgentSettlement.Commission}, {SubAgentSettlement.Currency})"><FormattedValue>13.00</FormattedValue><Value>13.00</Value></Field>
    <Field Name="SumofCommissionBbb1" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Currency})"><FormattedValue>15.87</FormattedValue><Value>15.87</Value></Field>
    <Field Name="SumofCommissionEee1" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Currency})"><FormattedValue>13.00</FormattedValue><Value>13.00</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <Group Level="2">
    <GroupHeader>
    <Section SectionNumber="0">
    </Section>
    </GroupHeader>
    <Details Level="3">
    <Section SectionNumber="0">
    </Section>
    </Details>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="GroupFooterText1" FieldName="{@GroupFooterText}"><FormattedValue>Total UUU (transactions: 1)</FormattedValue><Value>Total UUU (transactions: 1)</Value></Field>
    <Field Name="SumofCommission1" FieldName="Sum ({SubAgentSettlement.Commission}, {SubAgentSettlement.Currency})"><FormattedValue>22.00</FormattedValue><Value>22.00</Value></Field>
    <Field Name="SumofCommissionBbb1" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Currency})"><FormattedValue>32.70</FormattedValue><Value>32.70</Value></Field>
    <Field Name="SumofCommissionEee1" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Currency})"><FormattedValue>41.38</FormattedValue><Value>41.38</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <GroupFooter>
    <Section SectionNumber="0">
    <Field Name="LocationGroupFooterText1" FieldName="{@LocationGroupFooterText}"><FormattedValue>Total Erica (tran: 8)</FormattedValue><Value>Total Erica (tran: 8)</Value></Field>
    <Field Name="SumofCommissionBbb2" FieldName="Sum ({SubAgentSettlement.CommissionBBB}, {SubAgentSettlement.Location})"><FormattedValue>4.87</FormattedValue><Value>4.87</Value></Field>
    <Field Name="SumofCommissionEee2" FieldName="Sum ({SubAgentSettlement.CommissionEEE}, {SubAgentSettlement.Location})"><FormattedValue>2.66</FormattedValue><Value>2.66</Value></Field>
    </Section>
    </GroupFooter>
    </Group>
    <ReportFooter>
    <Section SectionNumber="0">
    <Text Name="Text11"><TextValue>Total num of tran:</TextValue>
    </Text>
    <Field Name="CountofDate1" FieldName="Count ({SubAgentSettlement.Date})"><FormattedValue>126</FormattedValue><Value>126</Value></Field>
    <Field Name="CurrencyRateLine1" FieldName="{@CurrencyRateLine}"><FormattedValue>Curr on date: 12/03/2009</FormattedValue><Value>Curr on date: 12/03/2009</Value></Field>
    <Subreport Name="Subreport1">
    <ReportHeader>
    </ReportHeader>
    <Details Level="1">
    <Section SectionNumber="0">
    <Field Name="CurrencyLine1" FieldName="{@CurrencyLine}"><FormattedValue>1 EEE = 10.12345 UUU</FormattedValue><Value>1 EEE = 10.12345 UUU</Value></Field>
    </Section>
    </Details>
    <Details Level="1">
    <Section SectionNumber="0">
    <Field Name="CurrencyLine1" FieldName="{@CurrencyLine}"><FormattedValue>1 EEE = 7.12345 BBB</FormattedValue><Value>1 EEE = 7.12345 BBB</Value></Field>
    </Section>
    </Details>
    <Details Level="1">
    <Section SectionNumber="0">
    <Field Name="CurrencyLine1" FieldName="{@CurrencyLine}"><FormattedValue>1 UUU = 6.12345 BBB</FormattedValue><Value>1 UUU = 6.123456 BBB</Value></Field>
    </Section>
    </Details>
    <ReportFooter>
    <Section SectionNumber="0">
    </Section>
    </ReportFooter>
    </Subreport>
    </Section>
    <Section SectionNumber="1">
    </Section>
    </ReportFooter>
    </CrystalReport>

    Here's a starter :
    SQL> SELECT x1.GroupName
      2       , x2.Field1
      3       , x2.Field2
      4       , x2.Field3
      5       , x2.Field4
      6  FROM my_clob_table t
      7     , XMLTable(
      8         XMLNamespaces(default 'urn:crystal-reports:schemas:report-detail'),
      9         '/CrystalReport/Group'
    10         passing xmltype(t.xml_data)
    11         columns
    12           GroupName varchar2(30) path 'GroupHeader/Section/Field/Value'
    13         , Groups    xmltype      path 'Group|GroupFooter'
    14       ) x1
    15     , XMLTable(
    16         XMLNamespaces(default 'urn:crystal-reports:schemas:report-detail'),
    17         '/Group/GroupFooter/Section|/GroupFooter/Section'
    18         passing x1.Groups
    19         columns
    20           Field1 varchar2(30) path 'Field[1]/Value'
    21         , Field2 varchar2(30) path 'Field[2]/Value'
    22         , Field3 varchar2(30) path 'Field[3]/Value'
    23         , Field4 varchar2(30) path 'Field[4]/Value'
    24       ) x2
    25  ;
    GROUPNAME          FIELD1                         FIELD2    FIELD3    FIELD4
    bilbo bagins       Total BBB (tran: 6)            12.00     13.00     14.10
    bilbo bagins       Total EEE (tran: 2)            12.50     44.59     72.52
    bilbo bagins       Total bilbo bagins (tran: 8)   34.89     17.85    
    Bruce Lee          Total BBB (tran: 5)            18.11     3.24      1.33
    Bruce Lee          Total EEE (tran: 8)            10.17     7.62      1.53
    Bruce Lee          Total UUU (transactions: 7)    2.01      3.71      2.58
    Bruce Lee          Total Bruce Lee (tran: 60)     99.74     55.81    
    Katar pipin        Total BBB (tran: 5)            7.00      7.00      3.82
    Katar pipin        Total EEE (tran: 3)            65.50     1.75      55.50
    Katar pipin        Total UUU (tran: 1)            1.00      17.35     10.69
    Katar pipin        Total Katar pipin (tran: 9)    9.10      2.01     
    Samsung            Total BBB (tran: 5)            16.00     17.00     17.46
    Samsung            Total Samsung (tran: 5)        5.00      17.46    
    Erica              Total BBB (tran: 5)            6.10      6.12      88.08
    Erica              Total EEE (tran: 2)            13.00     15.87     13.00
    Erica              Total UUU (transactions: 1)    22.00     32.70     41.38
    Erica              Total Erica (tran: 8)          4.87      2.66     
    17 rows selected

  • Read data from xml files and  populate internal table

    Hi.
    How to read data from xml files into internal tables?
    Can u tell me the classes and methods to read xml data..
    Can u  explain it with a sample program...

    <pre>DATA itab_accontextdir TYPE TABLE OF ACCONTEXTDIR.
    DATA struct_accontextdir LIKE LINE OF itab_accontextdir.
    DATA l_o_error TYPE REF TO cx_root.
    DATA: filename type string ,
                 xmldata type xstring .
    DATA: mr      TYPE REF TO if_mr_api.
    mr = cl_mime_repository_api=>get_api( ).
    mr->get( EXPORTING  i_url     = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
                  IMPORTING  e_content = xmldata ).
    WRITE xmldata.
    TRY.
    CALL TRANSFORMATION id
          SOURCE XML xmldata
          RESULT shiva = itab_accontextdir.
      CATCH cx_root INTO l_o_error.
    ENDTRY.
    LOOP AT itab_accontextdir INTO struct_accontextdir.
        WRITE: / struct_accontextdir-context_id,
               struct_accontextdir-context_name,
               struct_accontextdir-context_type.
        NEW-LINE.
        ENDLOOP.</pre>
    <br/>
    Description:   
    In the above code snippet I am storing the data in an xml file(you know xml is used to store and transport data ) called 'xml_accontextdir.xml' that is uploaded into the MIME repository at path 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'.
    The below API is used to read a file in MIME repo and convert it into a string that is stored in ' xmldata'. (This is just a raw data that is got by appending the each line of  xml file).
    mr = cl_mime_repository_api=>get_api( ).
    mr->get( EXPORTING  i_url     = 'SAP/PUBLIC/BC/xml_files_accontext/xml_accontextdir.xml'
                  IMPORTING  e_content = xmldata ).
        Once the 'xmldata' string is available we use the tranformation to parse the xml string that we have got from the above API and convert it into the internal table.
    <pre>TRY.
    CALL TRANSFORMATION id
          SOURCE XML xmldata
          RESULT shiva = itab_accontextdir.
      CATCH cx_root INTO l_o_error.
    ENDTRY.</pre>
    Here the trasnsformation 'id ' is used to conververt the source xml 'xmldata' to resulting internal table itab_accontextdir, that have same structure as our xml file 'xml_accontextdir.xml'.  In the RESULT root of the xml file has to be specified. (In my the root is 'shiva'). 
    Things to be taken care:
    One of the major problem that occurs when reading the xml file is 'format not compatible with the internal table' that you are reading into internal table.  Iin order to get rid of this issue use one more tranformation to convert the data from the internal table into the xml file.    
    <pre>TRY.
          CALL TRANSFORMATION id
            SOURCE shiv = t_internal_tab
            RESULT XML xml.
        CATCH cx_root INTO l_o_error.
      ENDTRY.
      WRITE xml.
      NEW-LINE.</pre>
    <br/>
    This is the same transformation that we used above but the differnce is that the SOURCE and RESULT parameters are changed the source is now the internal table and result is *xml *string. Use xml browser that is available with the ABAP workbench to read the xml string displayed with proper indentation. In this way we get the format of xml file to be used that is compatable with the given internal table. 
    Thank you, Hope this will help you!!!
    Edited by: Shiva Prasad L on Jun 15, 2009 7:30 AM
    Edited by: Shiva Prasad L on Jun 15, 2009 11:56 AM
    Edited by: Shiva Prasad L on Jun 15, 2009 12:06 PM

  • Application to Read and Write the Configuration Data from a xml file

    Hi,
    I have to develop a Webdynpro application that will do the following:
    Read the Configuration data from an xml file
    If stored in a file , and the file is not found, prompt the user to provide the file location.
    Pre-Populate the screen(table) with the configuration data
    Allow the user to edit the data
    Store the configuration data when the user hits the Save button
    The config xml file details are as follows:
    Regardless of the location of the configuration data, the following fields will be stored
    Application (string) will always contain u201CSFA_EDOCSu201D
    Key (string) eg LDAP_USER, DB_PREFIX, etc.
    Type (character)  u201CPu201D = Plain Text, u201CEu201D = Encrypted
    Value (string)
    Since I am new to WD, I would require help on this.
    Please help.Its Urgent.
    Regards,
    Vaishali.
    Edited by: vaishali dhayalan on Sep 19, 2008 8:29 AM

    Hi,
    I have to develop a Webdynpro application that will do the following:
    Read the Configuration data from an xml file
    If stored in a file , and the file is not found, prompt the user to provide the file location.
    Pre-Populate the screen(table) with the configuration data
    Allow the user to edit the data
    Store the configuration data when the user hits the Save button
    The config xml file details are as follows:
    Regardless of the location of the configuration data, the following fields will be stored
    Application (string) will always contain u201CSFA_EDOCSu201D
    Key (string) eg LDAP_USER, DB_PREFIX, etc.
    Type (character)  u201CPu201D = Plain Text, u201CEu201D = Encrypted
    Value (string)
    Since I am new to WD, I would require help on this.
    Please help.Its Urgent.
    Regards,
    Vaishali.
    Edited by: vaishali dhayalan on Sep 19, 2008 8:29 AM

  • Reads data from xml file

    i need a procedure that reads data from xml file and stores into an oracle table.

    Hi,
    Check the below links:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:27523665852829
    http://www.experts-exchange.com/Database/Oracle/Q_20932242.html
    Best regards,
    Rafi.
    http://rafioracledba.blogspot.com

  • TcpListener not working on Azure: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host

    Hi Everybody,
    i'm playing a little bit with Windows Azure and I'm blocked with a really simple issue (or maybe not).
    I've created a Cloud Service containing one simple Worker Role. I've configured an EndPoint in the WorkerRole configuration, which allows Input connections via tcp on port 10100.
    Here the ServiceDefinition.csdef file content:
    <?xml version="1.0" encoding="utf-8"?>
    <ServiceDefinition name="EmacCloudService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2014-01.2.3">
    <WorkerRole name="TcpListenerWorkerRole" vmsize="Small">
    <Imports>
    <Import moduleName="Diagnostics" />
    <Import moduleName="RemoteAccess" />
    <Import moduleName="RemoteForwarder" />
    </Imports>
    <Endpoints>
    <InputEndpoint name="Endpoint1" protocol="tcp" port="10100" />
    </Endpoints>
    </WorkerRole>
    </ServiceDefinition>
    This WorkerRole is just creating a TcpListener object listening to the configured port (using the RoleEnvironment instance) and waits for an incoming connection. It receives a message and returns a hardcoded message (see code snippet below).
    namespace TcpListenerWorkerRole
    using System;
    using System.Net;
    using Microsoft.WindowsAzure.ServiceRuntime;
    using System.Net.Sockets;
    using System.Text;
    using Roche.Emac.Infrastructure;
    using System.IO;
    using System.Threading.Tasks;
    using Microsoft.WindowsAzure.Diagnostics;
    using System.Linq;
    public class WorkerRole : RoleEntryPoint
    public override void Run()
    // This is a sample worker implementation. Replace with your logic.
    LoggingProvider.Logger.Info("TcpListenerWorkerRole entry point called");
    TcpListener listener = null;
    try
    listener = new TcpListener(RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["Endpoint1"].IPEndpoint);
    listener.ExclusiveAddressUse = false;
    listener.Start();
    LoggingProvider.Logger.Info(string.Format("TcpListener started at '{0}:{1}'", RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["Endpoint1"].IPEndpoint.Address, RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["Endpoint1"].IPEndpoint.Port));
    catch (SocketException ex)
    LoggingProvider.Logger.Exception("Unexpected exception while creating the TcpListener", ex);
    return;
    while (true)
    Task.Run(async () =>
    TcpClient client = await listener.AcceptTcpClientAsync();
    LoggingProvider.Logger.Info(string.Format("Client connected. Address='{0}'", client.Client.RemoteEndPoint.ToString()));
    NetworkStream networkStream = client.GetStream();
    StreamReader reader = new StreamReader(networkStream);
    StreamWriter writer = new StreamWriter(networkStream);
    writer.AutoFlush = true;
    string input = string.Empty;
    while (true)
    try
    char[] receivedChars = new char[client.ReceiveBufferSize];
    LoggingProvider.Logger.Info("Buffer size: " + client.ReceiveBufferSize);
    int readedChars = reader.Read(receivedChars, 0, client.ReceiveBufferSize);
    char[] validChars = new char[readedChars];
    Array.ConstrainedCopy(receivedChars, 0, validChars, 0, readedChars);
    input = new string(validChars);
    LoggingProvider.Logger.Info("This is what the host sent to you: " + input+". Readed chars=" + readedChars);
    try
    string orderResultFormat = Encoding.ASCII.GetString(Encoding.ASCII.GetBytes("\xB")) + @"MSH|^~\&|Instrument|Laboratory|LIS|LIS Facility|20120427123212+0100||ORL^O34^ORL_O34| 11|P|2.5.1||||||UNICODE UTF-8|||LAB-28^IHE" + Environment.NewLine + "MSA|AA|10" + Environment.NewLine + @"PID|||patientId||""""||19700101|M" + Environment.NewLine + "SPM|1|sampleId&ROCHE||ORH^^HL70487|||||||P^^HL70369" + Environment.NewLine + "SAC|||sampleId" + Environment.NewLine + "ORC|OK|orderId|||SC||||20120427123212" + Encoding.ASCII.GetString(Encoding.ASCII.GetBytes("\x1c\x0d"));
    writer.Write(orderResultFormat);
    catch (Exception e)
    LoggingProvider.Logger.Exception("Unexpected exception while writting the response", e);
    client.Close();
    break;
    catch (Exception ex)
    LoggingProvider.Logger.Exception("Unexpected exception while Reading the request", ex);
    client.Close();
    break;
    }).Wait();
    public override bool OnStart()
    // Set the maximum number of concurrent connections
    ServicePointManager.DefaultConnectionLimit = 12;
    DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString");
    RoleEnvironment.Changing += RoleEnvironment_Changing;
    return base.OnStart();
    private void RoleEnvironment_Changing(object sender, RoleEnvironmentChangingEventArgs e)
    // If a configuration setting is changing
    LoggingProvider.Logger.Info("RoleEnvironment is changing....");
    if (e.Changes.Any(change => change is RoleEnvironmentConfigurationSettingChange))
    // Set e.Cancel to true to restart this role instance
    e.Cancel = true;
    As you can see, nothing special is being done. I've used the RoleEnvironment.CurrentRoleInstance.InstanceEndpoints to retrieve the current IPEndpoint.
    Running the Cloud Service in the Windows Azure Compute Emulator everything works fine, but when I deploy it in Azure, then I receive the following Exception:
    2014-08-06 14:55:23,816 [Role Start Thread] INFO EMAC Log - TcpListenerWorkerRole entry point called
    2014-08-06 14:55:24,145 [Role Start Thread] INFO EMAC Log - TcpListener started at '100.74.10.55:10100'
    2014-08-06 15:06:19,375 [9] INFO EMAC Log - Client connected. Address='196.3.50.254:51934'
    2014-08-06 15:06:19,375 [9] INFO EMAC Log - Buffer size: 65536
    2014-08-06 15:06:45,491 [9] FATAL EMAC Log - Unexpected exception while Reading the request
    System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
    --- End of inner exception stack trace ---
    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
    at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset, Int32 desiredChars, Boolean& readToUserBuffer)
    at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)
    at TcpListenerWorkerRole.WorkerRole.<>c__DisplayClass0.<<Run>b__2>d__0.MoveNext() in C:\Work\Own projects\EMAC\AzureCloudEmac\TcpListenerWorkerRole\WorkerRole.cs:line 60
    I've already tried to configure an internal port in the ServiceDefinition.csdef file, but I get the same exception there.
    As you can see, the client can connect to the service (the log shows the message: Client connected with the address) but when it tries to read the bytes from the stream, it throws the exception.
    For me it seems like Azure is preventing the retrieval of the message. I've tried to disable the Firewall in the VM in Azure and the same continues happening.
    I'm using Windows Azure SDK 2.3
    Any help will be very very welcome!
    Thanks in advance!
    Javier
    En caso de que la respuesta te sirva, porfavor, márcala como válida
    Muchas gracias y suerte!
    Javier Jiménez Roda
    Blog: http://jimenezroda.wordpress.com

    hi Javier,
    I changed your code like this:
    private AutoResetEvent connectionWaitHandle = new AutoResetEvent(false);
    public override void Run()
    TcpListener listener = null;
    try
    listener = new TcpListener(
    RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["Endpoint"].IPEndpoint);
    listener.ExclusiveAddressUse = false;
    listener.Start();
    catch (SocketException se)
    return;
    while (true)
    IAsyncResult result = listener.BeginAcceptTcpClient(HandleAsyncConnection, listener);
    connectionWaitHandle.WaitOne();
    The HandleAsync method is your "While (true)" code:
    private void HandleAsyncConnection(IAsyncResult result)
    TcpListener listener = (TcpListener)result.AsyncState;
    TcpClient client = listener.EndAcceptTcpClient(result);
    connectionWaitHandle.Set();
    NetworkStream netStream = client.GetStream();
    StreamReader reader = new StreamReader(netStream);
    StreamWriter writer = new StreamWriter(netStream);
    writer.AutoFlush = true;
    string input = string.Empty;
    try
    char[] receivedChars = new char[client.ReceiveBufferSize];
    // LoggingProvider.Logger.Info("Buffer size: " + client.ReceiveBufferSize);
    int readedChars = reader.Read(receivedChars, 0, client.ReceiveBufferSize);
    char[] validChars = new char[readedChars];
    Array.ConstrainedCopy(receivedChars, 0, validChars, 0, readedChars);
    input = new string(validChars);
    // LoggingProvider.Logger.Info("This is what the host sent to you: " + input + ". Readed chars=" + readedChars);
    try
    string orderResultFormat = Encoding.ASCII.GetString(Encoding.ASCII.GetBytes("\xB")) + @"MSH|^~\&|Instrument|Laboratory|LIS|LIS Facility|20120427123212+0100||ORL^O34^ORL_O34| 11|P|2.5.1||||||UNICODE UTF-8|||LAB-28^IHE" + Environment.NewLine + "MSA|AA|10" + Environment.NewLine + @"PID|||patientId||""""||19700101|M" + Environment.NewLine + "SPM|1|sampleId&ROCHE||ORH^^HL70487|||||||P^^HL70369" + Environment.NewLine + "SAC|||sampleId" + Environment.NewLine + "ORC|OK|orderId|||SC||||20120427123212" + Encoding.ASCII.GetString(Encoding.ASCII.GetBytes("\x1c\x0d"));
    writer.Write(orderResultFormat);
    catch (Exception e)
    // LoggingProvider.Logger.Exception("Unexpected exception while writting the response", e);
    client.Close();
    catch (Exception ex)
    //LoggingProvider.Logger.Exception("Unexpected exception while Reading the request", ex);
    client.Close();
    Please try it. For this error message, I suggest you could refer to this thread (http://stackoverflow.com/questions/6173763/using-windows-azure-to-use-as-a-tcp-server
    ) and this post (http://stackoverflow.com/a/5420788).
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for