Home| Printable Version
The Morphyc Architecture has the capability to access REST services without any traditional programming. This can be achieved using an XML fragment, which is processed at runtime to define the location and transport of the remote service. This can be achieved using the normal rules mechanism within controllers. The main orchestration action within logicsheets is the InvokeService action. When an InvokeService action is used to call a remote service, the remote service is typically identified by a static url, which is imported using the WSDL Import feature within XDE. The default service location information can be changed during deployment using the deployment screens, but there may be situations when URLs and HTTP header information needs to be changed as well as the payload. This can be achieved from within the rules environment without having to resort to 3GL programming or requiring knowledge of any low-level HTTP libraries. Remote web services are typically represented by proxies within XPlatform and these proxies contain the actual physical URLs, imported from WSDLs. The access services that use these proxies make an InvokeService call via XGate, which manages remote communications within XPlatform. XGate packages the service request and returns a response. XGate will use the static URL created during deployment and use this as the destination of the remote service call. During deployment, as well as indicating whether the transport is http|soap, you can indicate whether to allow dynamic service URIs and HTTP headers to be constructed. Enable dynamic URI and HTTP header construction An HttpHeader fragment can be used to dynamically set http header attributes and direct payloads to dynamically constructed URLs. The HttpHeader fragment will typically be created in an 'access service' calling a proxy to a remote URI. This fragment should be included in the request payload. If this dynamic option is ticked then XGate will search for the HttpHeader fragment and parse it to create a URI dynamically, set the http attributes and send the payload. The HttpHeader will be removed after the request has been sent. The following XML fragment can be sent within the payload to change the default request packaging behaviour:
<?xml version="1.0" encoding="UTF-8"?>
<xg:HttpHeader xmlns:xg="http://www.hyfinity.com/xgate">
    <xg:url action="" merge_option="replace" request_method="GET">http://anyValidUrlString</xg:url>
    <xg:params>
        <xg:param name="command">login</xg:param>
        <xg:param name="error_dest">client</xg:param>
    </xg:params>
    <xg:attributes>
        <xg:attribute name="HTTPHeaderAttrib1">attribute value</xg:attribute>
        <xg:attribute name="HTTPHeaderAttrib2">attribute Value</xg:attribute>
    </xg:attributes>
</xg:HttpHeader>
url attributes
@action - If a non-empty string value is specified then this overrides the static action specified during deployment. If an empty string value is specified then this still overrides the static action that is specified during deployment and sets the action header attribute with an empty string. If this attribute is missing then the static action value specified during deployment will be used. @merge_option - options are replace|append. When set to replace the static url specified during deployment will be replaced by the url constructed using this HttpHeader fragment. If the append option is specified then the static url supplied will be appended with the dynamic url constructed using this HttpHeader fragment. @request_method - This can be any string value. If a value is not supplied or an empty string is supplied then the default will be POST. This default value will only be set if a static value was not set during deployment.
The params will be appended to the URL in name=value pairs separated by "&" after a "?" has been inserted between the url and the params. e.g. http://anyValidUrlString?command=login&error_dest=client The attributes will be set in the request http header before a request is made to the url. The name attribute indicates the name of the http header attribute and the value is the value to be set for this header attribute. IMPORTANT! - Currently only two attributes can be specified for transport type soap. These must be name 'uid' and 'pwd'.
Message Wrappers Remote Service Security