All notes
WebServices

WSDL

Reference on w3schools. What is WSDL?

Element Description
<types> A container for data type definitions used by the web service. For maximum platform neutrality, WSDL uses XML Schema syntax to define data types.
<message> A typed definition of the data being communicated. Can have several parts. See example.
<portType> A set of operations supported by one or more endpoints. Like module or class.
<binding> A protocol and data format specification for a particular port type. Defines the data format and protocol for each port type.

Example

Example: "glossaryTerms" has an operation "getTerm", which needs input and output defined in the two message parts.

<message name="getTermRequest">
  <part name="term" type="xs:string"/>
</message>

<message name="getTermResponse">
  <part name="value" type="xs:string"/>
</message>

<portType name="glossaryTerms">
  <operation name="getTerm">
    <input message="getTermRequest"/>
    <output message="getTermResponse"/>
  </operation>
</portType>

<binding type="glossaryTerms" name="b1">
   <soap:binding style="document"
   transport="http://schemas.xmlsoap.org/soap/http" />
   <operation>
     <soap:operation soapAction="http://example.com/getTerm"/>
     <input><soap:body use="literal"/></input>
     <output><soap:body use="literal"/></output>
  </operation>
</binding>

Operation

One-way	The operation can receive a message but will not return a response
Request-response	The operation can receive a request and will return a response
Solicit-response	The operation can send a request and will wait for a response
Notification	The operation can send a message but will not wait for a response

SOAP

Reference. What is SOAP?

Why SOAP?

Building Blocks

A SOAP message is an ordinary XML document containing the following elements:

Syntax Rules

Here are some important syntax rules:

Skeleton SOAP Message

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

<soap:Header>
...
</soap:Header>

<soap:Body>
...
  <soap:Fault>
  ...
  </soap:Fault>
</soap:Body>

</soap:Envelope>

The xmlns:soap Namespace

Notice the xmlns:soap namespace in the example above. It should always have the value of: "http://www.w3.org/2001/12/soap-envelope".
The namespace defines the Envelope as a SOAP Envelope.
If a different namespace is used, the application generates an error and discards the message.

Curl

Reference.

curl -X POST -H "Content-Type: text/xml" -H "SOAPAction: \"http://api.eyeblaster.com/IAuthenticationService/ClientLogin\"" --data-binary @request.xml https://sandbox.mediamind.com/Eyeblaster.MediaMind.API/V2/AuthenticationService.svc

curl --data-binary data
(HTTP)This posts data exactly as specified with no extra processing whatsoever.
If you start the data with the letter @, the rest should be a filename.
Data is posted in a similar manner as --data-ascii does, except that newlines are preserved and conversions are never done.

SOAP HTTP Binding

Reference.

HTTP protocol

HTTP request message:

POST /item HTTP/1.1
Host: 1.1.1.1
Content-Type: text/plain
Content-Length: 200
And the HTTP response message:
200 OK
Content-Type: text/plain
Content-Length: 200
While when error,
400 Bad Request
Content-Length: 0

Example

POST /item HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 250

For a complete SOAP example, see this.

RDF

What is RDF? Reference

Example

<?xml version="1.0"?>

<RDF>
  <Description about="http://www.w3schools.com/rdf">
    <author>Jan Egil Refsnes</author>
    <homepage>http://www.w3schools.com</homepage>
  </Description>
</RDF>

REST

Wikipedia. Representational State Transfer (REST) is a software architecture style consisting of guidelines and best practices for creating scalable web services.