POST data using XML
hi everyone...i want to upload a video to youtube from my desktop application. i went through the following link.
http://code.google.com/apis/youtube/2.0/developers_guide_protocol_resumable_uploads.html#Sending_a_Resumable_Upload_API_Request
it is for sending data using XML. but i don't know how to send data using XML. can someone give me an insight of data POST'ing using XML? any help is appreciated.
actually i saw the following segment in this link :
http://code.google.com/apis/youtube/2.0/developers_guide_protocol_resumable_uploads.html#Sending_a_Resumable_Upload_API_Request
POST /resumable/feeds/api/users/default/uploads HTTP/1.1
Host: uploads.gdata.youtube.com
Authorization: AuthSub token="DXAA...sdb8"
GData-Version: 2
X-GData-Key: key=adf15ee97731bca89da876c...a8dc
Content-Length: 1941255
Slug: my_file.mp4
Content-Type: application/atom+xml; charset=UTF-8
<?xml version="1.0"?>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:yt="http://gdata.youtube.com/schemas/2007">
<media:group>
<media:title type="plain">Bad Wedding Toast</media:title>
<media:description type="plain">
I gave a bad toast at my friend's wedding.
</media:description>
<media:category
scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People
</media:category>
<media:keywords>toast, wedding</media:keywords>
</media:group>
</entry>
Similar Messages
-
Any Standard FM for material stocks on posting date using Tcode MB5B
Hi,
I need Standard FM to get material stocks on posting date using Tcode : MB5B
Stock type i am using is : Storage Location/Batch Stock
the Input i am providing is Material, Plant , Storage Location, selection date From , selecDate To.
Then i need to get data that it provides header and document item level.
Can u please tel me how do i get that material stock data on posting date and in which tables
it will be populated in the database.
ITs required can u take view and post info
Thanks & Regards
sivakumar kasa
Edited by: siva kumar kasa on Dec 21, 2010 2:30 PM
Edited by: siva kumar kasa on Dec 22, 2010 7:15 AMhi Rehan,
I have checked all settings also enhancement but there is no as such control to restrict backposting within current period
I think its self disipline action not to post backdated GI when GR is done on later date
Vishal... -
Dynamically load content by date using xml
i would like to load content by date using xml. meaning if i
have 5 upcoming social events listed, i want them to dynamically
drop off from my webpage as the event date passes. i would like to
use the built in spry xml dataset functionality, but don't have to.
i can't seem to find a way to get the server date and then compare
it to a date in a xml node. this seems simple, but i can't seem to
find a tutorial that does not get crazy with all kinds of
code.Have the column headings (which the user clicks to sort by
that column) as
links back to the main page, with the sort as a url parameter
eg
www.mysite.com/mypage.php?sort=name
www.mysite.com/mypage.php?sort=date
etc
Then in your recordset, change the code from
$sql = "SELECT * FROM table ";
to
switch($_GET['sort']){
case "date":
$sql = "SELECT * FROM table ORDER BY date DESC";
break;
case "name":
$sql = "SELECT * FROM table ORDER BY name DESC";
break;
You`ll need to change the above to suit your needs obviously,
but the above
shows the principles that you need to use.
So you use the same page for each sort, but the SQL to
retrieve the records
in the order you want changes dynamically.
Gareth
http://www.phploginsuite.co.uk/
PHP Login Suite V2 - 34 Server Behaviors to build a complete
Login system. -
Importing data- using xml file into HANA Table
Hi,
We are using (HDB STUDIO ) - revision 60.......
Is it possible to import data using XML file into HANA table (Master,Fact tables)?
(Without using any intermediate adapters for conversion of data.....)
Can any one suggest us........
Thank you.Hi user450616
I am a bit confused about what you are trying to achieve.
Are you:
1. importing a CSV file into APEX
2. adding an extra column to the Oracle Table
3. populating the extra column with the CSV filename?
Let us know if this is what you are trying to do.
Cheers,
Patrick Cimolini -
Hi Guys,
I ran into this trouble, basically, what I need is to post data into this url using REST:
www.thissite.com/comment
now it says:
do this with a variable name content, containing "key: value" line by line:
id:
Action: comment
Text: the text comment
now it has a sample on how to do this using java:
import java.io.IOException;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;
import org.apache.commons.httpclient.methods.multipart.Part;
import org.apache.commons.httpclient.methods.multipart.StringPart;
public class RtTicketCreator {
static final String BASE_URI = "http://www.thissite.com/REST/1.0";
public static void main(String[] args) throws IOException {
PostMethod mPost = new PostMethod(BASE_URI + "/1234/comment/");
Part[] parts = { new StringPart("content", "id: 1234\nAction: comment") };
mPost.setRequestEntity(new MultipartRequestEntity(parts, mPost.getParams()));
HttpClient cl = new HttpClient();
cl.executeMethod(mPost);
System.out.println(mPost.getResponseBodyAsString());
Now, my question is: Can I do this using javascript? If yes, could you at least give me an idea how to accomplish this?
Thanks Guys,
Best Regards,
AaronHi Vishvesh,
Could you please let me know how you resolved the issue.
I am also developing a web app in eclipse consuming the odata and when checking the script in Firebug i gor the error as
GET http:/<server>;port/sap/opu/sdata/sap/GURU/$metadata/$metadata?$format=xml
00:01:50 2012-04-06 The following problem occurred: HTTP request failed0,, -
Thanks and regards
Gururaj -
Post data to XML template in Agentry app
Hi Community,
Is there a way to post data from object/transaction properties to XML template in Agentry?
From the below link, it appears we can do it using an update rule, but I couldn't understand how? Any other information on this would be helpful.
How to configure Agentry to format and post an xml document to a url using transaction data - SAP Mobility - SCN Wiki
Thanks
Narasimha
Tags edited by: Michael ApplebyNarasimha,
That article is just suggesting that it could be done with an update rule. This would still be a completely manual process where you would need to create the XML using CONCATENATE statements in the rule to build the XML by hand. The update rule would be tied to a transaction property. You would then use the Java or SQL backend to pass the generated XML to your backend system.
To have Agentry build the XML transaction data for you via template, you need to use the XML backend and create XML backend steps. The XML backend is used primarily for communicating with web services. Within the step, you set up your base XML template with placeholders for the transaction properties.
Here are a couple links to help get you started with the XML backend:
Configuring HTTP-XML Back-end Connections for Agentry Applications - Administrator - SAP Library
SyBooks Online
Jason Latko - Senior Product Developer at SAP -
Adobe form-Able to post data using Adobe Reader 9 but not with Adobe Proff
Hello Guru's
I am facing one problem with adobe forms.
We have develoed a adobe form using adobe reader 9.
Now when user are posting the purchase requistion using the form,they are able to post the data using
Adobe Reader 9 but not with Adobe Reader professional.
Can anyone please advice me what can be the problem here.Adobe Reader 9 can't save the old FDA forms. FDA must update their forms.
-
Posting data using HTTPClient (Innovation)
Hi all,
I have the following problem:
I'm using HTTPClient library from Innovation.ch and have used the following code to post data to the following website : http://blast.genome.ad.jp/
import java.io.*;
import java.applet.*;
import javax.swing.*;
import java.util.*;
import java.awt.*;
import HTTPClient.*;
public class VistaConnection {
private String sequence;
private String str;
private String resultURL;
public VistaConnection(String seq) {
sequence = seq;
try{
URI doc_url = new URI ("http://blast.genome.ad.jp");
URI form_url = new URI (doc_url,"/sit-bin/nph-blast");
HTTPConnection con = new HTTPConnection(form_url);
NVPair[] form_data =
new NVPair[] {
new NVPair("prog", "blastn"),
new NVPair("dbname", "nr-nt"),
new NVPair("V_value", "500"),
new NVPair("B_value", "250"),
new NVPair("sequence", sequence),
new NVPair("filter", "F"),
HTTPResponse resp = con.Post(form_url.getPathAndQuery(), form_data);
String Output = "";
if(resp.getStatusCode () >=300){
System.err.println("Received Error:"+ resp.getReasonLine());
//System.err.println(resp.getText());
else {
DataInputStream input = new DataInputStream(resp.getInputStream());
resultURL = "";
while(null != ((str = input.readLine()))){
System.out.println(str);
Output += str;
input.close();
}catch(IOException ioe){
System.err.println(ioe.toString());
}catch (ParseException pe) {
System.err.println("Error parsing Content-Type: " + pe.toString());
} catch (ModuleException me) {
System.err.println("Error handling request: " + me.getMessage());
}when I run this code in my program the data gets posted but I cannot retreive the results because they are loaded up in separate web page,
I was Hoping that someone would be able to give me some Idea of how to retreive these results from the server through my code.
Thanks for any help
P.S. Just in case I've added the data that I post through my program below:
gi|23821530|dbj||SEG_D10989S Bos taurus gene for endothelin receptorGGGATCCCGAGCAAACTGCGGAGGCCACACTGTCAGGCATTCCCTCGGCGTTTCGTCAGAGCCAGACCCT
CCCGCTGCTGAAGGGAGGCGCGCTCTGCTCCCGGGCTGCCGGGAACCCAGCCGCGCGCCGGGGAAGGAGG
TCCCTGCCTGGTGCGTCCGGACCAAGAGGTAACCGTTCTGCTTGGTGTTTAATTCAAATCTGTGATTGAA
CCTTATCCTGGGGCTTCAGTTTGGATTACTTCTTAGGTTTGTTTTTGTTTGTTTGTTTGTTTTTTAACCT
GTAGCTACAGCAGATTAAAATGGGATTGGAGTGAAGGAGAGGGCTTGAGTGTCTGAAGTCACTCGAAGGG
GATAGAAACTTCCGAGTTAATCCAGATAGAGACTCTTCCAAATAGACCAAGTGGAGATGTCCGGGAGATT
TTCCGAGTCAGCCGGCTCAGTCCTGGGGTGTGTGTATGGGGGGTGGGGGCGGTGCCGAAGAGCGGAAGGA
AGGGGTCTGAAAGTCCAGACATGCGGCATCCGGGGTTGCTGTGGAGTCGAAAGCAGAGACTGGCGATGCC
CTTGATCTCTAACCTGCCTTGATTTGCCCCGTCCCCGCGCGCCCTTGGCCAGAACGAATACTGCTCCCTC
TGCGCACACCAGGAGCTCAAAGCTTTGCTTTGGACACCCGTCCTCTCCTCCCCGTCACACCCCTTCCAGG
ATACCCCGCCCCACTGCGAGTCATTTACCCCTCAGGGGACGCAGGGGAGGAAAAACCAGCGAAAGCTGGC
TCTGGAGGGACGGTCTAGGGGCGCAAGCGAGTCCCACGCGCCAGAGTTCCCCACTCCCGCGCCAGCTCGA
CTTATTAATACTTTTGCGCACTGAGAGTGCGGGCGCTGCTGCGCTTGAGGATAGCGGCTTGCAGGGGCGT
GGCTGGGGACGCTGACCCGGGTGTCCTGTCTTCCTTCCCTTGCTGGTCTCTAGACTCGGAAAGCGGAGGA
GCGGCCACCCGACTCCCTCTGGAGCAGGCAGCAGCATGCAGCCGCTGCCCAGCTTGTGCGGACGCGCCCT
GGTGGCGCTGATCCTTGCCTGCGGCGTGGCGGGGATCCAAGCAGAAGAGAGGGAATTCCCGCCAGCCGGG
GCCACTCAGCCACTTCCGGGGACCGGAGAGATGATGGAGACCCCGACTGAGACCTCCTGGCCCGGGAGGT
CCAACGCCAGCGACCCGCGATCGTCCGCAACACCGCAGATTCCTAGAGGGGGAAGGATGGCGGGAATCCC
ACCGCGCACCCCACCCCCGTGCGATGGACCCATAGAGATCAAGGAGACTTTCAAGTACATCAACACGGTG
GTGTCCTGCCTAGTGTTCGTGCTGGGCATCATCGGAAACTCCACGCTACTGAGAATCATTTACAAGAACA
AGTGCATGCGAAACGGTCCAAATATCTTGATAGCCAGCCTGGCTCTCGGAGACCTGCTGCACATTATCAT
TGATATCCCCATCAATACCTACAAGGTAAGGGGTGCCCTG
CCACTAAGTATACATACAGGTTCAAGAGCACCCTGTGAACATCTCCCTAACAGAGCTCTGTGTCTCCTCA
ATGCAGCTGCTTGCCAAGGACTGGCCCTTTGGGGTTGAGATGTGTAAGCTGGTGCCTTTCATTCAGAAGG
CCTCCGTGGGCATCACTGTGCTGAGTCTATGTGCTCTAAGTATTGACAGGTAAGAGCAAGTATCTAAGCG
ACATATATCCTGACCACGATCCTAGTGCTTGCTACGTTACTTAGAAAGTAAACTGTAATTCAATAAAAAC
CAGGCTCTGCCAGCTTGGCAATTGATTCTGTTTTGTTCTTCAGATATCGAGCTGTTGCTTCTTGGAGTCG
GATTAAAGGAATCGGGGTTCCAAAATGGACAGCAGTAGAAATTGTTTTAATTTGGGTGGTCTCCGTGGTT
CTGGCTGTCCCTGAGGCTGTGGGTTTTGATATAATTACCAGTGATCACATAGGAAATAAACTGAGAATCT
GCTTGCTCCATCCCACTCAGAAAACAGCATTTATGCAGGTAAATTTTACTTTTTTTTTCCCT
TCCCCCATAGTTTTACAAGACAGCTAAAGACTGGTGGCTATTTAGTTTCTATTTCTGCCTGCCGCTGGCC
ATCACTGCATTGTTTTATACCCTGATGACTTGTGAAATGTTGAGAAAGAAGAGTGGTATGCAAATTGCCT
TAAATGATCACTTAAAACAGGTAAGG
TTTATTTCAGAGACGGGAAGTGGCCAAAACAGTATTTTGCCTGGTCCTTGTCTTTGCTCTGTGTTGGCTT
CCTCTTCATCTTAGCAGGATTTTGAAGCTCACTCTTTATGATCAGCATGATCCCCGTAGATGTGAATTTT
TAAGGTAAGT
ATAAATAAATTTTCATATTATTTTTGCAGCTTTTTGTTGGTATTGGACTACATTGGCATCAACATGGCCT
CCCTGAATTCCTGTATTAACCCAATAGCTCTGTATTTGGTGAGCAAAAGATTCAAAAACTGCTTTAAGGT
AAGACAGTATCGAAAATCAAAA
TGGTGAGCAAGGAGGGTTGTGATAGTGTAACTTGATGTAAACTTATAACGAAGTTACTTTGCTTTGTGCA
GTCATGTTTATGCTGCTGGTGCCAATCATTTGAAGAAAAACAGTCCTTGGAGGAAAAGCAGTCGTGCTTA
AAGTTCAAAGCTAACGATCACGGATATGACAACTTCCGTTCCAGTAATAAATACAGCTCATCTTGAAAGA
AGGATTATTCATTTTCTTTATTTTGGACAGAAATCATTCAAACAAAGAGGTATCTGTCAAAGTAAAACAA
AACAACGTGTGTGTTTGCACAAAACAATGTACAAATGTAAGAGTGATTATTTTCTTCACACTCAAGAGTT
CCACATGACGTTTGATGAGCTGTTTCCAGCATGAGAAGACAAGCAGTGAGAATTAAGAAAGCCTTATTGT
GAAAGCACTTAATTCTTTTACAGTTAGCACTTCACTATATTATAGCTCTTCAGAACTTCGGTCTATTCAT
ACACCACTTACATTTAACTTGAGTTCACTCAWell, can't actually test this (don't have unproxied access to the internet today) but strikes me this should work.
It doesn't use the library you use because it just isn't required for something as simple as this.
Just run as it is and the web server should return an error because the sequence is invalid, then try again with your data.
Good luck.
import java.io.InputStream;
import java.io.ByteArrayOutputStream;
import java.net.URL;
import java.net.HttpURLConnection;
class Sjohri1
public static void main(String argv[])
throws Exception
String sequence= "whatever"; // your sequence goes here
String szUrl= "http://blast.genome.ad.jp/sit-bin/nph-blast";
szUrl += "?prog=blastn";
szUrl += "&dbname=nr-nt";
szUrl += "&V_value=500";
szUrl += "&B_value=250";
szUrl += "&sequence=" +sequence;
szUrl += "&filter=F";
URL url= new URL(szUrl);
HttpURLConnection urlConn= (HttpURLConnection) url.openConnection();
InputStream in= urlConn.getInputStream();
ByteArrayOutputStream out= new ByteArrayOutputStream();
for (int ch; (ch= in.read()) >= 0;)
out.write(ch);
System.out.println(out.toString());
} -
How to extract data using xml datatype
Hi,
I tried the following example using xml data type , but not getting the required output.
could you please correct the query so as to get the required one
CREATE TABLE TEST.EMP_DETAIL
EMPNO NUMBER,
ENAME VARCHAR2(32 BYTE),
EMPDETAILS SYS.XMLTYPE
Insert into EMP_DETAIL
(EMPNO, ENAME, EMPDETAILS)
Values
(7, 'Martin', XMLTYPE('<Dept>
<Emp Empid="1">
<EmpName>Kevin</EmpName>
<Empno>50</Empno>
<DOJ>20092008</DOJ>
<Grade>E3</Grade>
<Sal>3000</Sal>
</Emp>
<Emp Empid="2">
<EmpName>Coster</EmpName>
<Empno>60</Empno>
<DOJ>01092008</DOJ>
<Grade>E1</Grade>
<Sal>1000</Sal>
</Emp>
<Emp Empid="3">
<EmpName>Samuel</EmpName>
<Empno>70</Empno>
<DOJ>10052008</DOJ>
<Grade>E2</Grade>
<Sal>2530</Sal>
</Emp>
<Emp Empid="4">
<EmpName>Dev</EmpName>
<Empno>80</Empno>
<DOJ>10032007</DOJ>
<Grade>E2</Grade>
<Sal>1200</Sal>
</Emp>
</Dept>
'));I need to get the record for Empid="2"
So tried the following query with no expected o/p
SELECT a.empno,a.ename,a.empdetails.extract('//Dept/Emp/EmpName/text()').getStringVal() AS "EmpNAME",
a.empdetails.extract('//Dept/Emp/Empno/text()').getStringVal() AS "EMPNumber",
a.empdetails.extract('//Dept/Emp/DOJ/text()').getStringVal() AS "DOJ",
a.empdetails.extract('//Dept/Emp/Grade/text()').getStringVal() AS "Grade",
a.empdetails.extract('//Dept/Emp/Sal/text()').getStringVal() AS "Salary",
a.empdetails.extract('//Dept/Emp[@Empid="2"]').getStringVal() AS "ID",
a.empdetails.extract('//Dept/Emp[EmpName="Coster"]').getStringVal() AS "CHK"
FROM emp_detail a
where empno=7
AND a.empdetails.existsNode('//Dept/Emp[@Empid="2"]') =1thanks..I am not very good at this... But Shouldn't your XML be more like this
SQL> Insert into EMP_DETAIL
2 (EMPNO, ENAME, EMPDETAILS)
3 Values
4 (7, 'Martin', XMLTYPE('<Dept>
5 <Emp>
6 <Empid>1</Empid>
7 <EmpName>Kevin</EmpName>
8 <Empno>50</Empno>
9 <DOJ>20092008</DOJ>
10 <Grade>E3</Grade>
11 <Sal>3000</Sal>
12 </Emp>
13 <Emp>
14 <Empid>2</Empid>
15 <EmpName>Coster</EmpName>
16 <Empno>60</Empno>
17 <DOJ>01092008</DOJ>
18 <Grade>E1</Grade>
19 <Sal>1000</Sal>
20 </Emp>
21 <Emp>
22 <Empid>3</Empid>
23 <EmpName>Samuel</EmpName>
24 <Empno>70</Empno>
25 <DOJ>10052008</DOJ>
26 <Grade>E2</Grade>
27 <Sal>2530</Sal>
28 </Emp>
29 <Emp>
30 <Empid>4</Empid>
31 <EmpName>Dev</EmpName>
32 <Empno>80</Empno>
33 <DOJ>10032007</DOJ>
34 <Grade>E2</Grade>
35 <Sal>1200</Sal>
36 </Emp>
37 </Dept>
38 '));
1 row created.so that you can
SQL> SET LINESIZE 250
SQL> COLUMN EMPNAME FORMAT A20
SQL> COLUMN EMPNUMBER FORMAT A2
SQL> COLUMN DOJ FORMAT A10
SQL> COLUMN GRADE FORMAT A10
SQL> COLUMN SALARY FORMAT A10
SQL> SELECT a.empno,a.ename,a.empdetails.extract('//Dept/Emp[Empid="2"]/EmpName/text()').getStringVal() AS "EmpNAME",
2 a.empdetails.extract('//Dept/Emp[Empid="2"]/Empno/text()').getStringVal() AS "EMPNumber",
3 a.empdetails.extract('//Dept/Emp[Empid="2"]/DOJ/text()').getStringVal() AS "DOJ",
4 a.empdetails.extract('//Dept/Emp[Empid="2"]/Grade/text()').getStringVal() AS "Grade",
5 a.empdetails.extract('//Dept/Emp[Empid="2"]/Sal/text()').getStringVal() AS "Salary"
6 FROM emp_detail a
7 /
EMPNO ENAME EmpNAME EM DOJ Grade Salary
7 Martin Coster 60 01092008 E1 1000Edited by: Karthick_Arp on Apr 30, 2009 2:21 AM -
XML generation with SAP data using XML schema - Reg
Hello experts,
My requirement is , SAP( ztable data ) data has to be transferred to third party software folder.Third party using XML so they requires output from SAP in XML format.
For that third party software guys told me that they will give their own XML schema to me.I have to generate XML file with SAP data using their XML schema.
Generating XML file with their Schema should be underlined.
I studied that call transformation statement helps for this.
Even then i don't have clear idea about this topic.
Please brief me about how to use their XML schema to generate XML with my own sap data.
Thanks in advance experts.
Kumarplease try this same program and see it ....
*& Report z_xit_xml_check
REPORT z_xit_xml_check.
TYPE-POOLS: ixml.
TYPES: BEGIN OF t_xml_line,
data(256) TYPE x,
END OF t_xml_line.
DATA: l_ixml TYPE REF TO if_ixml,
l_streamfactory TYPE REF TO if_ixml_stream_factory,
l_parser TYPE REF TO if_ixml_parser,
l_istream TYPE REF TO if_ixml_istream,
l_document TYPE REF TO if_ixml_document,
l_node TYPE REF TO if_ixml_node,
l_xmldata TYPE string.
DATA: l_elem TYPE REF TO if_ixml_element,
l_root_node TYPE REF TO if_ixml_node,
l_next_node TYPE REF TO if_ixml_node,
l_name TYPE string,
l_iterator TYPE REF TO if_ixml_node_iterator.
DATA: l_xml_table TYPE TABLE OF t_xml_line,
l_xml_line TYPE t_xml_line,
l_xml_table_size TYPE i.
DATA: l_filename TYPE string.
PARAMETERS: pa_file TYPE char1024 DEFAULT 'c:temporders_dtd.xml'.
* Validation of XML file: Only DTD included in xml document is supported
PARAMETERS: pa_val TYPE char1 AS CHECKBOX.
START-OF-SELECTION.
* Creating the main iXML factory
l_ixml = cl_ixml=>create( ).
* Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
PERFORM get_xml_table CHANGING l_xml_table_size l_xml_table.
* wrap the table containing the file into a stream
l_istream = l_streamfactory->create_istream_itable( table = l_xml_table
size = l_xml_table_size ).
* Creating a document
l_document = l_ixml->create_document( ).
* Create a Parser
l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
istream = l_istream
document = l_document ).
* Validate a document
IF pa_val EQ 'X'.
l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
ENDIF.
* Parse the stream
IF l_parser->parse( ) NE 0.
IF l_parser->num_errors( ) NE 0.
DATA: parseerror TYPE REF TO if_ixml_parse_error,
str TYPE string,
i TYPE i,
count TYPE i,
index TYPE i.
count = l_parser->num_errors( ).
WRITE: count, ' parse errors have occured:'.
index = 0.
WHILE index < count.
parseerror = l_parser->get_error( index = index ).
i = parseerror->get_line( ).
WRITE: 'line: ', i.
i = parseerror->get_column( ).
WRITE: 'column: ', i.
str = parseerror->get_reason( ).
WRITE: str.
index = index + 1.
ENDWHILE.
ENDIF.
ENDIF.
* Process the document
IF l_parser->is_dom_generating( ) EQ 'X'.
PERFORM process_dom USING l_document.
ENDIF.
*& Form get_xml_table
FORM get_xml_table CHANGING l_xml_table_size TYPE i
l_xml_table TYPE STANDARD TABLE.
* Local variable declaration
DATA: l_len TYPE i,
l_len2 TYPE i,
l_tab TYPE tsfixml,
l_content TYPE string,
l_str1 TYPE string,
c_conv TYPE REF TO cl_abap_conv_in_ce,
l_itab TYPE TABLE OF string.
l_filename = pa_file.
* upload a file from the client's workstation
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = l_filename
filetype = 'BIN'
IMPORTING
filelength = l_xml_table_size
CHANGING
data_tab = l_xml_table
EXCEPTIONS
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* Writing the XML document to the screen
CLEAR l_str1.
LOOP AT l_xml_table INTO l_xml_line.
c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data replacement = space ).
c_conv->read( IMPORTING data = l_content len = l_len ).
CONCATENATE l_str1 l_content INTO l_str1.
ENDLOOP.
l_str1 = l_str1+0(l_xml_table_size).
SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
WRITE: /.
WRITE: /' XML File'.
WRITE: /.
LOOP AT l_itab INTO l_str1.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN
l_str1 WITH space.
WRITE: / l_str1.
ENDLOOP.
WRITE: /.
ENDFORM. "get_xml_table
*& Form process_dom
FORM process_dom USING document TYPE REF TO if_ixml_document.
DATA: node TYPE REF TO if_ixml_node,
iterator TYPE REF TO if_ixml_node_iterator,
nodemap TYPE REF TO if_ixml_named_node_map,
attr TYPE REF TO if_ixml_node,
name TYPE string,
prefix TYPE string,
value TYPE string,
indent TYPE i,
count TYPE i,
index TYPE i.
node ?= document.
CHECK NOT node IS INITIAL.
ULINE.
WRITE: /.
WRITE: /' DOM-TREE'.
WRITE: /.
IF node IS INITIAL. EXIT. ENDIF.
* create a node iterator
iterator = node->create_iterator( ).
* get current node
node = iterator->get_next( ).
* loop over all nodes
WHILE NOT node IS INITIAL.
indent = node->get_height( ) * 2.
indent = indent + 20.
CASE node->get_type( ).
WHEN if_ixml_node=>co_node_element.
* element node
name = node->get_name( ).
nodemap = node->get_attributes( ).
WRITE: / 'ELEMENT :'.
WRITE: AT indent name COLOR COL_POSITIVE INVERSE.
IF NOT nodemap IS INITIAL.
* attributes
count = nodemap->get_length( ).
DO count TIMES.
index = sy-index - 1.
attr = nodemap->get_item( index ).
name = attr->get_name( ).
prefix = attr->get_namespace_prefix( ).
value = attr->get_value( ).
WRITE: / 'ATTRIBUTE:'.
WRITE: AT indent name COLOR COL_HEADING INVERSE, '=',
value COLOR COL_TOTAL INVERSE.
ENDDO.
ENDIF.
WHEN if_ixml_node=>co_node_text OR
if_ixml_node=>co_node_cdata_section.
* text node
value = node->get_value( ).
WRITE: / 'VALUE :'.
WRITE: AT indent value COLOR COL_GROUP INVERSE.
ENDCASE.
* advance to next node
node = iterator->get_next( ).
ENDWHILE.
ENDFORM. "process_dom
reward points if it is use fulll ....
Girish -
POST data using UTL_HTTP
Hi There,
First of all, I am using the UTL_HTTP package for the first time. Basically, we have to POST JSON data to a URL. The format of the data is
{"definition":"Part","item":"Part1","value":"123"}
{"definition":"Part","item":"Part2","value":"789"}
{"definition":"Part","item":"Partn","value":"345"}
Now using the Curl command we can run the comand
$ curl -X POST http://xyz.com/test -H 'Content-Type: application/json' -d '{"items":[
{"definition":"Part","item":"Part1","value":"123"}
{"definition":"Part","item":"Part2","value":"789"}
{"definition":"Part","item":"Partn","value":"345"}The same needs to be implemented in PL/SQL, I found this link
http://technology.amis.nl/2012/01/19/publishing-to-cometd-bayeux-channel-from-inside-the-oracle-database-plsql-based-push-to-cometd-web-client/
I was getting the error
Error report:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1130
ORA-29261: bad argument
ORA-06512: at line 61
29273. 00000 - "HTTP request failed"
*Cause: The UTL_HTTP package failed to execute the HTTP request.
*Action: Use get_detailed_sqlerrm to check the detailed error message.
Fix the error and retry the HTTP request.
This was after I tried changing the POST procedure to a anonymoust block and tried to run it since we do not have create rights on the DB. Before I post the change, just wanted to check if anyone has any suggestions on impementing this in PL/SQL, basically, we just need to send 2 columns data in JSON format to a URL on a daily basis.
ThanksHave a look at the SOAP example in {message:id=4205205}. Posting JSON will be very similar - but instead of a SOAP envelope and header tags, these will be JSON format.
Not sure what response you expect back from the web server. In the case of SOAP, it is XML - so the sample function returns XML. -
How to delete large data using XML batch in chunk
public void DeleteListItems(SPWeb web, SPList list)
RMPExceptionManager.LogErrorInFile("--------Delete List Items from : " + list + " starts--------", true);
try
web.AllowUnsafeUpdates = true;
StringBuilder builder = new StringBuilder();
builder.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Batch>");
string s = "<Method>" +
"<SetList Scope=\"Request\">" + list.ID + "</SetList>" +
"<SetVar Name=\"ID\">{0}</SetVar>" +
"<SetVar Name=\"Cmd\">Delete</SetVar>" +
"</Method>";
foreach (SPListItem item in list.Items)
builder.Append(string.Format(s, item.ID.ToString()));
builder.Append("</Batch>");
web.ProcessBatchData(builder.ToString());
web.AllowUnsafeUpdates = false;
RMPExceptionManager.LogErrorInFile("--------Delete List Items from : " + list + " ends--------", true);
catch (Exception ex)
RMPExceptionManager.LogErrorInFile("--------delete List Items exception--------", bIsLogEnabled);
RMPExceptionManager.LogErrorInFile(ex.Message, bIsLogEnabled);
RMPExceptionManager.LogErrorInFile(ex.Source, bIsLogEnabled);
RMPExceptionManager.LogErrorInFile(ex.StackTrace, bIsLogEnabled);
RMPExceptionManager.LogErrorInFile("-------------------------------------------------------", bIsLogEnabled);
I am using the above code to delete the data from list.
currently its not deleting properly as its executing huge xml batch.
How can I change the above code in to chunk of 1000 so that I can delete 25000 records easily?I tried the below code but its not working properly.
first time when it comes in do loop its deleting the records one by one and not using batch of 1000.
after some time(aprox 30 min) it starts executeing batch of 1000 but not deleting whole records. out of 10,000 its deleting hardly 7000 then stops the delete process and jumps on next step.
I am not getting why its showing this behaivour ? Is it time out after some time in xml batch? but its still executing the other code after comming out of delete function.
web.AllowUnsafeUpdates = true;
StringBuilder builder = new StringBuilder();
builder.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Batch>");
string s = "<Method>" +
"<SetList Scope=\"Request\">" + list.ID + "</SetList>" +
"<SetVar Name=\"ID\">{0}</SetVar>" +
"<SetVar Name=\"Cmd\">Delete</SetVar>" +
"</Method>";
// Query to get the unprocessed items.
SPQuery query = new SPQuery();
query.RowLimit = 1000;
query.Query = "<Where></Where>";
do
SPListItemCollection remainingItems = list.GetItems(query);
foreach (SPListItem item in remainingItems)
builder.Append(string.Format(s, item.ID.ToString()));
builder.Append("</Batch>");
web.ProcessBatchData(builder.ToString());
query.ListItemCollectionPosition = remainingItems.ListItemCollectionPosition;
RMPExceptionManager.LogErrorInFile("--------Delete batch remaining : " + remainingItems.ListItemCollectionPosition + " --------", true);
} while (query.ListItemCollectionPosition != null);
any body got this type of issue?
is there any problem in above code?
is there any other way to do this deletion process in better way? -
Nokia E61i Push Data using XML Cisco Objects?
Hi:
I have a Nokia E61 (wifi) suscribed to a Cisco Call Manager.
Is there any posibility to Push Data to the device?, like XML Cisco Objects to IP Phone 7970.
Could I send an SMS without use the mobile network?
thanks in advance,
marceloThanks for the reply. Yes, I did compile all the Java and it
works OK with a simple Java program. It just will not work in a
Flex application.
The java classes are:
RRA:
package blah.myPackage;
import java.util.List;
import java.util.Collection;
import flex.data.DataSyncException;
import flex.data.assemblers.AbstractAssembler;
class RRA extends AbstractAssembler
public Collection fill( List fillParameters )
RRS service = new RRS();
return service.getSome();
RRS:
package blah.myPackage;
import java.util.ArrayList;
import java.util.List;
import java.sql.*;
import flex.EORS.*;
class RRS
public List getSome()
ArrayList list = new ArrayList();
String str = "bob";
RR rr = new RR(str);
list.add(rr);
return list;
RR:
package blah.myPackage;
class RR
private String name;
public RR() { }
public RR(String name)
this.name = name;
public String getName()
return this.name;
public void setName(String name)
this.name = name;
I started with something that retrieved data from a database
but watered it down just to try and get some kind of communication
between Flex and Java. -
Problem in Posting data using BAPI_ACC_DOCUMENT_POST
Hi ,
I am trying to post a Sub-ledger account using the BAPI_ACC_DOCUMENT_POST.
The Details I am passing are
DOCUMENTHEADER
USERNAME - UPPUVID
COMPANY CODE - 1030
DOC_DATE - 2/2/2009
PSTNG_DATE- 2/2/2009
FISCAL YEAR- 2009
PERIOD - 02
DOC TYPE - DR
ACCOUNTGL
ITEMNO_ACC 0000000002
GL_ACCOUNT 230400
PROFIT_CTR 110001
ACCOUNTRECEIVABLE
ITEMNO_ACC 0000000001
CUSTOMER 40000087
GL_ACCOUNT 110100
CURRENCYAMOUNT
ITEMNO_ACC CU CURRE CUR AMT_DOCCUR
0000000001 USD 1,000.0000
0000000002 USD 1,000.0000-
The result shown is as follows.
Document posted successfully: BKPFF 180001511510302009 DV1CLNT200
But when we go and check in FB03 .
I am getting an error message saying Document doesnot exist for the Tcode 1030 .
Also there is no corresponding entry in BKPF .
Please let me know If I have to pass anything else to post the data.
Regards,
Vidyulatha U.Hi Vidyulatha,
You can also use FM : POSTING_INTERFACE_START & POSTING_INTERFACE_DOCUMENT & POSTING_INTERFACE_END.
As you know you can post all types of documents through FB01.
You can set the i_tcode as 'FB01' & i_sgfunct as 'C'.
You just Pass on the values to these FMs.
Edited by: Yogesh Karanjikar on Feb 2, 2009 10:55 AM
Edited by: Yogesh Karanjikar on Feb 2, 2009 10:56 AM -
One CFFORM with two or three or four... butons.
I would like to post the form fields to different cfm files
(as we do with Javascript : document.form.action='myfile.cfm').
Could somebody show me an example with the getURL ActionScript
command and the POST method ?
Thanks for your help.actually i saw the following segment in this link :
http://code.google.com/apis/youtube/2.0/developers_guide_protocol_resumable_uploads.html#Sending_a_Resumable_Upload_API_Request
POST /resumable/feeds/api/users/default/uploads HTTP/1.1
Host: uploads.gdata.youtube.com
Authorization: AuthSub token="DXAA...sdb8"
GData-Version: 2
X-GData-Key: key=adf15ee97731bca89da876c...a8dc
Content-Length: 1941255
Slug: my_file.mp4
Content-Type: application/atom+xml; charset=UTF-8
<?xml version="1.0"?>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:yt="http://gdata.youtube.com/schemas/2007">
<media:group>
<media:title type="plain">Bad Wedding Toast</media:title>
<media:description type="plain">
I gave a bad toast at my friend's wedding.
</media:description>
<media:category
scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People
</media:category>
<media:keywords>toast, wedding</media:keywords>
</media:group>
</entry>
Maybe you are looking for
-
New computer - email setup beachball
I am looking at the mother of all computers - the 24 inch imac and its beautiful. I connected to the internet just fine but email setup using Mail is just giving me the beachball. Any for whatever reason there is no Mail Help when I go to Help. Diane
-
How do I change default settings for email in iphone
I have 2 email accounts on my iPhone 5. I want to change the settings to use my other email address as the DEFAULT setting. How do I do that? Thanks for your help! Tim
-
Is there an easy way to transfer PDFs from my computer to my iPad and then use Adobe to open them?
-
Preview Build failed to download 0x80246018
Running Windows Technical Preview for Enterprise Build 9841. After I enabled the Preview Builds option in Update and Recovery, I attempted to download Build 9860 but received the error "Failed to download the new preview build, please try again lat
-
Setting the cost center ranges in BD21
Hi All The BD21 transaction code is used for transfer the data between the two system by change pointer. is it possible to setting the cost center ranges In BD21 transaction code. Please Confirm Thanks & Regards K.Gunasekar.