Component: Web Service Publish

 Show all Hide all

Create web services for publishing data, this is not a component and therefore menuitems are not created for it.

Note: For development servers use the full url https://iisgroupname.softadmin.se/...

Component mode: Publish data

Supported modes: Publish data | 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. Set up an IP-filter in the IIS.
  6. Optional. Make additional adjustments to comply with additional organisation rules.
  7. Set up the webservices using the web service menu item.

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

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: Publish data

Supports custom errors: No
May modify database: No

Parameters:

@<fieldname> mandatory string
Any field that is part of the input entity.
@<UrlParameter> optional string
Value of any parameter in the URL. Parameters are created by adding {myparam} in the metadata URLSuffix.

Resultset: Get Response

Repeat mode: 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.

Examples

Publish data

CREATE PROCEDURE dbo.GetPersonInfo
	@PersonId int
AS
BEGIN
	SELECT
		P.PersonId,
		P.PersonName
	FROM
		Registry.Person P
	WHERE
		P.PersonId = @PersonId;

	SELECT
		A.AddressId,
		A.PersonId,
		A.Street
	FROM
		Registry.Address A
	WHERE
		A.PersonId = @PersonId;
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.