Web Service Publish

Create web services for publishing data. This is not a component and therefore menu items are not created for it.

The system setting 'WebServiceEnabled' must be set and services must be configured in the Web service publishing menu group.

Note: For development servers use the full URL https://servername.softadmin.se/...

Component modes: Publish data | Update data

Component mode: Update data

Configuration

To enable Web services in your system you must perform the following configuration steps:

  1. Create/Reuse an application pool. The application pool should be different from the one running Softadmin and must be in integrated pipeline mode.
  2. Convert the "webservices" folder to an application, or set up a separate site for it.
  3. Set the application variable "WebServiceEnabled" to 1.
  4. Configure application variable "WebServiceURLBaseSoftadminServices". This should contain the URL to the web service application folder configured in step 2.
  5. Optional. Set up an IP-filter in the IIS.
  6. Optional. Make additional adjustments to comply with additional organisation rules.
  7. Set up the web services using the web service menu item.

The steps 1 through 6 needs to be performed after first deploy as well.

Common errors

An error always occurs when saving meta data.

The system setting "WebServiceURLBaseSoftadminServices" is most likely wrong, make sure the url is reachable.

SQL

SQL Call: Update data

May modify database: Yes

Parameters

@<PrimaryKeyName> string
Primary key of input-entity.
@<UrlParameter> string
Value of any parameter in the URL. Parameters are created by adding {myparam} in the metadata URLSuffix.

Resultset: Get Response

Table count: repeated one or more times
Row count: zero or more rows
Columns
<Primarykey_Column> mandatory int
First column in table is used to identify resultset
<Column> optional string
Any other column that should be a field in the response
<Foreignkey_Column> optional int
Used to connect resultset to the <Primarykey_Column> of other resultsets.

Resultset: Http error code (optional)

Table count: repeated zero or one time
Row count: exactly one row
Columns
HttpStatusCode mandatory int
HTTP Status Code in the 400 to 599 range indicating an error has occured.

Resultset: #HttpHeader (optional)

Contains the custom request HTTP headers.
Table count: repeated zero or one time
Row count: zero or more rows
Columns
HttpHeaderName mandatory string
Contains the name of the header.
HttpHeaderValue mandatory string
Contains the value of the header.

Examples

Update

CREATE PROCEDURE dbo.PersonInfo_InsertUpdate
	@PersonStagingId int
AS
BEGIN

	EXEC Registry.PersonStaging_Validate
		@PersonStageingId = @PersonStagingId;

	EXEC Registry.PersonStaging_QueueForAdvancedOperation
		@PersonStageingId = @PersonStagingId;

	SELECT
		1 AS Success,
		NULL AS ErrorMessage;
END;

Best practice

Error handling

The best way to handle errors that should be sent to the caller is to create an error entity which contains information about the error and potentially a success bit.

RAISERROR can be used for internal errors as these errors are logged but only displayed to the caller in the development environment.