Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Tham khảo tài liệu 'oracle xsql combining sql oracle text xslt and java to publish dynamic web content phần 9', công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 460 Chapter 16 There is only one method left to document the writeError. This is a simple utility method for writing out any errors. Since it is the last method this code snippet also contains the closing brace for the class void writeError String mesg System.out.println An error occurred System.out.println mesg Now you can put this code to use. In Chapter 7 you used a table called newsletter to study the XML handling actions. In this example you use the command line tool to input some rows into the table. Here is the XSQL that will exist on the Web server side the filename is insert-to-newsletter-plain.xsql xml version 1.0 page connection momnpup xmlns xsql urn oracle-xsql xsql insert-request table newsletter page As discussed in Chapter 7 the xsql insert-request action assumes that there is an XML document in the canonical rowset schema contained in the HTTP request. Our SimpleServicesApp will load a file and embed the XML in the request. Here is what the file looks like which we ll call newsletter.xml xml version 1.0 ROWSET ROW num 1 NAME test name2 NAME EMAIL test1@momnpup.com EMAIL ROW ROW num 2 NAME test name2 NAME EMAIL test2@momnpup.com EMAIL ROW ROWSET You invoke the SimpleServicesApp as follows prompt java SimpleServicesApp http localhost xsql momnpup insert-request.xsql newsletter.xml When the request arrives at the HTTP server it looks like this POST xsql momnpup insert-request.xsql HTTP 1.1 Content-Type text xml User-Agent Java1.3.1_02 Host localhost Accept text html image gif image jpeg q .2 q .2 Connection keep-alive Web Services with XSQL 461 Content-length 226 xml version 1.0 ROWSET ROW num 1 NAME test name2 NAME EMAIL test1@momnpup.com EMAIL ROW ROW num 2 NAME test name2 NAME EMAIL test2@momnpup.com EMAIL ROW ROWSET There are two differences between this and a standard post. First the Content -Type is set to text xml. The second difference is more obvious. Instead of having a list of name-value pairs in the body of the request you have the XML .