Building Oracle XML Applications phần 3

Xây dựng các ứng dụng Oracle XML Bản quyền © 2000 O'Reilly & Associates, Inc. Tất cả các quyền. In tại Hoa Kỳ. Xuất bản bởi O'Reilly & Associates, Inc, 101 Morris đường, Sebastopol, CA 95472. Logo O'Reilly là nhãn hiệu đăng ký của O'Reilly & Associates, Inc. | -- This is the URL for the Post-a-New-Newstory Web Service service url http xml xsql demo insertxml -- Prepare the XML document to post by gluing the values of -- the headline news source and URL of the article into the -- XML message at the appropriate places. msg moreovernews article url story url url headline_text story_headline headline_text source story_source source article moreovernews -- Post the XML document to the web service URL and get the Response msg service_url xml_response -- Check the response to see if it was a success. -- This service returns xsql-status rows 1 if it was a success. IF xml_response xsql-status @rows 1 THEN retval Success ELSE retval Failed END IF -- Free the XML document xml_response -- Return the status RETURN retval EXCEPTION WHEN OTHERS THEN xml_response RAISE END We can quickly test the function from SQL Plus by creating a SQL Plus variable named status and executing the function like this SQL variable status varchar2 10 SQL exec status postNewsStory It Worked Steve http someserver PL SQL procedure successfully completed. SQL print status STATUS Success Printing the value of the status variable shows that the request was a Success. Next we ll try an HTTP GET example. Sometimes web services simply take the information they need to carry out their task as parameters on a URL. In these cases it is not required to post any XML document. Instead we just do an HTTP GET on the service s URL with appropriate parameter values tacked on to the end of the URL. Figure shows the exchange between our database and a web service that allows us to look up the name of an airport given its three-letter description. The database running at the site offering this Airport Lookup service contains the three-letter codes and descriptions of more than 10 000 worldwide airports. We can look up the code for any airport code XYZ by doing an HTTP GET on the .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.