The HTTP component in SwitchYard provides HTTP-based binding support for services and references in SwitchYard.
Binding Services with HTTP
Composite-level services can be exposed as a HTTP-based service using the <binding.http> binding definition. The following configuration options are available for binding.rest when binding services:
Here's an example of what a HTTP service binding looks like:
<sca:service name="QuoteService" promote="StockService/QuoteService">
<http:binding.http>
<selector:operationSelector operationName="getPrice"/>
<http:contextPath>http-binding/quote</http:contextPath>
</http:binding.http>
</sca:service>
Binding References with HTTP
Binding a reference with HTTP can be used to make HTTP-based services available to SwitchYard services. The following configuration options are available for binding.http when binding references:
-
address : A URL that points to the HTTP endpoint. It is optional and if not specified will default to http://127.0.0.1:8080/.
-
method : The HTTP method used for invoking the endpoint. Default is GET.
-
contentType : The HTTP Content-Type header that needs to be set on the request.
Here's an example of what a REST reference binding looks like:
<sca:reference name="Symbol" promote="StockService/SymbolService" multiplicity="1..1">
<http:binding.http>
<http:address>http://localhost:8080/http-binding/symbol</http:address>
<http:method>POST</http:method>
<http:contentType>text/plain</http:contentType>
</http:binding.http>
</sca:reference>