Perl Cd Bookshelf [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Perl Cd Bookshelf [Electronic resources] - نسخه متنی

Mark V. Scardina, Ben ChangandJinyu Wang

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






Extending the Application’s Functionality


As you should have seen, this use of a master schema with Oracle Streams AQ and SOAP is quite powerful functionality yet simple in its configuration. Adding new customers is simply a matter of adding new types to your master schema. Performance is not affected because additional elements and attributes are looked up efficiently by using hash tables. Note however, that the client schema may be complex in situations where the types you need are not at the top level. This is not a problem, because the application won’t get the mode change signal from LAX to STRICT until the validator encounters the known type, no matter how buried it is. There are several features or conditions you may need to accommodate. We will close the chapter with a brief discussion of these.


Submitting SOAP Messages


Thus far, we have covered only the processing of SOAP-based POs, not the generation of them. Generation can be done in several ways, but a very easy method is to do it as part of the PO generation process. For example, you could use the XDK JAXB Class Generator to create a set of classes corresponding to your PO schema and use this code in a JSP- or XSQL-based web form to generate both the SOAP message and its PO content. An example of such an XSQL page is included in the book’s downloadable source code.


Handling of xsi:types in POs


XML Schema allows users to override built-in types by adding xsi:type annotations to attributes within the instance document. These attributes must be retrieved differently in your getAttributeName() method because of their reserved status. The following code will retrieve them:

if (currNode.getNodeType() == TYPE)
XSDAttribute[] attrNode = currNode.getAttributeDeclarations();

Conveying type overrides in an instance document is not a good design practice and thus should be avoided.


Generating an E-Mail Confirmation


Even though a user has received a transaction confirmation from AQ, it would be useful to provide to the user a notification of successful or failed PO processing. This functionality is built into AQ’s AQXmlRegister() and AQXmlCommit() methods, so you can set up a mail URL such as the following to notify users upon commit:

<?xml version="1.0"?>
<Envelope xmlns= "http://ns.oracle.com/AQ/schemas/envelope">
<Body>
<AQXmlRegister xmlns = "http://ns.oracle.com/AQ/schemas/access">
<register_options>
<destination>AQUSER.EMP_TOPIC</destination>
<consumer_name>WHIRLIGIG</consumer_name>
<notify_url>mailto:bob.smith@hotmail.com</notify_url>
</register_options>
<AQXmlCommit/>
</AQXmlRegister>
</Body>
</Envelope>

/ 218