Reputation: 3
I have a Proxy Service which calls Data Service. I want to call Data Service over local transport but I got an error:
[2020-12-19 23:48:59,567] ERROR {ClientUtils} - The system cannot infer the transport information from the local:///services/test/ URL.
[2020-12-19 23:48:59,567] ERROR {Axis2Sender} - {proxy:TST2} Unexpected error during sending message out org.apache.axis2.AxisFault: The system cannot infer the transport information from the local:///services/test/ URL.
at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:86)
at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:116)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:656)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:86)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:573)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:409)
at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:74)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:123)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:109)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:226)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:458)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:181)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
My Sequence is
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="TST2" startOnLoad="true" transports="http https" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:test="test-ns">
<soapenv:Header />
<soapenv:Body>
<test:_get_test_getcnt />
</soapenv:Body>
</soapenv:Envelope>
</format>
</payloadFactory>
<header name="soapAction" scope="transport" value="urn:_get_test_getcnt"></header>
<send>
<endpoint>
<address uri="local:///services/test/" format="soap11"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<log level="full" />
<respond />
</outSequence>
<faultSequence>
<log level="full" />
</faultSequence>
</target>
<publishWSDL key="wsdl"></publishWSDL>
</proxy>
Data serivce have allowed local transport:
<data transports="http local https" serviceNamespace="test-ns" name="test">
If I change the endpoint address uri to HTTP transport http://localhost:8290/services/test/ everything works fine. Am I doing something wrong or local transport is not supported in WSO2 Micro Integrator 1.2.0?
Upvotes: 0
Views: 639
Reputation: 333
The answer is different for each version of the Enterprise Integrator.
You can use this manual: https://docs.wso2.com/display/EI650/Local+Transport
Unfortunately version 7.x.x is very poorly documented in many parts including this one.
Add the following section to your conf/deployment.toml
[transport.local.sender.nonblocking]
enable = true
In the older solutions it was also necessary to replace ServerURL property for
<ServerURL>https://${carbon.local.ip}:${carbon.management.port}${carbon.context}/services/</ServerURL>
However, my EI´s local transport worked even without this change
As in the previous version, what is needed to be done is add the following row manually to conf/axis2/axis2.xml
<transportSender name="local" class="org.apache.axis2.transport.local.NonBlockingLocalTransportSender"/>
Unfortunately, that won´t work as your file will get replaced with a new one without your changes in it once the enterprise integrator starts. Your axis2.xml is being replaced by a generated jinja2 template from location repository/resources/conf/templates/conf/axis2/axis2.xml.j2
You can notice that there is this piece of code inside:
{% if transport.local.sender.nonblocking.enable == true %}
<transportSender name="local" class="org.apache.axis2.transport.local.NonBlockingLocalTransportSender"/>
{% endif %}
Which means all you need to do is to add property transport.local.sender.nonblocking.enable and set it to true
Upvotes: 4
Reputation: 417
Did you enable the local transport in MI as mentioned in [1].
[1] https://docs.wso2.com/display/EI650/Local+Transport
Upvotes: 0