Differences

This shows you the differences between two versions of the page.

Link to this comparison view

action type - web service [2016/09/14 14:19] (current)
Line 1: Line 1:
 +~~NOTOC~~
 +====== Use a Web Service ======
 +This action will communicate with a web service. Currently both SOAP and REST web services are supported. There are many such public (free) and premium web services in existence supporting integrations and new functionality to incorporate into your application. ​
  
 +===== SOAP Web Service =====
 +Use a web service action whenever a remote, SOAP web service should be triggered. ​ The web service action type reads the provided WSDL and interprets the services available as well as the input and output parameters of the service. ​ In other words, it asks the web service what all it can do, and then for each thing it can do it figures out what has to be given to the service, and what it will give back.
 +
 +Example: Suppose an application works with customers that are in both the UK and the USA.  A useful form on the dashboard would be a US Dollars to Pounds converter. ​ A builder would create a field grid with a currency field for the US Dollars amount, and when that form is saved trigger a Web Services actions to connect to a service [[http://​www.webservicex.net/​ws/​wsdetails.aspx?​wsid=10|like this one]] to get the most recent conversion multiplier for US dollars into pounds, do the math, and show that to their user.
 +
 +{{ ::​action_webservice_first.png?​direct |}}
 +
 +==== Enter the URL of a SOAP web service ====
 +The result of this expression will be used when the action is processed. This can be IP address based (e.g. http://​255.255.255.0/​soap.php?​wsdl) or domain name based (e.g. http://​www.myserver.com/​soap.php?​wsdl).
 +==== Enter the static URL of a SOAP web service ====
 +If the URL entered in the expression builder above has a dynamic component that you can't access in this context, enter a static version of your URL here. This setting will be used only for setting up the action.
 +==== Timeout ====
 +Enter the number of seconds to wait for the service to respond before bypassing this action.
 +==== Choose a Service ====
 +The WSDL was read successfully,​ and these services are available. Please select one to call. 
 +The values the service you select needs to function and the values it returns will be displayed below.
 +
 +Depending on the WSDL you enter, the services list will change based on what the WSDL can do.
 +==== Input Expressions ====
 +The selected service needs to know the following value(s). Use expression builders to define each one. 
 +These values will be sent to the service when this Action runs.
 +
 +{{ ::​action_webservice_input.png?​direct |}}
 +
 +This list of service-dependent values are needed by the service to do it's job.
 +==== Output Query'​s ====
 +The selected service will return the following value(s). Use query builders to define where to store each returned value. ​
 +These values will be returned from the service when this action runs.
 +
 +{{ ::​action_webservice_output.png?​direct |}}
 +
 +==== Describe this action ====
 +Useful as a comment, this description will overwrite the automatically generated description in the [[Action Manager|Action Manager]].
 +
 +===== REST Web Service =====
 +Use a web service action whenever a remote, REST web service should be triggered. ​ Unfortunately,​ REST API's don't have the same self-documenting capabilities as SOAP Web Services, so you will have to rely on the REST API's documentation to clearly define what services are available, and what request and response formats the service requires. ​ Our interfaces allow you to call GET, PUT, POST, PATCH and DELETE REST web services, pass request information via HTTP Headers, JSON or XML, and store the response Code, Text, and any Response Headers.
 +
 +//REST Web Services will be available in Platform version 13.10.836.//​
 +==== Enter the URL for the REST request ====
 +The result of this expression will be used when the action is processed. This can be IP address based (e.g. http://​255.255.255.0/​contacts/​12345) or domain name based (e.g. http://​www.myserver.com/​contacts/​12345).
 +
 +==== Enter the HTTP Basic Authentication Credentials ====
 +Some web services may use [[http://​en.wikipedia.org/​wiki/​Basic_access_authentication|HTTP Basic Authentication]] as a way of securing their API from unauthorized access. ​ If the service requires the use of HTTP Basic Authentication use the [[Expression Builder|Expression Fields]] to provide the username and password.
 +
 +==== Timeout ====
 +Enter the number of seconds to wait for the service to respond before bypassing this action.
 +
 +==== Choose how to send data in the request ====
 +An optional field, make a choice between XML, JSON, or HTTP Header Key/Value Pairs. ​ Since this is an optional field, it can be left blank if there is no need to pass request information other than through the Requestion URL.
 +
 +=== XML ===
 +== Request XML ==
 +The result of this expression will be sent with the REST request as the request body. Be sure to consult the documentation for the REST API you're integrating with for details.
 +
 +=== JSON ===
 +== Request JSON==
 +The result of this expression will be sent with the REST request as the request body. Be sure to consult the documentation for the REST API you're integrating with for details.
 +
 +=== HTTP Header Key/Value Pairs ===
 +Define a set of Request Headers to send in the request and use an expression to define the value to send.  If a web service, for instance, expects the details for a Product in it's headers, instead of in XML, or JSON in the request body, then you might create Header Name's like "​Product ID" and "SKU Number"​ to define these values for the API request.
 +
 +==== Choose where to store the response body ====
 +Query a record and choose a field in which to store the web service'​s result'​s response body.  If the headers of the response contains a Content Type that indicates that the response body is a binary file then the response body is encoded using Base64. ​ This allows for the response body to be stored in the Encoded File part of a [[Field Type - File Attachment|File Attachment]] field.
 +
 +The Binary Content Types supported are:
 +
 +  * application/​octet-stream:​ Arbitrary binary data.
 +  * application/​ogg:​ Ogg, a multimedia bitstream container format
 +  * application/​pdf:​ Portable Document Format
 +  * application/​zip:​ ZIP archive files
 +  * application/​gzip:​ Gzip
 +  * audio/​basic:​ μ-law audio at 8 kHz, 1 channel
 +  * audio/L24: 24bit Linear PCM audio at 8–48 kHz, 1-N channels
 +  * audio/mp4: MP4 audio
 +  * audio/mpeg: MP3 or other MPEG audio
 +  * audio/ogg: Ogg Vorbis, Speex, Flac and other audio
 +  * audio/opus: Opus audio
 +  * audio/​vorbis:​ Vorbis encoded audio
 +  * audio/​vnd.rn-realaudio:​ RealAudio
 +  * audio/​vnd.wave:​ WAV audio
 +  * audio/webm: WebM open media format
 +  * image/gif: GIF image
 +  * image/jpeg: JPEG JFIF image
 +  * image/​pjpeg:​ JPEG JFIF image
 +  * image/png: Portable Network Graphics
 +  * video/mpeg: MPEG-1 video with multiplexed audio
 +  * video/mp4: MP4 video
 +  * video/ogg: Ogg Theora or other video (with audio)
 +  * video/​quicktime:​ QuickTime video
 +  * video/webm: WebM Matroska-based open media format
 +  * video/​x-matroska:​ Matroska open media format
 +  * video/​x-ms-wmv:​ Windows Media Video
 +  * video/​x-flv:​ Flash video (FLV files)
 +  * application/​vnd.oasis.opendocument.text:​ OpenDocument Text
 +  * application/​vnd.oasis.opendocument.spreadsheet:​ OpenDocument Spreadsheet
 +  * application/​vnd.oasis.opendocument.presentation:​ OpenDocument Presentation
 +  * application/​vnd.oasis.opendocument.graphics:​ OpenDocument Graphics
 +  * application/​vnd.ms-excel:​ Microsoft Excel files
 +  * application/​vnd.openxmlformats-officedocument.spreadsheetml.sheet:​ Microsoft Excel 2007 files
 +  * application/​vnd.ms-powerpoint:​ Microsoft Powerpoint files
 +  * application/​vnd.openxmlformats-officedocument.presentationml.presentation:​ Microsoft Powerpoint 2007 files
 +  * application/​vnd.openxmlformats-officedocument.wordprocessingml.document:​ Microsoft Word 2007 files
 +  * application/​vnd.ms-xpsdocument:​ XPS document
 +==== Choose where to store the response HTTP Code ====
 +Query a record and choose a field in which to store the web service'​s result'​s response code.
 +
 +==== Response Header Storage ====
 +Define a set of Response Headers to read from the response and use a query to find the field to store the value in.  If a web service, for instance, returns the details for a Product in it's headers, instead of in XML, or JSON in the response body, then you might create Header Name's like "​Product ID" and "SKU Number"​ to pull these values from the HTTP Headers and store them in WorkXpress.
 +
 +==== Describe this action ====
 +Useful as a comment, this description will overwrite the automatically generated description in the [[Action Manager|Action Manager]].
 +
 +==== Session Tracking ====
 +If a web page retrieved uses a cookie to generate a session then child REST actions under this action will use the same session. ​ This is useful in cases where the first REST call is to a login page and subsequent calls are made to pages that are secured by the login.
action type - web service.txt · Last modified: 2016/09/14 14:19 (external edit)
Copyright WorkXpress, 2019