Verified that TokenEndpoint has a valid https:// URL (it logs correctly). Tried using instead of , but still got the same error. Tried wrapping the URL in a property before passing it to , but WSO2 still fails to infer transport information.
<iterate expression="json-eval($.systemList)" preservePayload="false" attachPath="$">
<target>
<sequence>
<log level="custom">
<property name="Step" value="Fetching token for a system"/>
<property expression="json-eval($.tokenEndpoint)" name="TokenEndpoint"/>
<property expression="json-eval($.client_id)" name="client_id"/>
<property expression="json-eval($.client_secret)" name="client_secret"/>
</log>
<!-- Extract API Credentials -->
<property name="TokenEndpoint" scope="default" expression="json-eval($.tokenEndpoint)"/>
<property name="client_id" scope="default" expression="json-eval($.client_id)"/>
<property name="client_secret" scope="default" expression="json-eval($.client_secret)"/>
<!-- Debugging Log to Ensure Values Are Extracted -->
<log level="full">
<property expression="get-property('client_id')" name="Extracted Client ID"/>
<property expression="get-property('client_secret')" name="Extracted Client Secret"/>
</log>
<!-- Set Headers Dynamically -->
<property name="Content-Type" scope="transport" type="STRING" value="application/x-www-form-urlencoded"/>
<property name="Accept" scope="transport" type="STRING" value="application/json"/>
<header name="client_id" scope="transport" expression="get-property('client_id')"/>
<header name="client_secret" scope="transport" expression="get-property('client_secret')"/>
<!-- Store Token URL in a Final Property -->
<property name="resolvedUrl" scope="default" type="STRING" expression="get-property('TokenEndpoint')"/>
<log level="full">
<property expression="get-property('resolvedUrl')" name="Final Resolved Token URL"/>
</log>
<!-- Send Request -->
<send>
<endpoint>
<address uri="{get-property('resolvedUrl')}"/>
</endpoint>
</send>
</sequence>
</target>
</iterate>
below error I am getting
[2025-02-09 19:07:06,168] ERROR {ClientUtils} - The system cannot infer the transport information from the {get-property('finalUrl')} URL. [2025-02-09 19:07:06,168] ERROR {ClientUtils} - The system cannot infer the transport information from the {get-property('finalUrl')} URL.
Verified that TokenEndpoint has a valid https:// URL (it logs correctly). Tried using instead of , but still got the same error. Tried wrapping the URL in a property before passing it to , but WSO2 still fails to infer transport information.
<iterate expression="json-eval($.systemList)" preservePayload="false" attachPath="$">
<target>
<sequence>
<log level="custom">
<property name="Step" value="Fetching token for a system"/>
<property expression="json-eval($.tokenEndpoint)" name="TokenEndpoint"/>
<property expression="json-eval($.client_id)" name="client_id"/>
<property expression="json-eval($.client_secret)" name="client_secret"/>
</log>
<!-- Extract API Credentials -->
<property name="TokenEndpoint" scope="default" expression="json-eval($.tokenEndpoint)"/>
<property name="client_id" scope="default" expression="json-eval($.client_id)"/>
<property name="client_secret" scope="default" expression="json-eval($.client_secret)"/>
<!-- Debugging Log to Ensure Values Are Extracted -->
<log level="full">
<property expression="get-property('client_id')" name="Extracted Client ID"/>
<property expression="get-property('client_secret')" name="Extracted Client Secret"/>
</log>
<!-- Set Headers Dynamically -->
<property name="Content-Type" scope="transport" type="STRING" value="application/x-www-form-urlencoded"/>
<property name="Accept" scope="transport" type="STRING" value="application/json"/>
<header name="client_id" scope="transport" expression="get-property('client_id')"/>
<header name="client_secret" scope="transport" expression="get-property('client_secret')"/>
<!-- Store Token URL in a Final Property -->
<property name="resolvedUrl" scope="default" type="STRING" expression="get-property('TokenEndpoint')"/>
<log level="full">
<property expression="get-property('resolvedUrl')" name="Final Resolved Token URL"/>
</log>
<!-- Send Request -->
<send>
<endpoint>
<address uri="{get-property('resolvedUrl')}"/>
</endpoint>
</send>
</sequence>
</target>
</iterate>
below error I am getting
[2025-02-09 19:07:06,168] ERROR {ClientUtils} - The system cannot infer the transport information from the {get-property('finalUrl')} URL. [2025-02-09 19:07:06,168] ERROR {ClientUtils} - The system cannot infer the transport information from the {get-property('finalUrl')} URL.
Share Improve this question asked yesterday RoyRoy 212 bronze badges2 Answers
Reset to default 1As per doc https://mi.docs.wso2.com/en/latest/reference/synapse-properties/endpoint-properties/#list-of-endpoints
The URI templates allow a RESTful URI to contain variables that can be populated during mediation runtime using property values with the uri.var.
That means you have to change your integration as below. (Also you have change your address endpoint to HTTP endpoint)
<property name="uri.var.resolvedUrl" scope="default" type="STRING" expression="get-property('TokenEndpoint')"/>
<log level="full">
<property expression="get-property('uri.var.resolvedUrl')" name="Final Resolved Token URL"/>
</log>
<!-- Send Request -->
<send>
<endpoint>
<http method="get" uri-template="{uri.var.resolvedUrl}"/>
</endpoint>
</send>
Reference : https://mi.docs.wso2.com/en/latest/learn/examples/endpoint-examples/using-http-endpoints/
On a further note, there is a new pre-release available for Micro Integrator VSCode extension and Micro Integrator runtime 4.4.0 which brings a significant amount of developer experience improvements.
As per the release note,
- New mediators
- Scatter-Gather : Clones a message into several and aggregates the responses into a single message. Supports parallel or sequential execution, with output to a variable or message body.
- Foreach v2 : Supports parallel or sequential iteration and allows updating the original array or outputting results to a variable.
- ThrowError : Enables throwing an error from the mediation flow.
- Enhanced mediator functionality
- Inline expression support for PayloadFactory Mediator and Log Mediator.
- UI Enhancements for the commonly used mediators.
- Mediator tryout functionality
- Simplified onboard experience via VSCode Extension
- Synapse expression support: A new simplified expression type offering advanced message manipulation and greater flexibility
- Environment variable injection for all environment-specific parameters
- JDK 21 support
- Dependency management for connectors
- Newly introduced HTTP connector
You should be able to achieve your use case easily using the new extension and the runtime.
Eg:
<foreach collection="${payload.systemList}" parallel-execution="false"
update-original="true" continue-without-aggregation="false">
<sequence>
<property name="Content-Type" scope="transport" type="STRING"
value="application/x-www-form-urlencoded" />
<http.get configKey="tokenCon">
<relativePath></relativePath>
<headers>[["client_id","${payload.client_id}"],["client_secret","${payload.client_secret}"],["Content-Type","application/x-www-form-urlencoded"],]</headers>
<forceScAccepted>false</forceScAccepted>
<disableChunking>false</disableChunking>
<forceHttp10>false</forceHttp10>
<noKeepAlive>false</noKeepAlive>
<forcePostPutNobody>false</forcePostPutNobody>
<forceHttpContentLength>false</forceHttpContentLength>
<responseVariable>http_get_1</responseVariable>
<overwriteBody>true</overwriteBody>
</http.get>
</sequence>
</foreach>