Basic Connection
This connection is tied with basic authentication. You can define custom headers and values.
Properties
Option | Type | Default | Description |
---|---|---|---|
| string | Â | ID of the connection. |
| string | Â | Base URL of the connection. A full path must be provided (e.g.:Â https://...). |
| java.util.Map | Â | Custom headers. |
| string | Â | Name of the certificate. |
| string | Basic | Prefix of the value in auth header. For example: Basic zxz13ss. |
| string | Authorization | Header name of the auth header. |
| string | Â | Username for basic authentication. |
| string | Â | Password for basic authentication. |
Examples
Define a new connection:
<bean id="basicConn" class="net.pricefx.integration.component.rest.domain.connection.BasicConnection">
<property name="url" value="https://thecompany.com"/>
<property name="authRequestHeaderBearer" value="Pricefx"/>
<property name="authRequestHeader" value="PartitionX"/>
<property name="username" value="pasta"/>
<property name="password" value="rasta"/>
</bean>
Use it in a route:
<route id="opendata2-create">
<from uri="direct:create"/>
<to uri="pfx-rest:post?uri=/A_SalesOrder&connection=basicConn"/>
<to uri="mock:create"/>
</route>
Results:
Request to https://thecompany.com/A_SalesOrder was done with the header
PartitionX
and valuePricefx xxx
(xxx is a hash of username/password).Data are returned.
IntegrationManager version 5.8.0