ࡱ > k l m n o p q r s D
z !` 0 Y bjbj\\ 8 > > R 8 8 70 | 8 " " T , / / / / / / / $ '2 h 4 / E @ L P @ @ @ / v / @ | / @ / r T t
p 4 j& 0 0 70 z 5 5 t
t
F 5 2 v T D @ 2 2 2 / / d 2 2 2 70 @ @ @ @ $ W c Q c XML Schema and WSDL Support in Tersus
October 4th, 2006
TOC \o "1-3" \h \z \u HYPERLINK \l "_Toc147468965" Overview PAGEREF _Toc147468965 \h 2
HYPERLINK \l "_Toc147468966" Simple Examples PAGEREF _Toc147468966 \h 2
HYPERLINK \l "_Toc147468967" Sample XML Schema Import PAGEREF _Toc147468967 \h 2
HYPERLINK \l "_Toc147468968" Sample WSDL Import PAGEREF _Toc147468968 \h 3
HYPERLINK \l "_Toc147468969" XML Schema PAGEREF _Toc147468969 \h 3
HYPERLINK \l "_Toc147468970" Import Rules PAGEREF _Toc147468970 \h 3
HYPERLINK \l "_Toc147468971" Built-In Packages PAGEREF _Toc147468971 \h 5
HYPERLINK \l "_Toc147468972" Notes PAGEREF _Toc147468972 \h 5
HYPERLINK \l "_Toc147468973" Not Supported Yet PAGEREF _Toc147468973 \h 5
HYPERLINK \l "_Toc147468974" Formatting of date & dateTime PAGEREF _Toc147468974 \h 6
HYPERLINK \l "_Toc147468975" Open Issues PAGEREF _Toc147468975 \h 7
HYPERLINK \l "_Toc147468976" WSDL P A G E R E F _ T o c 1 4 7 4 6 8 9 7 6 \ h 7
H Y P E R L I N K \ l " _ T o c 1 4 7 4 6 8 9 7 7 " I m p o r t R u l e s P A G E R E F _ T o c 1 4 7 4 6 8 9 7 7 \ h 7
H Y P E R L I N K \ l " _ T o c 1 4 7 4 6 8 9 7 8 " S e r v i c e s P A G E R E F _ T o c 1 4 7 4 6 8 9 7 8 \ h 7
H Y P E R L I N K \ l " _ T o c 1 4 7 4 6 8 9 7 9 " S O A P B i n d i n g P A G E R E F _ T o c 1 4 7 4 6 8 9 7 9 \ h 8
H Y P E R L I N K \ l " _ T o c 1 4 7 4 6 8 9 8 0 " H T T P B i n d i n g P A G E R E F _ T o c 1 4 7 4 6 8 9 8 0 \ h 9
H Y P E R L I N K \ l " _ T o c 1 4 7 4 6 8 9 8 1 " S a m p l e I m p o r t e d S e r v i c e s P A G E R E F _ T o c 1 4 7 4 6 8 9 8 1 \ h 9
H Y P E R L I N K \ l " _ T o c 1 4 7 4 6 8 9 8 2 " N o t S u p p o r t e d Y e t P A G E R E F _ T o c 1 4 7 4 6 8 9 82 \h 10
HYPERLINK \l "_Toc147468983" Invoking SOAP Web Services PAGEREF _Toc147468983 \h 10
HYPERLINK \l "_Toc147468984" Not Supported Yet PAGEREF _Toc147468984 \h 14
HYPERLINK \l "_Toc147468985" Invoking HTTP Web Services PAGEREF _Toc147468985 \h 14
HYPERLINK \l "_Toc147468986" XML Parsing PAGEREF _Toc147468986 \h 15
HYPERLINK \l "_Toc147468987" Sample Project PAGEREF _Toc147468987 \h 17
HYPERLINK \l "_Toc147468988" Forex PAGEREF _Toc147468988 \h 17
HYPERLINK \l "_Toc147468989" Holidays PAGEREF _Toc147468989 \h 18
HYPERLINK \l "_Toc147468990" PayPal PAGEREF _Toc147468990 \h 18
HYPERLINK \l "_Toc147468991" Weather PAGEREF _Toc147468991 \h 18
HYPERLINK \l "_Toc147468992" Appendix style and use PAGEREF _Toc147468992 \h 19
HYPERLINK \l "_Toc147468993" Encoded vs. Literal PAGEREF _Toc147468993 \h 19
HYPERLINK \l "_Toc147468994" RPC vs. Document PAGEREF _Toc147468994 \h 19
HYPERLINK \l "_Toc147468995" RPC PAGEREF _Toc147468995 \h 19
HYPERLINK \l "_Toc147468996" Document PAGEREF _Toc147468996 \h 19
HYPERLINK \l "_Toc147468997" Literal Document Example 1 PAGEREF _Toc147468997 \h 19
HYPERLINK \l "_Toc147468998" Sample Request PAGEREF _Toc147468998 \h 19
HYPERLINK \l "_Toc147468999" Corresponding WSDL Definitions PAGEREF _Toc147468999 \h 20
HYPERLINK \l "_Toc147469000" Literal Document Example 2 PAGEREF _Toc147469000 \h 20
HYPERLINK \l "_Toc147469001" Sample Request PAGEREF _Toc147469001 \h 20
HYPERLINK \l "_Toc147469002" Corresponding WSDL Definitions PAGEREF _Toc147469002 \h 21
HYPERLINK \l "_Toc147469003" Encoded RPC Example PAGEREF _Toc147469003 \h 22
HYPERLINK \l "_Toc147469004" Sample Request PAGEREF _Toc147469004 \h 22
HYPERLINK \l "_Toc147469005" Corresponding WSDL Definitions PAGEREF _Toc147469005 \h 22
HYPERLINK \l "_Toc147469006" Literal RPC Example PAGEREF _Toc147469006 \h 22
HYPERLINK \l "_Toc147469007" Encoded Document PAGEREF _Toc147469007 \h 23
Overview
Tersus allows the importing of XML Schema definitions is general (.xsd files), as well as WSDL definitions.
The definitions are imported as Tersus models, which can then be used within the Tersus Studio like any other Tersus model:
XML Schema definitions of elements and attributes are imported as Data Models.
WSDL definitions are imported as Process Models (Services).
A typical use case would be to import a WSDL definition file after importing XML Schema definitions on which it depends, and then use the models of the imported services to invoke the Web Services from a Tersus application.
To import a definition file, use the Import WSDL wizard. In the Tersus Studio, select the project into which you want to import, choose File(Import, select Import WSDL (under Other), and press Next. Then provide the URL of the imported definition file and press Finish.
Simple Examples
Sample XML Schema Import
XML SchemaTersus Model
Fault reporting structure
EMBED PBrush
Sample WSDL Import
WSDL
Tersus Model
EMBED PBrush XML Schema
Import Rules
All imports are made into sub-packages of the package XML in the Tersus model repository.
An XSD element (e.g. a data type) is imported as a data model in a package that corresponds to the elements namespace. For example, all elements in the namespace HYPERLINK "http://schemas.xmlsoap.org/soap/envelope/" http://schemas.xmlsoap.org/soap/envelope/ are imported into the package XML/schemas.xmlsoap.org/soap/envelope.
Each type of XSD element is imported as a corresponding data model (Data Type):
XSD ElementCorresponding Tersus Model HYPERLINK "http://www.w3schools.com/schema/el_simpletype.asp" simpleTypeAtomic Data Type (Data Item) HYPERLINK "http://www.w3schools.com/schema/el_complextype.asp" complexTypeComposite Data Type (Data Structure) HYPERLINK "http://www.w3schools.com/schema/el_attribute.asp" attributeData Type (whose name starts with a #):
If a local attribute (only used by its parent element), Data Element within the parent data type
If a global attribute (can be referenced from anywhere), a Data Type within a special package named (Attributes) [should actually be imported as a Data Element rather than a Data type, as we do with global elements, but this bug has not been corrected yet] HYPERLINK "http://www.w3schools.com/schema/el_element.asp" elementData Element (an element of a Data Structure):
If a local element (only used by its parent element), Data Element within the parent data type
If a global element (can be referenced from anywhere), a Data Element within a special model named (Elements)Schema data types can be derived from other types, and there are multiple legal constructs. The following are the typical cases:
XSD Element HierarchyCorresponding Tersus Data Model HYPERLINK "http://www.w3schools.com/schema/el_simpletype.asp" simpleTypeAtomic Data Type (Data Item) HYPERLINK "http://www.w3schools.com/schema/el_complextype.asp" complexType, HYPERLINK "http://www.w3schools.com/schema/el_simpleContent.asp" simpleContentData Structure (Atomic Data Type + attributes) [The content element is represented by a data element named (Content), see for example in HYPERLINK "http://www.sdmx.org/data/SDMXQuery.xsd" http://www.sdmx.org/data/SDMXQuery.xsd] HYPERLINK "http://www.w3schools.com/schema/el_complextype.asp" complexType, HYPERLINK "http://www.w3schools.com/schema/el_complexcontent.asp" complexContent
Data Structure (derived from a base type) HYPERLINK "http://www.w3schools.com/schema/el_complextype.asp" complexType, HYPERLINK "http://www.w3schools.com/schema/el_complexcontent.asp" complexContent, HYPERLINK "http://www.w3schools.com/schema/el_sequence.asp" sequenceData Structure (derived from a base type + new attributes and/or elements) HYPERLINK "http://www.w3schools.com/schema/el_complextype.asp" complexType, HYPERLINK "http://www.w3schools.com/schema/el_sequence.asp" sequenceData Structure (all attributes and elements are defined here)Each data model is created with a (shared) xml.namespace property containing its namespace (e.g. 'urn:ebay:apis:eBLBaseComponents). If the namespace of data element differs from the namespace of its data type, the data element has a (local) xml.namespace property as well (e.g. from HYPERLINK "http://schemas.xmlsoap.org/soap/envelope/" http://schemas.xmlsoap.org/soap/envelope/ is imported as a data element with xml.namespace = http://schemas.xmlsoap.org/soap/envelope/, which refers to a data type QName with xml.namespace = http://www.w3.org/2001/XMLSchema).
The multiplicity of an imported data element is determined by the minOccurs and maxOccurs attributes of the imported schema element. If maxOccurs is greater than 1, the data element is marked as repetitive. If minOccurs is greater than 0, the data element is marked as mandatory.
Note that models created by the Import WSDL wizard are consistent with the models created by the HYPERLINK "http://sourceforge.net/forum/message.php?msg_id=3791687" Import XML Data Structure by Example wizard (except for namespaces, which are not supported yet by Import XML Data Structure by Example). In both cases, parsing of XML documents can be made by the Parse XML plug-in (see XML Parsing below).
Built-In Packages
The schema of XML Schema itself ( HYPERLINK "http://www.w3.org/2001/XMLSchema.xsd" http://www.w3.org/2001/XMLSchema.xsd), which includes the definitions of data types used by other XML Schemas, is provided as a built-in Tersus package XML/www.w3.org/2001/XMLSchema. Note that types not supported by Tersus (e.g. HYPERLINK "http://xmlbeans.apache.org/samples/DateTime.html" duration) are represented as Text data items.
Additional schemas have also been imported through the Import WSDL wizard and are provided as built-in Tersus packages:
Definition FileCorresponding Tersus Package(s)http://www.w3.org/2001/xml.xsdXML/www.w3.org/XML/1998/namespacehttp://schemas.xmlsoap.org/soap/envelope/XML/schemas.xmlsoap.org/soap/envelope HYPERLINK "http://schemas.xmlsoap.org/soap/encoding/" http://schemas.xmlsoap.org/soap/encoding/XML/schemas.xmlsoap.org/soap/encodingNotes
Colons are not allowed as part of a package name in Tersus. Therefore, when importing a namespace that contains colons, they are converted to slashes. For example, all elements in the namespace urn:ebay:apis:eBLBaseComponents are imported into the package XML/ebay/apis/eBLBaseComponents.
Usually, the name of an imported data element (an element of a data structure) is the name of the imported schema element (e.g. from HYPERLINK "http://schemas.xmlsoap.org/soap/envelope/" http://schemas.xmlsoap.org/soap/envelope/ is imported as a data element named faultcode). This might create data elements with duplicate names within the same parent data structure if a composite schema type contains elements with the same name from different namespaces. In such a case, the name of each data element is prefixed by a pseudo namespace alias, just to differentiate it from its brother elements (e.g. in HYPERLINK "http://www.sdmx.org/data/SDMXMessage.xsd" http://www.sdmx.org/data/SDMXMessage.xsd contains 4 child elements named DataSet, each from another namespace. It is imported as a data structure with 4 child elements named 1:DataSet, 2:DataSet, 3:DataSet and 4:DataSet).
Not Supported Yet
HYPERLINK "http://www.w3schools.com/schema/el_import.asp" import and HYPERLINK "http://www.w3schools.com/schema/el_include.asp" include: Meanwhile, you should import definition files according to their respective dependencies (import first the file that does not depend on the other; e.g. import HYPERLINK "http://www.sdmx.org/data/SDMXCommon.xsd" http://www.sdmx.org/data/SDMXCommon.xsd before you import HYPERLINK "http://www.sdmx.org/data/SDMXStructure.xsd" http://www.sdmx.org/data/SDMXStructure.xsd). There might be a problem when there are mutual cross-references between the files, but in most cases you can overcome the problem by performing Save only after importing all mutually dependant files (e.g. for PayPal Web Services, HYPERLINK "http://www.paypal.com/wsdl/CoreComponentTypes.xsd" http://www.paypal.com/wsdl/CoreComponentTypes.xsd uses , which is defined in HYPERLINK "http://www.paypal.com/wsdl/eBLBaseComponents.xsd" http://www.paypal.com/wsdl/eBLBaseComponents.xsd, while HYPERLINK "http://www.paypal.com/wsdl/eBLBaseComponents.xsd" http://www.paypal.com/wsdl/eBLBaseComponents.xsd uses dozens of types defined in HYPERLINK "http://www.paypal.com/wsdl/CoreComponentTypes.xsd" http://www.paypal.com/wsdl/CoreComponentTypes.xsd. It is therefore recommended to import both definition files, and only then save the changes).
HYPERLINK "http://www.w3schools.com/schema/el_redefine.asp" redefine.
HYPERLINK "http://www.w3schools.com/schema/el_key.asp" key, HYPERLINK "http://www.w3schools.com/schema/el_keyref.asp" keyref and HYPERLINK "http://www.w3schools.com/schema/el_unique.asp" unique (and therefore also HYPERLINK "http://www.w3schools.com/schema/el_field.asp" field and HYPERLINK "http://www.w3schools.com/schema/el_selector.asp" selector).
HYPERLINK "http://www.w3schools.com/schema/el_list.asp" list and HYPERLINK "http://www.w3schools.com/schema/el_union.asp" union.
HYPERLINK "http://www.w3schools.com/schema/el_any.asp" any.
HYPERLINK "http://www.w3schools.com/schema/el_group.asp" group.
HYPERLINK "http://www.w3schools.com/schema/el_attributegroup.asp" attributeGroup and HYPERLINK "http://www.w3schools.com/schema/el_anyattribute.asp" anyAttribute.
HYPERLINK "http://www.w3schools.com/schema/el_notation.asp" notation.
Formatting of date & dateTime
According to the flexible W3C Datetime Format ( HYPERLINK "http://www.hackcraft.net/web/datetime/" \l "w3cdtf" W3C DTF), various formats for the HYPERLINK "http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/" \l "date" date and HYPERLINK "http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/" \l "dateTime" dateTime types of XML Schema are used. For example:
date
Definition FileElementSample Data HYPERLINK "http://www.sdmx.org/data/SDMXMessage.xsd" http://www.sdmx.org/data/SDMXMessage.xsdReportingBegin1999-01-04dateTime
Definition FileElementSample Data HYPERLINK "http://www.27seconds.com/Holidays/US/Dates/USHolidayDates.asmx?WSDL" http://www.27seconds.com/Holidays/US/Dates/USHolidayDates.asmx?WSDLGetEasterResponse2006-04-16T00:00:00.0000000-07:00 HYPERLINK "http://www.sandbox.paypal.com/wsdl/eBLBaseComponents.xsd" http://www.sandbox.paypal.com/wsdl/eBLBaseComponents.xsdTimestamp2006-09-20T10:13:55ZIn the built-in package XML/www.w3.org/2001/XMLSchema, containing the data types of XML Schema (see Built-In Packages above), we support all W3C DTF formats of the dateTime type:
yyyy-MM-dd'T'HH:mmTZD (e.g. 1997-07-16T19:20+01:00)
yyyy-MM-dd'T'HH:mm:ssTZD (e.g. 1997-07-16T19:20:30+01:00)
yyyy-MM-dd'T'HH:mm:ss.SSSSSSSTZD (e.g. 1997-07-16T19:20:30.45+01:00)
This flexibility is implemented as follows:
date has the format yyyy-MM-dd. No flexibility is expected.
dateTime has the longer format (yyyy-MM-dd'T'HH:mm:ss.SSSSSSSTZD), which is treated in a special manner ( HYPERLINK "http://www.windward.net/forums/thread.jspa?threadID=1107&tstart=0" not via Javas SimpleDateFormat class). If parsing of a filed according to this format fails, we also try the shorter formats.
The fraction part of the seconds (.SSSSSSS) means we allow a maximum of 7 digits after the decimal period, but fewer digits are also acceptable while parsing.
The time zone format TZD is interpreted as any of the time zone formats supported by the SimpleDateFormat class (e.g. Pacific Standard Time, PST, GMT-10:00, or -1000), or HYPERLINK "http://swik.net/Agila-BPEL/Blog%3A+Twister+%28twister%29/Betrayed+by+a+DateFormat/mww" an additional variant (e.g. -10:00) supported by the HYPERLINK "http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html" org.joda.time.format.DateTimeFormat class.
Open Issues
A global attribute (an attribute that can be referenced from anywhere), should be imported as a Data Element rather than a Data type (as we do with global elements).
A global element may have a HYPERLINK "http://www.w3schools.com/schema/schema_complex_subst.asp" substitutionGroup attribute, which defines an element that can substitute another element (e.g. in HYPERLINK "http://www.newyorkfed.org/xml/schemas/FX_Utility.xsd" http://www.newyorkfed.org/xml/schemas/FX_Utility.xsd the element definition states that in the element DataSet can be used where utility:DataSet is expected). This implies we should be able to parse an XML document containing the substituting element wherever the original element has been defined, but this is not supported yet (for an interim way to overcome the issue see the model Examples/Web Services/Forex/View/Extract Response Text in the sample project Examples).
Still need to handle the general issue of formatting fields (e.g. numbers) when creating an XML message.
WSDL
Import Rules
As for XML schemas, all imports are made into sub-packages of the package XML in the Tersus model repository.
A WSDL definition file may contain regular XML schema definitions of data types and data elements, which are imported as described above. In addition it contains WSDL elements, which are imported as process models (if defining web services or as data models if defining parameters f web services.
Input and output parameters of services are imported as slots of the services (triggers for input parameters, exits for output parameters). The multiplicity of a slot is determined by the minOccurs and maxOccurs attributes of the imported schema element. If maxOccurs is greater than 1, the slot is marked as repetitive. If minOccurs is greater than 0, the slot is marked as mandatory.
It is possible to define a service (operation in WSDL terminology) that has SOAP binding, HTTP binding, or both.
Services
(In the following 3 tables, the namespace alias wsdl: stands for the namespace http://schemas.xmlsoap.org/wsdl/)
WSDL ElementCorresponding Tersus Model HYPERLINK "http://www.w3schools.com/wsdl/wsdl_ports.asp" wsdl:portTypeNone. It contains a set of services (defined by operation elements), and its name is used to decide the package into which these operation elements are imported (e.g. in HYPERLINK "http://www.newyorkfed.org/markets/fxrates/WebService/v1_0/FXWS.wsdl" http://www.newyorkfed.org/markets/fxrates/WebService/v1_0/FXWS.wsdl creates the package XML/v1_0.WebService.fxrates.markets/FXWS). HYPERLINK "http://www.w3schools.com/wsdl/wsdl_ports.asp" wsdl:operation(under portType)Service model (a server-side process model). Created from the template Tersus/Miscellaneous/Call Web Service. Its name ends with the suffix .call to distinguish it from any wrapping service that exposes it as a SOAP or HTTP service (see below).wsdl:inputTrigger of the containing service model.wsdl:output,wsdl:faultExit of the containing service model. HYPERLINK "http://www.w3.org/TR/wsdl" \l "_messages" wsdl:messageData type of slot (a trigger or an exit). A data structure within a special sub-package (Messages). HYPERLINK "http://www.w3.org/TR/wsdl" \l "_message" wsdl:partData element of a slot's data type.SOAP Binding
(In the following table, the namespace alias soap: stands for the namespace http://schemas.xmlsoap.org/wsdl/soap/)
WSDL ElementCorresponding Tersus Model HYPERLINK "http://www.w3.org/TR/2002/WD-wsdl12-20020709/" \l "service-desc-component" wsdl:serviceNone. It defines a collection of wrapping services that expose services defined within a portType. HYPERLINK "http://www.w3.org/TR/2002/WD-wsdl12-20020709/" \l "service-desc-component" wsdl:portNone. Only used to define the linkage between a binding (a set of wrapping services) and portType (a set of wrapped services).soap:addressNone. Appears under port and defines the end point at which the services are available. Used to define the value each wrapping service is passing to the trigger of the corresponding wrapped service. HYPERLINK "http://www.w3.org/TR/2002/WD-wsdl12-20020709/" \l "binding-desc-component" wsdl:bindingNone. Only used (by specifying a portType) to identify the referred set of wrapped services.soap:bindingNone. Only used to define the style value (document or rpc) each wrapping service is passing to the trigger of the corresponding wrapped service. HYPERLINK "http://www.w3schools.com/wsdl/wsdl_ports.asp" wsdl:operation(under binding)Service model (a server-side process model). A wrapping that exposes a wrapped service as a SOAP service. Its name ends with the suffix .soap.soap:operationNone. Only used to get properties of the wrapping service.wsdl:inputTrigger(s) of the containing service model. The input element contains header and/or body elements. soap:header(under input)The trigger of the containing service model.soap:body(under input)The other trigger(s) of the containing service model.wsdl:outputExit of the containing service model. The output element contains header and/or body elementssoap:header(under output)The <> exit of the containing service model.soap:body(under output)Other exit(s) of the containing service model.wsdl:faultExit of the containing service model.HTTP Binding
HTTP binding is not fully supported yet (see Invoking HTTP Web Services below).
(In the following table, the namespace alias http: stands for the namespace http://schemas.xmlsoap.org/wsdl/http/)
WSDL ElementCorresponding Tersus Model HYPERLINK "http://www.w3.org/TR/2002/WD-wsdl12-20020709/" \l "service-desc-component" wsdl:serviceSame as for SOAP binding (actually, the same service element may contain both SOAP and HTTP port elements). HYPERLINK "http://www.w3.org/TR/2002/WD-wsdl12-20020709/" \l "service-desc-component" wsdl:portSame as for SOAP binding.http:addressSame as soap:address for SOAP binding. HYPERLINK "http://www.w3.org/TR/2002/WD-wsdl12-20020709/" \l "binding-desc-component" wsdl:bindingSame as for SOAP binding.http:bindingNot supported yet. HYPERLINK "http://www.w3schools.com/wsdl/wsdl_ports.asp" wsdl:operation(under binding)Not supported yet.http:operationNone. Only used to get properties of the wrapping service.Sample Imported Services
Several WSDL definition files (and XML Schema files on which they depend) have been imported into the sample project Examples, which is provided as part of the standard download of the Tersus Studio:
Definition File(s)Corresponding Tersus Package(s) HYPERLINK "http://www.27seconds.com/Holidays/US/Dates/USHolidayDates.asmx?WSDL" http://www.27seconds.com/Holidays/US/Dates/USHolidayDates.asmx?WSDLXML/www.27seconds.com/Holidays/US/Dates HYPERLINK "http://www.webservicex.net/WeatherForecast.asmx?WSDL" http://www.webservicex.net/WeatherForecast.asmx?WSDLXML/www.webservicex.net HYPERLINK "http://www.sdmx.org/data/SDMXCommon.xsd" http://www.sdmx.org/data/SDMXCommon.xsd
HYPERLINK "http://www.sdmx.org/data/SDMXStructure.xsd" http://www.sdmx.org/data/SDMXStructure.xsd
HYPERLINK "http://www.sdmx.org/data/SDMXGenericData.xsd" http://www.sdmx.org/data/SDMXGenericData.xsd
HYPERLINK "http://www.sdmx.org/data/SDMXCompactData.xsd" http://www.sdmx.org/data/SDMXCompactData.xsd
HYPERLINK "http://www.sdmx.org/data/SDMXUtilityData.xsd" http://www.sdmx.org/data/SDMXUtilityData.xsd
HYPERLINK "http://www.sdmx.org/data/SDMXCrossSectionalData.xsd" http://www.sdmx.org/data/SDMXCrossSectionalData.xsd
HYPERLINK "http://www.sdmx.org/data/SDMXQuery.xsd" http://www.sdmx.org/data/SDMXQuery.xsd
HYPERLINK "http://www.sdmx.org/data/SDMXMessage.xsd" http://www.sdmx.org/data/SDMXMessage.xsdXML/www.SDMX.org/resources/SDMXML/schemas/v1_0 HYPERLINK "http://www.newyorkfed.org/xml/schemas/FX_Utility.xsd" http://www.newyorkfed.org/xml/schemas/FX_Utility.xsdXML/www.newyorkfed.org/xml/schemas/FX/utility HYPERLINK "http://www.newyorkfed.org/markets/fxrates/WebService/v1_0/FXWS.wsdl" http://www.newyorkfed.org/markets/fxrates/WebService/v1_0/FXWS.wsdlXML/v1_0.WebService.fxrates.markets HYPERLINK "http://www.sandbox.paypal.com/wsdl/CoreComponentTypes.xsd" http://www.sandbox.paypal.com/wsdl/CoreComponentTypes.xsd
HYPERLINK "http://www.sandbox.paypal.com/wsdl/eBLBaseComponents.xsd" http://www.sandbox.paypal.com/wsdl/eBLBaseComponents.xsd
HYPERLINK "http://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl" http://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdlXML/ebay/apis/CoreComponentTypes
XML/ebay/apis/eBLBaseComponents
XML/ebay/api/PayPalAPI HYPERLINK "http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl" http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdlXML/webservices.amazon.com/AWSECommerceService/2006-09-18
XML/soap.amazon.comExcept for the Amazon services, the sample project Examples contains actual usage of at least one service from each imported package (see Invoking SOAP Web Services below).
Not Supported Yet
HYPERLINK "http://www.w3.org/TR/2002/WD-wsdl12-20020709/" \l "serviceType-desc-component" serviceType.
urlEncoded.
mimeXml, content.
Invoking SOAP Web Services
When an imported SOAP service is used within a Tersus project, the Tersus runtime engine generates the XML document containing the SOAP request message and posts it to the end point at which the service is available.
As a simple example, lets have a look at the service GetWeatherByZipCode.soap in the package XML/www.webservicex.net, which receives as input a data structure with single textual field ZipCode.
Using the service within a Tersus application would require only providing a valid US zip code at the trigger GetWeatherByZipCode:
When running, the following XML document will be posted to HYPERLINK "http://www.webservicex.net/WeatherForecast.asmx" http://www.webservicex.net/WeatherForecast.asmx:
80017
This is not something the modeler of the Tersus application should be aware of, as the invocation, including the generation of the request XML document, is done under the hood by the Tersus runtime engine.
Similarly, the modeler should not be aware of the XML document sent back as the service response. Tersus parses the XML response and returns the result as a regular data structure.
In our example, if everything works properly, the XML document sent as the response of the service will look like this:
39.694828
104.788094
0.007865
08
AURORA
CO
Monday, September 25, 2006
http://www.nws.noaa.gov/weather/images/fcicons/few.jpg
71
42
22
6
Tuesday, September 26, 2006
http://www.nws.noaa.gov/weather/images/fcicons/skc.jpg
78
46
26
8
Wednesday, September 27, 2006
http://www.nws.noaa.gov/weather/images/fcicons/sct.jpg
68
35
20
2
Thursday, September 28, 2006
http://www.nws.noaa.gov/weather/images/fcicons/few.jpg
63
42
17
6
Friday, September 29, 2006
http://www.nws.noaa.gov/weather/images/fcicons/few.jpg
73
44
23
7
Saturday, September 30, 2006
http://www.nws.noaa.gov/weather/images/fcicons/few.jpg
75
44
24
7
The Tersus runtime engine parses the XML response and returns the parsed result through the GetWeatherByZipCodeResponse exit. This is a data structure containing the information on the location and the forecast for each of the days of the coming week (note that this data structure has been automatically created while importing the WSDL definitions of the service):
In a Tersus application it is easy to display the forecast in a table, like this:
Not Supported Yet
Parsing SOAP header (of the response). Currently nothing is sent out through the <> exit.
Access to raw request and response (sending both the XML document sent as request and the XML document received as response through non-required exits). Currently you can only see them in the application log.
Invoking HTTP Web Services
The Call Web Service plug-in will eventually support both SOAP and HTTP invocation of web services. When used with HTTP binding, an additional trigger is used (expecting Post or Get as input values).
HTTP web services are not implemented yet (both when importing WSDL definitions files and when invoking services at runtime). Yet, if required, the amount of effort required for completing the implementation is not big (most of the functionality is similar to SOAP).
XML Parsing
When you invoke a web service using a service model created by the Import WSDL wizard, you dont have to take care of XML parsing. The Call Web Service plug-in parses the XML response returned by the web service, and you get the result through the exits of the service, as with any Tersus process.
You will need to perform explicit XML parsing when one of the fields of the service response is itself an XML document (XML within XML). For example, the service getLatestNoonRate.soap (in the package XML/v1_0.WebService.fxrates.markets) receives a single textual input currency_code (e.g. EUR), and returns as output a data structure getLatestNoonRateResponse, which contains a single text field getLatestNoonRateReturn (marked in green in the sample output below):
<?xml version = '1.0'?>
<UtilityData xsi:schemaLocation="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/message http://www.sdmx.org/data/SDMXMessage.xsd http://www.newyorkfed.org/xml/schemas/FX/utility http://www.newyorkfed.org/xml/schemas/FX_Utility.xsd" xmlns:generic="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/generic" xmlns="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/message" xmlns:utility="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/utility" xmlns:query="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/query" xmlns:structure="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/structure" xmlns:common="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:compact="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/compact" xmlns:frbny="http://www.newyorkfed.org/xml/schemas/FX/utility" xmlns:cross="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/cross">
<Header>
<ID>FX12EU</ID>
<Test>false</Test>
<Name xml:lang="en">Foreign Exchange European Monetary Union Euro Noon Rates</Name>
<Prepared>2006-09-19</Prepared>
<Sender id="FRBNY">
<Name xml:lang="en">Federal Reserve Bank of New York</Name>
<Contact>
<Name xml:lang="en">George Matthes</Name>
<Email>george.matthes@ny.frb.org</Email>
</Contact>
</Sender>
<ReportingBegin>1999-01-04</ReportingBegin>
</Header>
<frbny:DataSet>
<frbny:Series AVAILABILITY="A" DECIMALS="4" UNIT_MULT="0" TIME_FORMAT="P1D" UNIT="USD" FX_METHOD="12" DISCLAIMER="12" AUTHORITY="12"><frbny:Key><frbny:FREQ>D</frbny:FREQ><frbny:CURR>EUR</frbny:CURR><frbny:FX_TIME>12</frbny:FX_TIME><frbny:FX_TYPE>S</frbny:FX_TYPE></frbny:Key><frbny:Obs OBS_STATUS="A" OBS_CONF="F"><frbny:TIME_PERIOD>2006-09-18</frbny:TIME_PERIOD><frbny:OBS_VALUE>1.2671</frbny:OBS_VALUE></frbny:Obs></frbny:Series></frbny:DataSet>
</UtilityData>
Parsing of the services response (the whole XML document) is made by the Call Web Service plug-in, and you can get the value of the getLatestNoonRateReturn field as a Text value. This text sting is in itself an XML document (XML within XML), and it would look nicer after interpreting the escaping of characters:
FX12EU false Foreign Exchange European Monetary Union Euro Noon Rates 2006-09-19 Federal Reserve Bank of New York George Matthes george.matthes@ny.frb.org 1999-01-04 DEUR12S2006-09-181.2671
To parse the content of the getLatestNoonRateReturn, use the Parse XML plug-in. Here is how it is done in the Test Federal Reserve Bank of New York button (in package Examples/Web Services/Forex/View of the sample project Examples, which is provided as part of the standard download of the Tersus Studio):
(Note that the Text to Binary sub-process is required because currently the Parse XML plug-in expects as input the binary representation of an XML document. When the plug-in supports text input as well, the Text to Binary sub-process will become redundant.)
Sample Project
The standard download of the Tersus Studio contains a sample project Examples, which contains several examples of invoking web services from Tersus.
Forex
Models have been imported from the following definition files: HYPERLINK "http://www.sdmx.org/data/SDMXCommon.xsd" http://www.sdmx.org/data/SDMXCommon.xsd
HYPERLINK "http://www.sdmx.org/data/SDMXStructure.xsd" http://www.sdmx.org/data/SDMXStructure.xsd
HYPERLINK "http://www.sdmx.org/data/SDMXGenericData.xsd" http://www.sdmx.org/data/SDMXGenericData.xsd
HYPERLINK "http://www.sdmx.org/data/SDMXCompactData.xsd" http://www.sdmx.org/data/SDMXCompactData.xsd
HYPERLINK "http://www.sdmx.org/data/SDMXUtilityData.xsd" http://www.sdmx.org/data/SDMXUtilityData.xsd
HYPERLINK "http://www.sdmx.org/data/SDMXCrossSectionalData.xsd" http://www.sdmx.org/data/SDMXCrossSectionalData.xsd
HYPERLINK "http://www.sdmx.org/data/SDMXQuery.xsd" http://www.sdmx.org/data/SDMXQuery.xsd
HYPERLINK "http://www.sdmx.org/data/SDMXMessage.xsd" http://www.sdmx.org/data/SDMXMessage.xsd
HYPERLINK "http://www.newyorkfed.org/xml/schemas/FX_Utility.xsd" http://www.newyorkfed.org/xml/schemas/FX_Utility.xsd
HYPERLINK "http://www.newyorkfed.org/markets/fxrates/WebService/v1_0/FXWS.wsdl" http://www.newyorkfed.org/markets/fxrates/WebService/v1_0/FXWS.wsdl
Press Test Federal Reserve Bank of New York to get the latest Euro rate from the Federal Reserve Bank of New York.
Holidays
Models have been imported from the following definition file: HYPERLINK "http://www.27seconds.com/Holidays/US/Dates/USHolidayDates.asmx?WSDL" http://www.27seconds.com/Holidays/US/Dates/USHolidayDates.asmx?WSDL
Type a year (e.g. 2006) to get the dates of Easter and Thanksgiving in that year.
PayPal
Models have been imported from the following definition files: HYPERLINK "http://www.sandbox.paypal.com/wsdl/CoreComponentTypes.xsd" http://www.sandbox.paypal.com/wsdl/CoreComponentTypes.xsd
HYPERLINK "http://www.sandbox.paypal.com/wsdl/eBLBaseComponents.xsd" http://www.sandbox.paypal.com/wsdl/eBLBaseComponents.xsd
HYPERLINK "http://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl" http://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl
Fill the amount to be paid (in US Dollars) and the payers name (first name and last name), and then Press Soap Test to invoke Pay Pals DoDirectPayment service with a test account.
If everything work OK, you see Success at the PayPal Response line. Otherwise, PayPals error message is displayed.
Weather
Models have been imported from the following definition file: HYPERLINK "http://www.webservicex.net/WeatherForecast.asmx?WSDL" http://www.webservicex.net/WeatherForecast.asmx?WSDL
Type a US zip code (e.g. 90017) and press Get Weather by Zip Code to get a one week forecast for that place.
Appendix style and use
Encoded vs. Literal
Reference: HYPERLINK "https://jax-rpc.dev.java.net/docs/wsdl-bindings.html" wsdl:binding "style", "use", and message format
use="encoded": Each message part references an abstract type using the type attribute. These abstract types are used to produce a concrete message by applying an encoding specified by the encodingStyle attribute. The part names, types, and value of the namespace attribute are all inputs to the encoding, although the namespace attribute only applies to content not explicitly defined by the abstract types.
use="literal": Each part references a concrete schema definition using either the element or type attribute. If element is used, the element referenced by the part will appear directly under the Body element (for document style bindings) or under an accessor element named after the message part (in rpc style). If type is used, the type referenced by the part becomes the schema type of the enclosing element (part accessor element for rpc style).
RPC vs. Document
Reference: HYPERLINK "https://jax-rpc.dev.java.net/docs/wsdl-bindings.html" wsdl:binding "style", "use", and message format
style="rpc": Each part is a parameter or a return value and appears inside a wrapper element within the body (following Section 7.1 of the SOAP specification). The wrapper element is named identically to the operation name and its namespace is the value of the namespace attribute. Each message part (parameter) appears under the wrapper, represented by an accessor named identically to the corresponding parameter of the call. Parts are arranged in the same order as the parameters of the call unless specified differently by parameterOrder.
style="document": There are no additional wrappers, and the message parts appear directly under the SOAP Body element.
RPC
HYPERLINK "http://java.sun.com/developer/technicalArticles/xml/jaxrpcpatterns/index5.html" http://java.sun.com/developer/technicalArticles/xml/jaxrpcpatterns/index5.html
Document
HYPERLINK "http://entirex.demozone.softwareag.com/entirexdemozone/main_TopicExxWebServices_pm.html" http://entirex.demozone.softwareag.com/entirexdemozone/main_TopicExxWebServices_pm.html HYPERLINK "http://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl"
Literal Document Example 1
HYPERLINK "http://www.27seconds.com/Holidays/US/Dates/USHolidayDates.asmx?WSDL" http://www.27seconds.com/Holidays/US/Dates/USHolidayDates.asmx?WSDL
Sample Request
2006
Corresponding WSDL Definitions
Get the date of Easter.
Literal Document Example 2
HYPERLINK "http://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl" http://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl
Sample Request
...
1.00
...
Corresponding WSDL Definitions
Encoded RPC Example
HYPERLINK "http://www.newyorkfed.org/markets/fxrates/WebService/v1_0/FXWS.wsdl" http://www.newyorkfed.org/markets/fxrates/WebService/v1_0/FXWS.wsdl
Sample Request
EUR
Corresponding WSDL Definitions
Literal RPC Example
HYPERLINK "http://publib.boulder.ibm.com/infocenter/wbihelp/v6rxmx/index.jsp?topic=/com.ibm.wbia_adapters.doc/doc/webservices/webservices46.htm" IBMs Example ( HYPERLINK "http://hitenmpatel.blogspot.com/2006/05/web-service-description-language-wsdl.html" SOAP message does NOT contain xsi:type encoding attributes)
1
2
3
4
10
Encoded Document
HYPERLINK "http://www-128.ibm.com/developerworks/webservices/library/ws-whichwsdl/?ca=dgr-devx-WebServicesMVP03" Nobody follows this style, % & . / 1 3 6 7 8 9 P Q R S o p q r z { | ¾«wiWiCWiW&j} hM hl UmH nH u #j hM hM UmH nH uhM hM mH nH u 2j hM hl >*B*UmH nH ph u hM hM mH nH uhM hM 0J mH nH u$j hM hM 0J UmH nH u hW j hW U
hb3 CJ
hm CJ hd` h[ CJ hH hH CJ H*
hH CJ
h8 CJ h1k h[ hm & 8 I :
* > v
p
k m
h
h
h
gdH gdO X Y
' ( ) C D E F G H I ӹӫkӫW&jq hM hl UmH nH u 2j hM hl >*B*UmH nH ph u &jw hM hl UmH nH u #j hM hM UmH nH uhM hM mH nH u 2j hM hl >*B*UmH nH ph u hM hM 0J mH nH uhM hM mH nH u$j hM hM 0J UmH nH u"I J K g h i j | } ~ ߹߫k߫W&je hM hl UmH nH u 2j hM hl >*B*UmH nH ph u &jk hM hl UmH nH u #j hM hM UmH nH uhM hM mH nH u 2j hM hl >*B*UmH nH ph u hM hM mH nH uhM hM 0J mH nH u$j hM hM 0J UmH nH u"
4
5
6
7
8
9
:
;
<
X
Y
Z
[
l
m
n
˸媘j媘V &jY hM hl UmH nH u 2j hM hl >*B*UmH nH ph u &j_ hM hl UmH nH u #j hM hM UmH nH uhM hM mH nH u $j hM hM 0J UmH nH u 2j hM hl >*B*UmH nH ph u hM hM 0J mH nH uhM hM mH nH u !
$ % & ' ( ) * + , H I ĄjVĄ &jM hM hl UmH nH u 2j hM hl >*B*UmH nH ph u hM hM mH nH u&jS hM hl UmH nH u #j hM hM UmH nH uhM hM mH nH u $j hM hM 0J UmH nH u 2j hM hl >*B*UmH nH ph u hM hM 0J mH nH u !I J K h i j ŷӅŅkŷWӅŅ &jA
hM hl UmH nH u 2j hM hl >*B*UmH nH ph u hM hM mH nH u&jG hM hl UmH nH u #j hM hM UmH nH uhM hM mH nH u hM hM 0J mH nH u$j hM hM 0J UmH nH u 2j hM hl >*B*UmH nH ph u 2 4 6 8 : < > @ B z | ~
ŷӅŅkŷWӅŅ &j5 hM hl UmH nH u 2j hM hl >*B*UmH nH ph u hM hM mH nH u&j; hM hl UmH nH u #j hM hM UmH nH uhM hM mH nH u hM hM 0J mH nH u$j hM hM 0J UmH nH u 2j
hM hl >*B*UmH nH ph u
"
2
4
6
j
l
n
p
r
t
v
x
z
sӵӧY 2j
hM hl >*B*UmH nH ph u &j/
hM hl UmH nH u #j hM hM UmH nH uhM hM mH nH u hM hM 0J mH nH uhM hM mH nH u#hM hM 0J OJ QJ mH nH u$j hM hM 0J UmH nH u 2j hM hl >*B*UmH nH ph u T V X Z \ ^ v x z ڹs_ڹ &j# hM hl UmH nH u #hM hM 0J OJ QJ mH nH u2j hM hl >*B*UmH nH ph u hM hM 0J mH nH uhM hM mH nH u$j hM hM 0J UmH nH u hM hM mH nH u #j hM hM UmH nH u&j) hM hl UmH nH u , . 0 d f h j l n p r t
+ , ŷӅŅkŷWӅŅ &j hM hl UmH nH u 2j hM hl >*B*UmH nH ph u hM hM mH nH u&j hM hl UmH nH u #j hM hM UmH nH uhM hM mH nH u hM hM 0J mH nH u$j hM hM 0J UmH nH u 2j hM hl >*B*UmH nH ph u , - . H I J d e f h i j k l m ŷӅŅkŷWӅŅ &j hM hl UmH nH u 2j hM hl >*B*UmH nH ph u hM hM mH nH u&j hM hl UmH nH u #j hM hM UmH nH uhM hM mH nH u hM hM 0J mH nH u$j hM hM 0J UmH nH u 2j hM hl >*B*UmH nH ph u < = > ? J K L f g h j k l m n o ŷӅŅkŷWӅŅ &j hM hl UmH nH u 2j hM hl >*B*UmH nH ph u hM hM mH nH u&j hM hl UmH nH u #j hM hM UmH nH uhM hM mH nH u hM hM 0J mH nH u$j hM hM 0J UmH nH u 2j hM hl >*B*UmH nH ph u
& ' ŷӅŅkŷWӅŅ &j hM hl UmH nH u 2jv hM hl >*B*UmH nH ph u hM hM mH nH u&j hM hl UmH nH u #j hM hM UmH nH uhM hM mH nH u hM hM 0J mH nH u$j hM hM 0J UmH nH u 2j| hM hl >*B*UmH nH ph u ' ( ) 1 2 3 M N O Q R S T U V r s t u { | } ŷӅŅkŷWӅŅ &j hM hl UmH nH u 2jj hM hl >*B*UmH nH ph u hM hM mH nH u&j hM hl UmH nH u #j hM hM UmH nH uhM hM mH nH u hM hM 0J mH nH u$j hM hM 0J UmH nH u 2jp hM hl >*B*UmH nH ph u T I < 8 J U b d m U
&