包含在尋找其他文件熱門支援資源 | 以 PDF 格式下載這本書 (626 KB)
Chapter 5 Web Service SpecificationStarOffice 8 Server - PDF Converter exposes its interface as a SOAP [SOAP=http://www.w3.org/TR/soap/] web service. As such, the interface description is provided as a WSDL [WSDL=http://www.w3.org/TR/wsdl] file. The schema of the messages exchanged via the SOAP interface are described in more detail below. OverviewThe interface has two main entry points: convert and convertMime. While the convert interface uses URLs or base64 encoded versions of the request and result files, the convertMime interface uses the mime extensions of WSDL to transfer documents as binary attachments. The convert interface can also handle documents attached via the WS-I attachment profile, wherein an additional mime part is referenced via a cid: (content-id) URL See www.ws-i.org/Profiles/AttachmentsProfile-1.0.html Most language bindings will provide tools to generate language specific proxy classes from the WSDL descriptions, which can than be used to call the service in a client. Should an environment not provide such a binding, it is possible, to generate and parse the SOAP XML messages according to the SOAP and WSDL specification and the message schema given as part of the WSDL file. The WSDL can either be obtained from a running StarOffice 8 Server - PDF Converter by appending ?WSDL to the service URL (e.g. http://localhost:8080/soserv/SOConverter?WSDL) or directly from the StarOffice 8 Server - PDF Converter installation, where it can be found at <socs-installation-dir>/engine/webapps/soserv/WEB-INF/Converter.wsdl. Description of the APINote – For StarOffice 8 Server - PDF Converter Update 10 the API of the Conversion Webservice had to be changed. In case your client applications do not work any longer with StarOffice 8 Server - PDF Converter Update 10, you need to recompile them using the current WSDL file. To obtain the version of your StarOffice 8 Server - PDF Converter installation, refer to the file <socs-installation-dir>/program/versionrc (version.ini on Windows). The XML that the StarOffice 8 Server - PDF Converter uses to send and to receive requests from the server is defined in a WSDL file. This file contains definitions for the following elements.
WSDL<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2005 Sun Microsystems, Inc. All rights reserved.
SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->
<definitions
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="urn:soserv:Converter/types"
xmlns:tns="urn:soserv:Converter/wsdl"
targetNamespace="urn:soserv:Converter/wsdl"
name="Converter" >
<types>
<xsd:schema
xmlns:tns="urn:soserv:Converter/types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd"
elementFormDefault="qualified"
targetNamespace="urn:soserv:Converter/types">
<xsd:simpleType name="swaRef">
<xsd:restriction base="xsd:anyURI" />
</xsd:simpleType>
<xsd:complexType name="optionsType">
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="value" type="xsd:string"/>
</xsd:complexType>
<!-- struct which holds information related to a conversion job -->
<xsd:element name="convertMime">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="targetType" type="xsd:string" nillable="true"/>
<xsd:element name="option" type="tns:optionsType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="optionString" type="xsd:string" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="convert">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="sourceURL" type="xsd:anyURI" nillable="true"/>
<xsd:element name="sourceDocument" type="xsd:base64Binary" nillable="true"/>
<xsd:element name="wsiAttachment" type="tns:swaRef" nillable="true"/>
<xsd:element name="targetType" type="xsd:string" nillable="true"/>
<xsd:element name="option" type="tns:optionsType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="optionString" type="xsd:string" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="convertResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="status" type="xsd:string" nillable="true"/>
<xsd:element name="resultURL" type="xsd:anyURI" nillable="true"/>
<xsd:element name="resultDocument" type="xsd:base64Binary" nillable="true"/>
<xsd:element name="wsiAttachment" type="tns:swaRef" nillable="true"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="convertMimeResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="status" type="xsd:string" nillable="true"/>
<xsd:element name="mimeType" type="xsd:string" nillable="true"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="conversionFault">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="errorCode" type="xsd:int"/>
<xsd:element name="message" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</types>
<message name="convertRequest">
<part name="parameters" element="ns2:convert"/>
</message>
<message name="convertResponse">
<part name="result" element="ns2:convertResponse"/>
</message>
<message name="convertMimeRequest">
<part name="parameters" element="ns2:convertMime"/>
<part name="mimeAttachment" type="xsd:base64Binary"/>
</message>
<message name="convertMimeResponse">
<part name="result" element="ns2:convertMimeResponse"/>
<part name="mimeAttachment" type="xsd:base64Binary"/>
</message>
<message name="conversionError">
<part name="fault" element="ns2:conversionFault"/>
</message>
<!-- service endpoint interface for conversion service -->
<portType name="ConverterSEI">
<operation name="convert">
<documentation>...</documentation>
<input message="tns:convertRequest"/>
<output message="tns:convertResponse"/>
<fault name="conversionError" message="tns:conversionError"/>
</operation>
<operation name="convertMime">
<documentation>...</documentation>
<input message="tns:convertMimeRequest"/>
<output message="tns:convertMimeResponse"/>
<fault name="conversionError" message="tns:conversionError"/>
</operation>
</portType>
<!-- soap binding -->
<binding name="ConverterSEIBinding" type="tns:ConverterSEI">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="convert">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="conversionError">
<soap:fault name="conversionError" use="literal"/>
</fault>
</operation>
<operation name="convertMime">
<soap:operation soapAction=""/>
<input>
<mime:multipartRelated>
<mime:part>
<soap:body parts="parameters" use="literal"/>
</mime:part>
<mime:part>
<mime:content part="mimeAttachment" type="application/octet-stream"/>
</mime:part>
</mime:multipartRelated>
</input>
<output>
<mime:multipartRelated>
<mime:part>
<soap:body parts="result" use="literal"/>
</mime:part>
<mime:part>
<mime:content part="mimeAttachment" type="application/octet-stream"/>
</mime:part>
</mime:multipartRelated>
</output>
<fault name="conversionError">
<soap:fault name="conversionError" use="literal"/>
</fault>
</operation>
</binding>
<service name="Converter">
<port name="ConverterSEIPort" binding="tns:ConverterSEIBinding">
<soap:address location="http://localhost:8080/soserv/SOConverter"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
</port>
</service>
</definitions>
|