SOAP API: Forskjell mellom sideversjoner

Fra Wiki Elfag
Hopp til navigering Hopp til søk
Ingen redigeringsforklaring
Linje 1: Linje 1:
SOAP API er laget primært for integrasjon med Visma.
SOAP API is supplied primary for integration with Visma


= Lokasjon =
= Location =
Adresse: http://prosjektkalkulator.no/soap?wsdl
Address: http://prosjektkalkulator.no/soap?wsdl


= Innlogging =
= Authentication =
Tilgang til SOAP API er kun tilgjengelig med egne brukerkontoer opprettet for SOAP. En slik konto kan opprettes av brukerne av systemet på siden Innstillinger->Brukere
Access to SOAP API is only available using separate user accounts created for SOAP. An account can be created by an administrator in this page: Innstillinger -> Brukere


Opprett en SOAP header med navn 'UsernameToken'. Den skal ha to attributter: 'Username' og 'Password'. Hvis clienten håndterer sessiondata så tror jeg innlogging er bare nødvendig på første kall, men jeg har ikke testet det. Det sikre er vel å ta med headeren på alle forsespørsler.
Create a SOAP header with the name 'UsernameToken'. Two attributes are required: 'Username' and 'Password'. The service is supposed to retain session data, meaning login is only required at the first request in an session. This has not been tested however. The safe option would be to include the header with all calls.


Eksempel i PHP:
PHP example
<pre>
<pre>
$auth = new \stdClass();
$auth = new \stdClass();

Sideversjonen fra 4. mai 2015 kl. 22:36

SOAP API is supplied primary for integration with Visma

Location

Address: http://prosjektkalkulator.no/soap?wsdl

Authentication

Access to SOAP API is only available using separate user accounts created for SOAP. An account can be created by an administrator in this page: Innstillinger -> Brukere

Create a SOAP header with the name 'UsernameToken'. Two attributes are required: 'Username' and 'Password'. The service is supposed to retain session data, meaning login is only required at the first request in an session. This has not been tested however. The safe option would be to include the header with all calls.

PHP example

$auth = new \stdClass();
$auth->Username = 'brukernavn';
$auth->Password = 'passord';
$header = new \SoapHeader('auth', 'UsernameToken', $auth, true);

Complex datatypes

The following complex types are used. Please see the wsdl for details.

  • Product
  • ArrayOfProduct
  • Item
  • ArrayOfItem
  • Unit
  • ArrayOfUnit
  • Quotation

Available services

helloWorld

Description

Used for testing. Does not require login.

Request

Parameter Type Mandatory/Optional Comments
void

Response

Name Type Description
string The string "Hello World!"

getQuotationById

Description

Get a Quotation. The object is returned with the related objects Unit, Item and Product populated.

Request

Parameter Type Mandatory/Optional Comments
id int Database table primary key

Response

Name Type Description
return Quotation Complex type Quotation

getQuotationByCustomId

Description

Get a Quotation by the Quotation number chosed by the user. Custom id is unique within each group/company. The object is returned with the related objects Unit, Item and Product populated.

Request

Parameter Type Mandatory/Optional Comments
id int custom_id field.

Response

Name Type Description
return Quotation Complex type Quotation

getProductSummaryByQuotationId

Description

Returns a list of all the products related to a Quotation. Products of same efonumber, description and price are added together.

Request

Parameter Type Mandatory/Optional Comments
id int Database table primary key

Response

Name Type Description
return array <Product> Array of complex type Product

getProductSummaryByQuotationCustomId

Description

Returns a list of all the products related to a Quotation. Products of same efonumber, description and price are added together. Custom id is unique within each group/company.

Request

Parameter Type Mandatory/Optional Comments
id int custom_id field

Response

Name Type Description
return array <Product> Array of complex type Product