Deliver file to web service as base64 string

If you want to include an XML file in a web service delivery you must first create a file definition and then create data transfer to a custom file based on this file definition.

How to configure data transfer to web service and map dialogue fields to object structure:

Click to add to web service, and select web service from the list
  • Click on Dispatch in the dialogue
  • Click on the (+) tab (1) and select Web Service (2). Click OK.

A web service can be of the type SOAP or REST, and need to be registered in Interact before you proceed. The web service must be able to receive data in order for data transfer to the web service to work.

In one of the receive fields, type =avlevering_fil("filnavn.xml") where filename.xml is the same name used for a custom file definition, in the Name field. Remember to include the file extension.

Be accurate when you write the file name as it must be an exact match to Name in Custom file delivery

The web service I have used for this example writes a file to the file directory. Here, you can see that a long text string has been added to the web service in the field where you added =avlevering_fil(“filnavn.xml”). This is a base64 string that you can decode by using a relevant tool, e.g. https://www.base64decode.org/.

Use a tool to decode the base64 string

Click to go to the website, and paste the long text string in the field Decode from Base64 format. This will show the XML file in the field below.

Keyword link icon for conceptSee also