SOAP and REST protocols

SOAP

SOAP (simple object access protocol) is based on XML (extensible markup language) for communication between client and server over HTTP (Hypertext Transfer Protocol).

Example 1. POST SOAP-request skeleton

A typical POST SOAP-request skeleton for SOAP version 1.1 should be like this:

<?xml version="1.0" encoding="utf-8"?>

<s:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    ...
  </s:Header>
  <s:Body>
    ...
  </s:Body>
</s:Envelope>

SOAP-header

All of the web methods must be specified as a SOAP-action attribute in the header of the SOAP-request.

The syntax of the SOAP-action (depending on component) should be like this:

{empty}[Namespace]/IServiceSoap/[WebMethod]

For the portal component, the SOAP-action should be like this:

http://www.pointsharp.com/netid/server/portal/IServiceSoap/[WebMethod]

Call the GetVersion web method against the portal component, the SOAP-action should be like this:

http://www.pointsharp.com/netid/server/portal/IServiceSoap/GetVersion

Note that SOAP-header value must be written within "" characters and that the value is case sensitive, like this:

SOAPAction:
"http://www.pointsharp.com/netid/server/portal/IServiceSoap/GetVersion"

Note that SOAP-header value is case sensitive.

SOAP-body

All of the web methods must be specified in the SOAP-body element together with the XML-namespace as element attribute.

The syntax within the SOAP-body should be like this:

<[WebMethod] xmlns="[Namespace]"></[WebMethod]>

Call the GetVersion web method against the portal component, the SOAP-body should be like this:

<GetVersion xmlns="http://www.pointsharp.com/netid/server/portal"></GetVersion>

GetVersion SOAP-request (including SOAP-header and SOAP-body) against the portal component, the complete SOAP-request should be like this:

<s:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none"> http://www.pointsharp.com/netid/server/portal/IServiceSoap/GetVersion</Action>
  </s:Header>
  <s:Body>
    <GetVersion xmlns="http://www.pointsharp.com/netid/server/portal"></GetVersion>
  </s:Body>
</s:Envelope>

GetVersion SOAP-response shoule be like this:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <GetVersionResponse xmlns=" http://www.pointsharp.com/netid/server/portal">
      <GetVersionResult>
        <Version>6.0.0.10</Version>
        <Status>
          <Code>NPR_SUCCESS</Code>
          <Description>Success</Description>
        </Status>
      </GetVersionResult>
    </GetVersionResponse>
  </s:Body>
</s:Envelope>

REST

REST stands for Representational State Transfer and communicates between client and server over HTTP like SOAP. Typically, a RESTful web services uses JSON (JavaScript Object Notation) as format but the APIs of the Portal also support XML against REST.

A typical POST REST-request should be like this:

{
  "SessionId": "fS1gy9uVDX6lFuX36hFWpTPLupI=",
  "Type": "ApplicationInfo"
}

A typical REST-response should be like this:

{
  "Type": "ApplicationInfo",
  "ApplicationInfo": {
    "Name": "Net iD Portal",
    "Version": "6.0.0.10",
    "Copyright": "© Pointsharp AB"
  },
  "Status": {
    "Code": "NPR_SUCCESS",
    "Description": "Success"
  }
}