|
|||||||||||||||||||||||
|
Home Genealogie Hemochromatose Certificaat Test Manuals Korn shell SQL commands Robots.txt Encoding SSL setup WSDL definition XSLT scrips |
Table of contents
1 - PrefaceThis document describes how I've setup the new Mobius II website using Webservices in PHP5.2 - WSDL File2.1 - typesThe types contain the definition of all used datatypes in the webservice. The datatypes are setup as a XSD schema. All the types are defined within the same types element.<wsdl:types>
<xsd:schema targetNamespace="http://schaake.nu/example.xsd" xmlns="http://www.w3.org/2000/10/XMLSchema">
<xsd:element name="DataType">
<xsd:complexType>
<xsd:all>
<xsd:element name="variable" type="string"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:type>
Types could also be imported using an external XSD. <import namespace="http://example.com/stockquote/schemas" location="http://example.com/stockquote/stockquote.xsd"/> 2.2 - messageEvery message describes a message without direction (abstract). A message has an unique name and a part refering to a datatype defined in the types element.<wsdl:message name="AbstractInputMessage"> <wsdl:part name="body" element="xsd1:DataType"/> <wsdl:message>A message does not have to use a element attribute refering to a datatype, but can also use a type attribute to define the message directly. Every message used by the webservice must be defined in a message element. This includes all incoming, outgoing and fault messages. 2.3 - portTypeThe portType is a set of abstract operations where each operation referes to an input and an output message, and optionally a fault message.<wsdl:portType name="SamplePortType">
<wsdl:operation name="MyFunction">
<wsdl:input message="tns:AbstractInputMessage"/>
<wsdl:output message="tns:AbstractOutputMessage"/>
<wsdl:fault message="tns:AbstractFaultMessage"/>
</wsdl:operation>
</wsdl:portType>
The operation wihtin the portType defines an action supported by the service.There are 4 types of operations that a webservice can be define for:
2.4 - binding<wsdl:binding name="SampleBinding" type="tns:SamplePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="MyFunction">
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="FaultMessage">
<soap:body name="FaultMessage" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
The binding also includes SOAP bindings, which are the bindings (connections) to the SOAP messages. The first soap binding
sets the type of the soap binding, which is in the example the default document style. The document style expects a SOAP document
as input/output and/or fault messages. Another option is RFC style. This style expects parameters and return values.The soap:body binding refere to the messages used for input/output and fault. In this example the binding for the message is set to literal. Another option is encoded. For the fault message the name must be specified and the message must consist of a single part. Since the fault message cannot be a parameter, it's always assumed to be a document style. 2.5 - service<wsdl:service name="SampleService">
<wsdl:port name="SamplePort" binding="tns:SampleBinding">
<soap:address location="http://schaake.nu/webservices/sample.php"/>
</wsdl:port>
</wsdl:service>
The soap binding address specifies the address of the webservice. This is where the webservice is called and the actual program
behind the webservice lives.
|
Amé Schaake Senna Schaake
|
|||||||||||||||||||||
| © Christiaan Schaake | Laatste update January 16 2011 | ||||||||||||||||||||||