Web service provider i Domino, del 1/2

Web service provider i Domino, del 1/2

Att skapa en web service i Domino är enkelt, men kräver lite förberedelser och förkunskaper.
Därför har jag delat upp den här genomgången i två delar.

I det här exemplet kommer vi skapa en tjänst som kan ta emot enkla meddelanden.
I del 1 börjar vi med att bestämma hur anropen mot vår web service skall se ut, detta kommer beskrivas i två filer – .XSD och .WSDL.

>Det första vi behöver är en XSD-fil, filen definierar hur XML-datat som skickas får se ut.

“The XML Schema definition language (XSD) enables you to define the structure and data types for XML documents.
An XML Schema defines the elements, attributes, and data types that conform to the World Wide Web Consortium (W3C)”

Enklast är att använda en XML-redigerare. Själv använder jag Oxygen XML Editor, men det finns andra program som är billigare.

Formatet vi förväntar oss ta emot är:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ape="urn:example-se:message" targetNamespace="urn:example-se:message" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<xsd:element name="MESSAGE">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Message" type="ape:MessageType">
<xsd:annotation>
<xsd:documentation>Message containing sender identity and collection of tickets</xsd:documentation> </xsd:annotation> </xsd:element> <xsd:element name="CheckSum" type="xsd:integer"> <xsd:annotation> <xsd:documentation>Number of messages</xsd:documentation> </xsd:annotation> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:complexType name="MessageType"> <xsd:sequence> <xsd:element name="Sender" minOccurs="0"> <xsd:complexType> <xsd:attribute name="ID" type="xsd:string" use="optional"> <xsd:annotation> <xsd:documentation>Sender id</xsd:documentation> </xsd:annotation> </xsd:attribute> <xsd:attribute name="Name" type="xsd:string" use="optional"> <xsd:annotation> <xsd:documentation>Sender name</xsd:documentation> </xsd:annotation> </xsd:attribute> </xsd:complexType> </xsd:element> <xsd:element name="Messages"> <xsd:complexType> <xsd:sequence> <xsd:element name="Message" type="ape:Message" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> <xsd:complexType name="Message"> <xsd:attribute name="Message" type="xsd:string" use="required"> <xsd:annotation> <xsd:documentation>Message string</xsd:documentation> </xsd:annotation> </xsd:attribute> <xsd:attribute name="Guid" type="ape:GUIDStringType"/> </xsd:complexType> <xsd:simpleType name="GUIDStringType"> <xsd:annotation> <xsd:documentation>Message id, hexadecimal length=32</xsd:documentation> </xsd:annotation> <xsd:restriction base="xsd:string"> <xsd:pattern value="[0-9A-F]{32}"/> </xsd:restriction> </xsd:simpleType></xsd:schema>