Home

Active XML User's Guide - Webdam Project

image

Contents

1. frequency lazy lastCalled 1082395879693 followedBy axml sc serviceNameSpace Crawler children elements lt axml sc gt This example only defines the frequency attribute You can see it as a typical Active XML Document that has never been loaded by a peer lt axml sc xmlns axml http www rocq inria fr verso AXML serviceURL http localhost 8080 axml servlet AxisServlet serviceNameSpace GetMatchingFeeds methodName invoke signature http localhost 8080 axml services GetMatchingFeeds wsdl useWSDLDefinition true frequency once am children elements lt axml sc gt 3 5 3 Service call result handling The way of treating the results of an Active XML Service Call can be specified by users Considering an XML document as an ordered labelled tree the results will be inserted as a sibling of the sc ele ment The behaviour is defined by two attributes Attribute Type Default Value Status mode string merge optional doNesting boolean false optional mode attribute This attribute specifies what to do with the results of an Active XML Service Call activation It can take two values default value is merge e merge e replace Merge defines that the results will be added as a sibling of the sc element while the previous results will be kept in the XML document too Replace means that the previous results will be replaced by the ones returned by the current
2. lt xsl output method text lt xsl template match gt lt xsl apply templates gt lt xsl template gt lt xsl template match bib gt lt xsl text gt amp lt bib since 1994 gt lt xsl1l text gt lt xsl for each select book gt lt xsl if test Qyear amp gt 1994 gt lt xsl apply templates select gt lt xsl if gt lt xsl1 for each gt lt xsl text gt amp lt bib gt lt xsl text gt lt xsl template gt lt xsl template match book gt lt xsl text gt amp lt book year lt xsl text gt lt xsl value of select year gt lt xsl text gt price lt xsl text gt lt xsl value of select price text gt lt xsl text gt gt lt xsl text gt lt xsl text gt amp lt title gt lt xsl text gt lt xsl value of select title text gt lt xsl text gt amp lt title gt lt xsl text gt lt xsl text gt amp lt book gt lt xsl text gt lt xsl template gt lt xsl stylesheet gt gt lt xslt gt lt definition gt lt serviceDefinition gt After calling that XSLT service the result will be the following lt bib axml origin 2270466F 89C2 0834 016B B7D952B36E3A axml timestamp 1125859312619 since 1994 gt lt book price 65 95 year 1994 gt lt title gt TCP IP Illustrated lt title gt lt book gt lt book price 39 95 year 2000 gt 12 lt title gt Data on the Web lt title gt lt book gt lt bib gt 3 4 4 Continuous services Continuous services enable the
3. If no frequency is defined the Service Call will not be activated by the Active XML Peer unless you explicitly evaluate it through the Active XML Web Interface Once means that the Service Call will be activated only once at start up time Note that every time you start or restart your Active XML Peer Service Calls with a frequency of once will be activated 16 Lazy means that a Service Call will only be activated when its results may be useful to the evaluation of a X OQL query or the instantiation of a Service Call Parameter defined through an XPath expression On Date specifies when exactly the Service Call will be activated The date format pattern is dd MM yy HH mm If the date has an incorrect format or if it is in the past the Service Call won t be activated For example frequency on 25 12 05 14 36 will activate the Service Call on the 25th December of 2005 at 14 36 every X means that the Service Call will be activated every X milliseconds For example frequency every 1800000 will activate the Service Call every 30 minutes callable attribute By setting the value of this attribute to false you can make a Service Call not being activated by the Active XML Peer even though it defines a correct call frequency lastCalled attribute This attribute is used by the Active XML Peer to keep track of the last activation of a Service Call to enforce the frequency when the Active XML Peer is restarted or the Active XML Document
4. an AXML document that invokes the Web service such as testGetATP xml 4 an docRepository xml file which consists of references to Active XML files in this example to testGetATP rml and ATPList xml lt xml version 1 0 gt lt mxbase gt lt forest name TestGetATP replicationIndex 0 gt lt file name href testGetATP xml gt lt forest gt lt forest name ATPList replicationIndex 0 gt lt file name href ATPList xml gt lt forest gt lt mxbase gt 5 an sucRepository xcmil file should contain the reference to Web services such as lt xml version 1 0 gt lt mxbase gt lt forest name GetATP replicationIndex 0 gt lt file name href GetATP xml gt lt forest gt lt mxbase gt As shown above the structure of docRepository zml and sucRepository xml files is quite simple The root element is named mzbase and the items of the repository are represented by a forest element In docRepository xml a forest is a logical document that may be composed of several physical XML or Active XML documents The name attribute of the forest element identifies the forest The relative path of each physical document can be specified by using the file element and its href attribute In sucRepository cml a forest is related to a Web service Consider now another example of the docRepository aml file where the forest named ATPList consists of the two files ATP1 aml and ATP2 aml lt xml version 1
5. lt name gt lt points gt 475 lt points gt lt player gt lt player gt lt name gt lt firstname gt Rafael lt firstname gt lt lastname gt Nadal lt lastname gt lt name gt lt points gt 313 lt points gt lt player gt lt ATPList gt Next a Web service including a X OQL query is defined X OQL is a query language for XML developed at INRIA The following service named GetATP uses a query which returns the firstname and the lastname for every player element in the ATPList cml document lt xml version 1 0 encoding IS0 8859 1 gt lt serviceDefinition type query gt lt definition gt lt query gt lt CDATAL select p name from p in ATPList player 1 gt lt query gt lt definition gt lt serviceDefinition gt See more details on defining Web services in section 3 4 with more examples of X OQL state ments given in 3 4 1 A call to the service GetATP is included into the following AXML document named test GetATP xml Generally an AXML document is a valid XML document where some particular elements labeled sc and associated with the axml namespace are interpreted as service calls lt xml version 1 0 encoding UTF 8 gt lt atp xmlns axml http www rocq inria fr verso AXML gt lt players gt lt axml sc frequency every 3600000 serviceNameSpace GetATP serviceURL http localhost 8080 axml servlet AxisServlet methodName GetATP mode replace gt lt axml1 params gt
6. be seen this can lead to many service calls including redundant ones 3 6 Customizing your Active XML Peer EXPLAIN WEB XML FILE PARAMETERS 21 APPENDIX A Continuous Services The process of turning a normal service into a continuous one can be seen as a wrapping of that service in a continuous service After a client sends a subscription request the behavior on server side consists of the following steps e calling the wrapped service from the continuous service e retrieving the results e sending the results back to the client s callback service We can also define services that process data after invoking the wrapped service and before sending the data to the client s callback service A typical example of such post processing is a service that returns the differences between a document and its previous version For the sake of simplicity the post processing services will not be further described in this document When using continuous services the repository on the server side should contain e a continuous service e a wrapped service e a post processing service optional Another option is to have a continuous service that contains for instance a wrapped query instead of invoking another service the wrapped service to execute the query See the continuous service ContinuousGetPlayerByRank xml that invokes the wrapped ser vice getPlayerByRank xm1 lt xml version 1 0 encoding UTF 8 gt lt
7. clients to subscribe to some information which will be periodically pushed to them by a server The functionality of the continuous services can be described by the following basic steps 1 The client sends a subscription request to the service provider which registers it 2 Periodically the service provider will do the following actions e Evaluate the subscription e Call a possible post processing service if it is specified to do so in the subscription e Call the client s callback service and send it the results 3 The client will periodically integrate the results by means of the callback service By using the continuous services the clients do not have to call the same service over and over again as often as they wish to receive the results On the other hand in a pull system the same request would be periodically sent over the network and generate an overhead Also it could happen that the data is not available for clients every time the service is called Thus the peer would be forced to evaluate the calls that it cannot respond to Another important limitation that is overcome by the continuous services system is the one given by the timeout of connections In our system a connection is open only when the client is demanding a subscription and every time the service result is available for the client The connection will be automatically closed after reaching the maximum allowed inactivity time interval For more details
8. invocation of the Active XML Service Call To keep track of the inserted results the Active XML system will add a special attribute to the top level elements of the results named origin and bound to the Active XML namespace http www rocq inria fr verso AX ML having as value the id attribute of the Active XML Service Call 18 doNesting attribute The tracking of inserted results described previously works well with ele ments but cannot be applied to TEXT nodes If you want to keep track of inserted TEXT nodes you can ask the Active XML Peer to nest the TEXT nodes in a special element named text and bound to the Active XML http www rocq inria fr verso AX ML like the following example lt axml text axml origin 038BD50A C353 D490 0082 D6033B1BA431 gt Hello World lt axml text gt ADD FUSION DESCRIPTION SYNTAX BEHAVIOUR AND EXAMPLES 3 5 4 Service call parameters The parameters of the Web Service that a Service Call references are specified by a child element of the sc element This element must be named params and bound to the Active XML namespace http www rocq inria fr verso AXML and also must be present even though the Web Service does not have any parameters This params element conforms to the following XML schema represen tation lt element name params gt lt complexType gt lt sequence gt lt element ref axml param minOccurs 0 maxOccurs unbounded gt lt sequence gt lt complexType gt lt e
9. 0 gt lt mxbase gt lt forest name ATP replicationIndex 0 gt lt file href ATP1 xm1 gt lt file href ATP2 xm1 gt lt forest gt lt mxbase gt If ATP1 zml is written as lt xml version 1 0 encoding UTF 8 gt lt atp1 gt lt player gt lt firstname gt Roger lt firstname gt lt lastname gt Federer lt lastname gt lt points gt 450 lt points gt lt player gt lt atp1 gt and ATP2 xmlis as follows lt xml version 1 0 encoding UTF 8 gt lt atp2 gt lt player gt lt firstname gt Rafael lt firstname gt lt lastname gt Nadal lt lastname gt lt points gt 313 lt points gt lt player gt lt atp2 gt then the following query notice that we use the name of the forest here ATP will return lt result gt lt atp1 gt lt player gt lt firstname gt Roger lt firstname gt lt lastname gt Federer lt lastname gt lt points gt 450 lt points gt lt player gt lt atp1 gt lt atp2 gt lt player gt lt firstname gt Rafael lt firstname gt lt lastname gt Nadal lt lastname gt lt points gt 313 lt points gt lt player gt lt atp2 gt lt result gt 3 3 Accessing your Active XML peer You can access the Web interface of your AXML peer by pointing your browser to hitp localhost 8080 arml You can then interact with your Active XML peer e access query and modify your AXML documents e manually activate AXML service calls e see and test your AX
10. Active XML User s Guide The Active XML team Contents 1 Introduction 2 Instalation 2 1 Download and install a Java Development Kit 2 2 Download and install the Tomcat 4 1 container 2 3 Download and install the Active XML framework Using Active XML 3 1 3 2 3 3 3 4 3 5 3 6 Basic concepts of Active XML 0 000 000 a Creating your Active XML peer 2 2 ee Accessing your Active XML peer 2 2 2 2 2 0002 eee Active XML web services o siitia a e i a e a a a e E A a 3 4 1 X OQL queries see aea a a ae ee ee e 3 4 2 Update services ooo a 3A XSLT A asa r R e aA ae e a a AEA 3 4 4 Continuous services oroa ai ark a k a p a O 3 4 5 Services written in Java 2 ee ea e a a A Active XML Service Call 2 2 d e ee en 3 5 1 Web service information 0 000002 eee 3 5 2 Service call information 0 0 0 000002 eee 3 5 3 Service call result handling 0 3 5 4 Service call parameters 2 0 0 2 ee Customizing your Active XML Peer 0200 A Continuous Services 1 Introduction Active XML http activerml net is a declarative framework for distributed data management based on XML and web services SOAP WSDL An Active XML document is an XML document that may contain calls to web services An Active XML peer is mainly a repository of Active XML documents It is both a client as a web services c
11. ByRank serviceURL http localhost 8080 axml servlet AxisServlet subscription true useDiff false 25 xmlns axml http www rocq inria fr verso AXML gt lt axml params gt lt axml param name rankNumber gt lt axml1 value gt 1 lt axml1 value gt lt axml param gt lt axml params gt lt axml sc gt lt player axml origin F379673B C353 D4DB 00B7 CD92ACD5E127 axml timestamp 1125317811997 gt lt name gt lt firstname gt Roger lt firstname gt lt lastname gt Federer lt lastname gt lt name gt lt citizenship gt Swiss lt citizenship gt lt rank gt 1 lt rank gt lt player gt lt test_compil_inline_cont gt The id and lastCalled attributes are generated by the system while the player element is in cluded in the document as an output of the wrapped service The system set the callable attribute to false For more details on continuous services see http activerml net reports internships emanuel_report pdf 26
12. L specific XML element is the Service Call sc element It is defined in the http www rocq inria fr verso AXML namespace and usually bound to the azml prefix The sc element defines the behaviour of an Active XML Service Call It is composed of a set of attributes and children XML elements defining e the Web Service to call e how and when to call it e what to do with the results e the call parameters 3 5 1 Web service information Attribute Type Default Value Status serviceURL anyURI required serviceNameSpace anyURI required methodName NCName required signature anyURI optional useWSDLDefinition boolean false optional 14 service URL attribute This attribute specifies the endpoint URL of the Web Service see the SOAP 1 1 TR 2 6 Ports 3 SOAP Binding 3 8 soap address 4 3 http address to call for example http apt google com search beta2 or http localhost 8080 axml servlet AxisServlet serviceNameSpace attribute This attribute specifies the namespace to use for the body element of the SOAP message see the SOAP 1 1 TR 3 5 soap body more simply the method namespace URL This information is provided in the WSDL of the Web Service For example urn GoogleSearch or GetMatchingFeeds methodName attribute This attribute defines the name of the operation to invoke on the Web Service see the WSDL 1 1 TR 2 4 Port Types for example doGoogleSearch Note that for an Active XML Web S
13. ML web services One can also use the provided Java Web Services such as PeerAccessPoint or DocumentRepos itory to e query AXML documents e retrieve save or remove AXML documents services e activate service calls via Web Service invocation 3 4 Active XML web services An Active XML peer is also a repository of Active XML web services An Active XML web service is defined in a declarative manner and can be of type e query e update e xslt e continuous written in Java 3 4 1 X OQL queries In order to explain some basic elements of X OQL syntax on different examples the ATP xmi file will be slightly modified lt xml version 1 0 encoding UTF 8 gt lt ATPList date 18042005 gt lt player rank 1 gt lt name gt lt firstname gt Roger lt firstname gt lt lastname gt Federer lt lastname gt lt name gt lt citizenship gt Swiss lt citizenship gt lt points gt 475 lt points gt lt player gt lt player rank 2 gt lt name gt lt firstname gt Rafael lt firstname gt lt lastname gt Nadal lt lastname gt lt name gt lt citizenship gt Spanish lt citizenship gt lt points gt 313 lt points gt lt player gt lt ATPList gt The basic syntax of X OQL can be illustrated by the following query select p name lastname from p in ATPList player where p rank 1 The query selects the lastname of the player who is at the first place of the ATP list The FROM clause binds the p variab
14. RL http localhost 8080 axml servlet AxisServlet subscription true useDiff false xmlns axml http www rocq inria fr verso AXML gt lt axml params gt lt axml param name rankNumber gt lt axm1 value gt 1 lt axml1 value gt lt axml param gt lt axml1 params gt lt axml sc gt lt test_compil_inline_cont gt Note the following details in the AXML file shown above e The value of the subscription attribute should be set to true e The frequency should be set to once a subscription is started only once e SOAP parameters of the continuous service we wish to subscribe to are specified e The way of inserting the result into the document is defined e A set of optional parameters can be defined Atribute useDiff specifies whether we want to use the post processing service or not by setting the value for useDiff to true The desiredFrequency attribute specifies the desired time interval for receiving the results from the continuous service e Finally the AXML file should be added to docRepository xm1 lt forest name TestCompilInLineCont replicationIndex 0 gt lt file name _href testCompilInLineCont xml gt lt forest gt After subscribing the AXML will look like this lt axml sc callable false desiredFrequency 60000 frequency once id 175F6799 C353 D4DB 014B O03EAA1F6AB06 lastCalled 1125673561153 methodName doSubscribe mode merge serviceNameSpace ContinuousGetPlayer
15. The entry point on the client s peer for the data sent by the server is the callback service It deals with the integration of received data in the client application The result of the service will be inserted as a sibling of a service call s node When using continuous services the repository on the client side contain e a callback service e an AXML file that calls a continuous service The callback service CallbackService xml lt xml version 1 0 encoding IS0 8859 1 gt lt serviceDefinition name CallbackService type callback gt lt definition gt lt transformService URL methodName nameSpace gt lt integratorService URL methodName nameSpace gt lt definition gt lt serviceDefinition gt In this simple example no transformation post processing service and no integrator service is specified The callback service should be referenced in svcRepository xml1 lt forest name CallbackService replicationIndex 0 gt lt file name href CallbackService xml gt lt forest gt The continuous service is called from an AXML file testCompilInLineCont xml lt xml version 1 0 encoding UTF 8 gt lt test_compil_inline_cont axml docName TestCompilInLineCont xmlns axml http www rocq inria fr verso AXML gt lt axml sc callable true 24 desiredFrequency 60000 frequency once methodName doSubscribe mode merge serviceNameSpace ContinuousGetPlayerByRank serviceU
16. a user interface at http localhost 8080 axml The same can be achieved by using the Eclipse environment and its plugin for Tomcat In this case you just need to declare that Copy of is a Tomcat project if by default it is not the one If this part fails and the peer is not available at the mentioned address you can consult the logs of Tomcat to see what exactly went wrong You can consult them either from the logs directory of Tomcat or from the logging window of Eclipse if Eclipse was used to start restart Tomcat Finally if you want to use continuous services see 3 4 4 as a client you will need to mod ify the value of the azml peer url parameter in the web xml file in the Copy of Active XML webapp arml WEB INF directory by entering the correct address of your peer instead of local host 3 Using Active XML 3 1 Basic concepts of Active XML In Active XML AXML for short parts of data are given explicitly while other parts consist of calls to Web services that generate more data AXML is an XML dialect Let us consider an example where an AXML document invokes a service call which consists of a query on another XML document First an XML document representing a short ATP list ATPList zml of tennis players is specified lt xml version 1 0 encoding UTF 8 gt lt ATPList date 18042005 gt lt player gt lt name gt lt firstname gt Roger lt firstname gt lt lastname gt Federer lt lastname gt
17. and some examples on continuous services see Appendix A 3 4 5 Services written in Java Users can also create their own services written in Java and those services can be invoked from AXML documents The services can be anywhere in the CLASSPATH Let us create for instance aa simple class Salut and store it in the Active XML project package fr inria gemo axml service webservices public class Salut String hello Salut public Object greeting return hello 13 After creating this service the axml jar file should be updated Then the server config wsdd file in Copy of ActiveX ML webapp axml WEB INF should be modified by adding a new service tag for the Salut service lt service name Salut provider java RPC gt lt parameter name allowedMethods value greeting gt lt parameter name className value fr inria gemo axml service webservices Salut gt lt parameter name scope value application gt lt service gt To invoke this service written in Java we need an AXML document like the one below lt xml version 1 0 encoding UTF 8 gt lt salut axml docName TestGreeting xmlns axml http www rocq inria fr verso AXML gt lt sayHello gt lt axml sc methodName greeting serviceNameSpace Salut serviceURL http localhost 8080 axml servlet AxisServlet gt lt axml sc gt lt sayHello gt lt salut gt 3 5 Active XML Service Call The main Active XM
18. e XML document well formed The value parameter conforms to the following schema component representation lt element name value gt lt complexType mixed true gt lt sequence gt lt any namespace any minOccurs 0 maxOccurs unbounded gt lt sequence gt lt complexType gt lt element gt For example to call a currency converter Web Service taking as inputs from and to as currency element you would write the following parameters lt axml params gt lt axml param name from gt lt axml value gt lt currency symbol EUR gt 1 lt currency gt lt axml value gt lt axml param gt lt axml param name to gt lt axml value gt lt currency symbol USD gt 1 lt currency gt lt axml value gt lt axml param gt lt axml1 params gt XPath parameter The other way of writing an Active XML parameter is through an XPath expression and conforming to the following schema component representation lt element name xpath gt lt simpleType gt lt restriction base xsd string gt lt whiteSpace value collapse gt lt minLength value 1 gt lt restriction gt lt simpleType gt lt element gt 20 An XPath parameter is considered by the system as being non concrete and its evaluation is done upon need Thus every time a Service Call is activated the XPath parameters will be evaluated The evaluation of an XPath expression may return several values In that case a cross product w
19. ervice a declarative Web Service provided by an Active XML Peer the value of the methodName attribute is not important By convention we use invoke but any other name can be used signature attribute This attribute sets the URL of the WSDL file defining the Web Service It is optional and is only used if you want to do type validation on that particular Service Call For example http api google com GoogleSearch wsdl useWSDL Definition attribute This attribute specifies if the WSDL file defined by the signa ture attribute should be used for type validation It is an optional boolean attribute and its default value is false Examples The following example shows how to define the Web service related information to call the GoogleS earch Web service and especially the doGoogleSearch operation Note that it spec ifies type validation If you do not want to validate types you can just omit the signature and use WSDL Definition attributes lt axml sc xmlns axml http www rocq inria fr verso AXML serviceURL http api google com search beta2 serviceNameSpace urn GoogleSearch methodName doGoogleSearch signature http api google com GoogleSearch wsdl useWSDLDefinition true Lee children elements lt axml sc gt This other example shows how to define the Web service related information to call an Active XML Web service As the previous example it specifies type validation lt axml sc xmlns axml http www rocq in
20. ill be done with all the values of the different parameters of your Service Call and will actually call the Web Service as many times as required To better understand this consider a Currency Converter web service and the following example of AXML document lt xml version 1 0 encoding UTF 8 gt lt currencies xmlns axml http www rocq inria fr verso AXML gt lt currency symbol EUR gt 1 lt currency gt lt currency symbol GBP gt 1 lt currency gt lt currency symbol CHF gt 1 lt currency gt lt currency symbol USD gt 1 lt currency gt lt axml sc serviceURL http www some url com services serviceNameSpace urn CurrencyConverter methodName convert frequency every 1800000 gt lt axml params gt lt axml param name from gt lt axml xpath gt currency lt axm1 xpath gt lt axml1 param gt lt axml param name to gt lt axml xpath gt currency lt axml xpath gt lt axml1 param gt lt axml params gt lt axml sc gt lt currencies gt After the evaluation of the instantiation of the two parameters i e evaluation of the XPath expressions the following invocations will be performed conv conv GBP EUR conv CHF EUR conv USD EUR cony EUR GBP conv GBP GBP conv CHF GBP conv USD GBP conv conv EUR CHF conv GBP CHF conv CHF CHF conv USD CHF conv EUR USD conv GBP USD conv CHF USD conv USD USD As can
21. itle gt lt author gt lt last gt Stevens lt last gt lt first gt W lt first gt lt author gt lt publisher gt Addison Wesley lt publisher gt lt price gt 65 95 lt price gt lt book gt lt book year 1992 gt lt title gt Advanced Programming in the Unix environment lt title gt lt author gt lt last gt Stevens lt last gt lt first gt W lt first gt lt author gt lt publisher gt Addison Wesley lt publisher gt lt price gt 65 95 lt price gt lt book gt lt book year 2000 gt lt title gt Data on the Web lt title gt lt author gt lt last gt Abiteboul lt last gt lt first gt Serge lt first gt lt author gt lt author gt lt last gt Buneman lt last gt lt first gt Peter lt first gt lt author gt lt author gt lt last gt Suciu lt last gt lt first gt Dan lt first gt lt author gt lt publisher gt Morgan Kaufmann Publishers lt publisher gt lt price gt 39 95 lt price gt lt book gt lt bib gt The XSLT service below takes the document describing books It filters out the books published before the year 1994 It also does some restructuring it transforms price elements into attributes and keeps only book titles author and publisher data is left out lt serviceDefinition type xslt gt 11 lt parameters gt lt param name bib gt lt parameters gt lt definition gt lt xslt gt lt CDATAL lt xsl stylesheet version 1 0 xmlns xsl http www w3 org 1999 XSL Transform gt
22. l net xoql documentation index html 3 4 2 Update services These Active XML services can be used to perform updates on documents of the peer s repository We define them by using a simple update language implemented on top of X OQL The definition of an update service will have two parts both consisting of X OQL queries e a location part defining the document nodes on which an update will be performed e a data part along with an action replace delete or insert Depending on the specified action one of the following activities will take place at each of the nodes selected by the location part as a relative root e deleting the piece of data selected by the location part e replacing it by the piece of data returned constructed by the data part e inserting the piece of data returned constructed by the data part Example 1 A replace service that changes the value of the social security number for a certain patient in a medical file lt serviceDefinition type update gt lt definition gt lt action type replace gt lt data gt lt SSN gt 123 555 1234 lt gt lt data gt lt location gt select y from x in PatientFiles patientData y in x SSN where x patientID 5 lt location gt lt action gt lt definition gt lt serviceDefinition gt Example 2 A service that removes a patient lt serviceDefinition type update gt lt definition gt l
23. le to each player element in the document The WHERE clause selects the elements that satisfy the given filter In this query it is the value of rank which is an atribute of the player element The result of the query is lt result gt lt lastname gt Federer lt lastname gt lt result gt In the following query the WHERE clause is composed of two conditions considering the values of elements citizenship and points select p name lastname p points from p in ATPList player where p citizenship Spanish and p points gt 300 The result consists of the lastname and points of the player satisfying both conditions of the given filter lt result gt lt lastname gt Nadal lt lastname gt lt points gt 313 lt points gt lt result gt The next example shows the construction of elements in X OQL The player element will be constructed having points and rank as attributes and firstname and lastname by using the following statement select lt player points p points rank p rank gt p name firstname p name lastname lt gt from p in ATPList player The result is lt result gt lt player points 475 rank 1 gt lt firstname gt Roger lt firstname gt lt lastname gt Federer lt lastname gt lt player gt lt player points 313 rank 2 gt lt firstname gt Rafael lt firstname gt lt lastname gt Nadal lt lastname gt lt player gt lt result gt For more information about X OQL see http activerm
24. lement gt If your Web Service has no input parameter you would just write an empty params element like lt axml sc gt lt axml params gt lt axml sc gt An Active XML Parameter is defined by the param element bound to the Active XML namespace http www rocq inria fr verso AXML and can be expressed as a value or through an XPath ex pression The Active XML parameter is either a value or a xpath parameter according to the following schema component representation lt element name param gt lt complexType gt lt choice gt lt element ref axml xpath gt lt element ref axml value gt lt choice gt lt attribute name name type xsd NCName use required gt lt complexType gt lt element gt 19 The param element has only one required attribute named name specifying the name of this parameter The value of this attribute must conform to the name of a web service parameter referenced by the Active XML Service Call Note that if your Active XML Service Call has several parameters they must be in the correct order as defined by the web service WSDL file Value parameter The first way of writing an Active XML parameter is through a value This value can be any well formed XML fragment If you need to define an Active XML parameter as an A XML document including the prolog part see http www w8 org TR 2004 REC aml1 1 20040204 NT prolog we recommend using a CDATA section to keep your Activ
25. lt axml sc gt lt players gt lt atp gt In this example the service call will be activated every hour frequency is set to 3600000 miliseconds and the previous results will be replaced by the ones returned by the current service invocation mode replace For more details on service definition see section 3 5 After the service invocation the end of the AXML document below the axzml sc element will look like this lt name gt lt firstname gt Roger lt firstname gt lt lastname gt Federer lt lastname gt lt name gt lt name gt lt firstname gt Rafael lt firstname gt lt lastname gt Nadal lt lastname gt lt name gt lt players gt lt atp gt For the sake of simplicity some attributes that are automatically generated during the service invocation namely origin and timestamp were not shown in the last XML document 3 2 Creating your Active XML peer As said in the introduction of this document an Active XML peer is mainly a repository of Active XML documents An Active XML document is a well formed XML document that may contain calls to Web services The repository of the Active XML peer is located in the repository directory in your Active XML installation In order to publish a Web service that contains a query and to call the service from an AXML document the repository directory should contain 1 an XML document that will be queried such as ATPList xml 2 a Web service like GetATP 3
26. mum subscription interruption time It limits the time in terval for saving consecutive results In other words it defines for how long the results of a service will be saved in the case that a client is connected to the server maxzClientsNo maximum number of subscribers e In this example the transform service i e post processing service is not specified e In the continuous service above by using the baseService tag the wrapped service named getPlayerByRank is called The wrapped service getPlayerByRank xml is shown below lt xml version 1 0 encoding UTF 8 gt lt coreServiceDefinition type query gt lt parameters gt lt param name rankNumber gt lt parameters gt lt definition gt lt query gt lt CDATA select lt player gt p name p citizenship p atp rank lt gt from p in ATPRace player where p atp rank rankNumber gt lt query gt lt definition gt lt coreServiceDefinition gt 23 After writing the wrapped service and the continuous service the references to them should be added to svcRepository xml lt forest name GetPlayerByRank replicationIndex 0 gt lt file name _href GetPlayerByRank xml gt lt forest gt lt forest name ContinuousGetPlayerByRank replicationIndex 0 gt lt file name _href ContinuousGetPlayerByRank xml gt lt forest gt After subscribing to the continuous service the client will start receiving periodical results
27. onsumer and a provider of declarative web services A service can be defined for example as a query over a stored XML document or an update of the document The use of calls to web services embedded in documents allows to dynamically update data and also to control frequency of these updates and durability of the information The peers can exchange intensional data i e data defined as calls to Web services Thus each Active XML peer acquire and provide dynamic information in a decentralised peer to peer architecture This user s guide presents the basic steps of installation of the Active XML framework the main concepts of the system and describes the definition usage and management of Active XML documents and different kinds of Web services 2 Instalation The Active XML framework is provided as a web application for a Servlet 2 3 JSP 1 2 container like Tomcat 4 1 http jakarta apache org tomcat You should also be able to get it working with other containers like Jetty http jetty mortbay org Orion http www orionserver com or Resin http www caucho com This section describes its installation with the Tomcat 4 1 container The steps needed to install and use the Active XML framework are as follows 2 1 Download and install a Java Development Kit The first step is to download a Java Development Kit JDK release version 1 4 or later from http java sun com j2se Make sure it is a JDK and not a Java Runtime En
28. reloaded after modifications It is set by the system and you should not specify it unless you are sure of what you are doing For implementation reasons the value should be less than 9223372036854775807 followedBy attribute This attribute allows to chain a very simple kind of workflow evaluation of Service Calls inside the same Active XML Document The value of this attribute must be an XPath expression returning a single sc element or the id attribute of a Service Call For example followedBy axml1 sc serviceNameSpace XSLT_BIB_QUERY specifies that right after the activation of the current Service Call is completed the Service Call with the serviceNameSpace attribute set to XSLT_BIB_QUERY should be activated Examples The following examples extend the ones presented in the previous section with the Service Call related information presented in this section This example defines the id name frequency lastCalled and followedBy attributes Remem ber that the id and lastCalled are generated by the Active XML Peer and are provided here for information purpose only you should never define them yourself lt axml sc xmlns axml http www rocq inria fr verso AXML serviceURL http api google com search beta2 serviceNameSpace urn GoogleSearch methodName doGoogleSearch signature http api google com GoogleSearch wsdl useWSDLDefinition true id 038BD50A C353 D490 0082 D603FA7A81AC 17 name GoogleSearch
29. ria fr verso AXML serviceURL http localhost 8080 axml servlet AxisServlet serviceNameSpace GetMatchingFeeds methodName invoke 15 signature http localhost 8080 axml services GetMatchingFeeds wsdl useWSDLDefinition true Lae children elements lt axml sc gt 3 5 2 Service call information DESIREDFREQUENCY FORWARDINGLIST A sc element also provides information on how and when to activate the service call through the following attributes Attribute Type Default Value Status id ID generated name string optional frequency string optional callable boolean true optional lastCalled unsignedLong generated followedBy string optional id attribute The id attribute identifies uniquely over time and space a Service Call You should not define it manually to insure its uniqueness the Active XML system will generate it automatically and make it persistent Its value is restricted to the pattern 0 9 A F 8 0 9 A F 4 0 9 A F 4 0 9 A F 4 0 9 A F 12 name attribute This attribute specifies the name of a Service Call It has no specific meaning and thus is optional It is kept to ensure backward compatibility but may be totally ignored in future releases frequency attribute This attribute defines when the Service Call will be activated unless the callable attribute is set to false It can have several values e once e lazy e on Date e every X
30. serviceDefinition name ContinuousGetPlayerByRank type continuous gt lt Continous service parameters gt lt parameters gt lt param name rankNumber gt lt parameters gt lt definition gt lt Non continuous service location gt lt baseService URL http localhost 8080 axm1 servlet AxisServlet methodName getPlayerByRank nameSpace GetPlayerByRank gt lt Result transformation service Post Processing Service lt transformService URL methodName nameSpace gt lt Frequency Settings gt 22 lt frequency default 60000 max 10000 gt lt Subscription Settings gt lt subscription maxLifeTime 8640000 maxSuspensionTime 86400 maxClientsNo 15000 gt lt definition gt lt serviceDefinition gt Note the following details in the continuous service shown above e The response frequency is specified by the frequency element In this example the wrapped service will be invoked by default every minute 60000 ms while the maximum allowed frequency i e minimum time period that a client can ask for is every 10 seconds 10000 ms e The subscription element is used to impose subscription related restrictions mazLifeTime maximum subscription validity time For instance a provider can allow free subscription for one month After that the clients that would like to continue using the service would have to pay for their subscription mazSuspensionTime maxi
31. t action type delete gt lt data gt lt data gt lt location gt select x from x in PatientFiles patientData where x patientID 5 lt location gt lt action gt lt definition gt lt serviceDefinition gt Example 3 A service that constructs a visit element using data from one document and inserts it in another document lt serviceDefinition type update gt lt definition gt lt action type insert gt lt data gt select lt visit patientID 5 gt y gt lt notes gt Some notes lt gt lt gt from x in PatientFiles patientData y in x visit where x patientID 5 10 lt data gt lt location gt MedicalFiles patientVisits lt location gt lt action gt lt definition gt lt serviceDefinition gt 3 4 3 XSLT X OQL is not the only data management language that can be used to define Active XML service Similarly to X OQL query services we can define XSLT services specified by a template The service will return the piece of data that is constructed by the template The template will be applied on data is passed as parameter and not on repository data as in the case of services defined as X OQL services We will show an example to clarify these type of AXML services First see the following XML document containing book elements lt bib axml docName BIB xmlns axml http www rocq inria fr verso AXML gt lt book year 1994 gt lt title gt TCP IP Illustrated lt t
32. vironment JRE Install the JDK according to the instructions included with the release 2 2 Download and install the Tomcat 4 1 container The second step is to download a binary distribution of Tomcat 4 1 from http jakarta apache org tomcat and install it according to the instructions included with the release Make sure to test it before going on with the installation of the Active XML framework 2 3 Download and install the Active XML framework ActiveXML is now an Open Source project The latest CVS version of the project containing Source code binaries and a sample webapp is available for download at http forge objectweb org projects activerml in the CVS part There are several directories in this package e Active XML and Gemo Utilities containing the source code of Active XML e XOQL and CDQA containing the source code of the XML repository and query language that are mainly used in Active XML e Copy of Active XML webapp which contains a sample webapp with documents services and examples for all the main features of Active XML e Java Libs containing jars that are used by the various projects e ActiveX ML Light Client the Mozilla plugin of the client for ActiveX ML peers To install an Active XML peer on a machine copy the directory Copy of Active XML we bapp axml in the webapps directory of Tomcat Restart Tomcat and your peer will be available via

Download Pdf Manuals

image

Related Search

Related Contents

Honeywell Thermostat RLV4300 User's Manual  Guia de Administração do Symantec™ IT Management Suite 7.5  Manuel d`utilisation  物理化学処理方式実証試験計画  Triarch Hanging Fixture 33164 User's Manual  Rexel Mesh Bags  ToolMap User Manual  2053-2 (546.5KB)  

Copyright © All rights reserved.
Failed to retrieve file