wso2 esb twitter connector not invoking the twitter api - wso2

I'm using WSO2 ESB Twitter connector operations in a proxy service. The proxy configuration as given below
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="twitter_test_proxy" transports="http https" startOnLoad="true" trace="disable">
<target>
<inSequence>
<twitter.init configKey="twitter_init"/>
<twitter.getTopTrendPlaces configKey="twitter_init">
<id>23424975</id>
</twitter.getTopTrendPlaces>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
</proxy>
I imported the twitter connector to the esb and enable it. Then all the artifacts (proxy service and twitter_init local entry) were deployed in the ESB. Once I invoke the proxy service noticed that the twitter connector is not invoking the intended back end twitter API. I have enabled wire debug and the debug logs as per given below. What would be the reason for this? I'm using WSO2 ESB 4.8.1. I followed the instructions given here in creating the configurations
[2014-11-12 20:07:47,785] DEBUG - header >> "POST /services/twitter_test_proxy.twitter_test_proxyHttpSoap12Endpoint HTTP/1.1[\r][\n]"
[2014-11-12 20:07:47,793] DEBUG - header >> "Content-Type: application/soap+xml; charset=UTF-8; action="urn:mediate"[\r][\n]"
[2014-11-12 20:07:47,793] DEBUG - header >> "Cookie: menuPanel=visible; menuPanelType=main; wso2.carbon.rememberme=admin-60c7726f-6e4b-462c-88c2-13753ab95974; JSESSIONID=6297A74817478FFE0F4B6EB392022E29; requestedURI="../../carbon/service-mgt/index.jsp?region=region1&item=services_list_menu"; region1_configure_menu=none; region3_registry_menu=none; region4_monitor_menu=none; region5_tools_menu=none; MSG14156327996440.7180992366157122=true; MSG14156330072650.6915075827877599=true; current-breadcrumb=manage_menu%2Cservices_menu%2Cservices_list_menu%23proxyservices+index.jsp*+index.jsp*; MSG14157205387400.9361328898335365=true; MSG14157205491900.33127844546453067=true; MSG14157205807580.7846254111223301=true; MSG14157216353420.11143615454004241=true[\r][\n]"
[2014-11-12 20:07:47,793] DEBUG - header >> "User-Agent: Axis2[\r][\n]"
[2014-11-12 20:07:47,793] DEBUG - header >> "Host: asanka-virtual-machine:8280[\r][\n]"
[2014-11-12 20:07:47,794] DEBUG - header >> "Transfer-Encoding: chunked[\r][\n]"
[2014-11-12 20:07:47,794] DEBUG - header >> "[\r][\n]"
[2014-11-12 20:07:47,794] DEBUG - content >> "a0[\r][\n]"
[2014-11-12 20:07:47,794] DEBUG - content >> "<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body></soapenv:Body></soapenv:Envelope>"
[2014-11-12 20:07:47,795] DEBUG - content >> "[\r][\n]"
[2014-11-12 20:07:47,796] DEBUG - content >> "0"
[2014-11-12 20:07:47,796] DEBUG - content >> "[\r][\n]"
[2014-11-12 20:07:47,797] DEBUG - content >> "[\r][\n]"

I could solve the above issue with slight modification to the proxy. I added respond mediator and got the expected result. The working proxy is as per given below.
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="twitter-connector-proxy" transports="http https" startOnLoad="true" trace="disable">
<target>
<inSequence>
<log level="full">
<property name="INIT" value="##### Call to the Proxy #####"/>
</log>
<twitter.init/>
<twitter.search configKey="twitter_init">
<search>cricket</search>
</twitter.search>
<log level="full">
<property name="RESULT" value="#### Twitter Search Result ####"/>
</log>
<respond/>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
</proxy>

Related

Transport error: 404 Error: Not Found in WSO2 EI 6.1.1

I am trying to send Campaign by using Mailchimp. While calling this endpoint, i am getting ERROR like "Transport error: 404 Error: Not Found". Can anyone please help me out to resolve this?
Note: When i try in Postman by hitting direct mailchimp url it works fine.
Wire Log:
[2020-10-13 11:11:02,611] [] INFO - ApplicationManager Successfully Deployed Carbon Application : QRSagMailchimpIntegrator-CAR_1.0.0 {super-tenant}
[2020-10-13 11:11:14,590] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >> "POST /campaignSend/predict/sendCampaignId=d164a3989d?AuthKey=3216f54e-b6d9-11e6-80f5-76304dec7eb7 HTTP/1.1[\r][\n]"
[2020-10-13 11:11:14,591] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >> "User-Agent: PostmanRuntime/7.26.5[\r][\n]"
[2020-10-13 11:11:14,592] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >> "Accept: */*[\r][\n]"
[2020-10-13 11:11:14,594] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >> "Cache-Control: no-cache[\r][\n]"
[2020-10-13 11:11:14,595] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >> "Postman-Token: 5a44668a-6947-4958-ad24-76fef6ddb62e[\r][\n]"
[2020-10-13 11:11:14,597] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >> "Host: localhost:8280[\r][\n]"
[2020-10-13 11:11:14,598] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >> "Accept-Encoding: gzip, deflate, br[\r][\n]"
[2020-10-13 11:11:14,599] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >> "Connection: keep-alive[\r][\n]"
[2020-10-13 11:11:14,600] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >> "Content-Length: 0[\r][\n]"
[2020-10-13 11:11:14,601] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >> "[\r][\n]"
[2020-10-13 11:11:14,684] [] INFO - LogMediator To: /campaignSend/predict/sendCampaignId=d164a3989d?AuthKey=3216f54e-b6d9-11e6-80f5-76304dec7eb7, MessageID: urn:uuid:aa380541-04f4-4bae-8d8a-d727a7f
a45ba, Direction: request, Welcome Logger = === Send Campaigns ===, Campaign ID = d164a3989d
[2020-10-13 11:11:15,742] [] INFO - HTTPSender Unable to sendViaPost to url[https://us17.api.mailchimp.com/3.0/campaigns/d164a3989d/actions/send/predict/sendCampaignId=d164a3989d?AuthKey=3216f54e-b
6d9-11e6-80f5-76304dec7eb7]
org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found
at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:326)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:196)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:430)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.sendReceive(BlockingMsgSender.java:302)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.send(BlockingMsgSender.java:211)
at org.apache.synapse.mediators.builtin.CallMediator.handleBlockingCall(CallMediator.java:150)
at org.apache.synapse.mediators.builtin.CallMediator.mediate(CallMediator.java:113)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.rest.Resource.process(Resource.java:343)
at org.apache.synapse.rest.API.process(API.java:399)
at org.apache.synapse.rest.RESTRequestHandler.apiProcess(RESTRequestHandler.java:123)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:101)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:69)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:304)
at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:78)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:326)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:372)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:151)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[2020-10-13 11:11:15,778] [] INFO - LogMediator To: https://us17.api.mailchimp.com/3.0/campaigns/d164a3989d/actions/send/, MessageID: urn:uuid:aa380541-04f4-4bae-8d8a-d727a7fa45ba, Direction: reque
st, FAUALTYYYYYYYYYYYYYYYYYY************* = Transport error: 404 Error: Not Found
[2020-10-13 11:11:15,781] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 << "HTTP/1.1 202 Accepted[\r][\n]"
[2020-10-13 11:11:15,782] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 << "Date: Tue, 13 Oct 2020 05:41:15 GMT[\r][\n]"
[2020-10-13 11:11:15,783] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 << "Transfer-Encoding: chunked[\r][\n]"
[2020-10-13 11:11:15,784] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 << "Connection: keep-alive[\r][\n]"
[2020-10-13 11:11:15,785] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 << "[\r][\n]"
[2020-10-13 11:11:15,785] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 << "0[\r][\n]"
[2020-10-13 11:11:15,786] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 << "[\r][\n]"
Postman: (Direct Mailchimp URL)
Mailchimp URL
API Code:
<api context="/campaignSend" name="campaign_send_v1" xmlns="http://ws.apache.org/ns/synapse">
<resource method="POST" uri-template="/predict/sendCampaignId={campaignId}?AuthKey={secKey}">
<inSequence>
<log>
<property name="Welcome Logger" value="=== Send Campaigns ==="/>
<property expression="get-property('uri.var.campaignId')" name="Campaign ID"/>
</log>
<property description="secKey" expression="get-property('uri.var.secKey')" name="secKey" scope="default" type="STRING"/>
<property description="ESB-Authentication" expression="get-property('QRSag-VBFeedsAuthKey')" name="authKey" scope="default" type="OM"/>
<property description="FeedsStoredAuthKey" expression="$ctx:authKey//*[local-name()='SecurityToken']" name="authenticatekey" scope="default" type="STRING"/>
<!-- ==================== Check authentication ==================== -->
<filter description="CheckUserAPIValidation" xpath="get-property('secKey') = get-property('authenticatekey')">
<then/>
<else>
<payloadFactory media-type="json">
<format>{"errorCode":"$1","errorTrace":"$2"}</format>
<args>
<arg value="QRSaG - 401"/>
<arg value="Invalid Authentication.Contact QRSagSupport"/>
</args>
</payloadFactory>
<log level="custom">
<property expression="json-eval($.)" name="===API Authentication Failed==="/>
</log>
<respond/>
</else>
</filter>
<property name="Authorization" scope="transport" type="STRING" value="Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
<call blocking="true">
<endpoint key="sendCampaign"/>
<timeout>
<duration>17000000</duration>
<responseAction>fault</responseAction>
</timeout>
</call>
<log>
<property expression="json-eval($.)" name="LoggerText_JsonResponse"/>
</log>
<respond/>
</inSequence>
<outSequence/>
<faultSequence>
<log>
<property expression="get-property('ERROR_MESSAGE')" name="FAUALTYYYYYYYYYYYYYYYYYY*************"/>
</log>
</faultSequence>
</resource>
Endpoint Value:
<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="sendCampaign" xmlns="http://ws.apache.org/ns/synapse">
<http method="post" uri-template="https://us17.api.mailchimp.com/3.0/campaigns/{uri.var.campaignId}/actions/send/"/>
</endpoint>
Analyzing the provided information we can observe that for the postman request you are invoking the URL
https://us17.api.mailchimp.com/3.0/campaigns/d164a3989d/actions/send
But from the ESB server, you are invoking the following URL
https://us17.api.mailchimp.com/3.0/campaigns/d164a3989d/actions/send/predict/sendCampaignId=d164a3989d?AuthKey=3216f54e-b
6d9-11e6-80f5-76304dec7eb7
This is because the context path is appended for the backend call. You can remove this by adding the following property before the call mediator.
<property name="REST_URL_POSTFIX" action="remove" scope="axis2"/>

Is there a way to send Payload in HTTP Delete in WSO2 EI v6.4

I am currently trying to access any REST service for deleting a resource from my WSO2 EI sequence. The code looks something like below
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="DELETE_COMPANY_INFO" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<log level="custom">
<property name="Sequence" value="DELETE COMPANY INFO started"/>
</log>
<log level="custom">
<property expression="json-eval($)" name="Request Payload"/>
</log>
<property name="NO_ENTITY_BODY" action="set" value="false" type="BOOLEAN" scope="axis2"/>
<call blocking="true">
<endpoint>
<http method="delete" uri-template="http://<IP>:<Port>/companyinfo/<id>">
</http>
</endpoint>
</call>
</sequence>
As can be seen I wish to send the message payload to this endpoint. However I am not able to send this as the payload is dropped by WSO2 EI v6.4
Logs are below
[2020-02-21 14:00:33,127] [micro-integrator] INFO - LogMediator Sequence = DELETE COMPANY INFO started
[2020-02-21 14:00:33,128] [micro-integrator] INFO - LogMediator Request Payload = {"CompanyName":"test123"}
[2020-02-21 14:00:33,131] [micro-integrator] DEBUG - header >> "DELETE /companyinfo/123 HTTP/1.1[\r][\n]"
[2020-02-21 14:00:33,131] [micro-integrator] DEBUG - header >> "Content-Type: application/json; charset=UTF-8[\r][\n]"
[2020-02-21 14:00:33,132] [micro-integrator] DEBUG - header >> "User-Agent: Axis2[\r][\n]"
[2020-02-21 14:00:33,132] [micro-integrator] DEBUG - header >> "Host: <IP>:<Port>[\r][\n]"
[2020-02-21 14:00:33,132] [micro-integrator] DEBUG - header >> "[\r][\n]"
[2020-02-21 14:00:33,136] [micro-integrator] DEBUG - header << "HTTP/1.1 200 [\r][\n]"
[2020-02-21 14:00:33,136] [micro-integrator] DEBUG - header << "HTTP/1.1 200 [\r][\n]"
[2020-02-21 14:00:33,136] [micro-integrator] DEBUG - header << "Content-Type: application/json[\r][\n]"
[2020-02-21 14:00:33,136] [micro-integrator] DEBUG - header << "Content-Length: 25[\r][\n]"
[2020-02-21 14:00:33,137] [micro-integrator] DEBUG - header << "Date: Fri, 21 Feb 2020 08:30:32 GMT[\r][\n]"
[2020-02-21 14:00:33,137] [micro-integrator] DEBUG - header << "[\r][\n]"
[2020-02-21 14:00:33,137] [micro-integrator] DEBUG - content << "{"CompanyName":"test123"}"
I know that REST Webservice implementation should not use Payload for HTTP DELETE operation, however I think ESB should not make the decision to drop the Payload if the underlying transport allows it.
Additionally, I know that this issue was reported earlier (https://wso2.org/jira/browse/ESBJAVA-5060) and marked as resolved in v6.2 of WSO2 EI. However I am facing this in 6.4 version of EI.
Is there a solution to allow Payload with HTTP DELETE call using Call Mediator in WSO2 EI v6.4?
It seems the fix has gone to the Passthrough transport (non blocking) and not to the blocking transport. If you remove the blocking="true" mode, it should work.

WSO2 ESB: How to handle internal error returned by an endpoint

I am using CALL mediator to invoke a Get method on an endpoint. The endpoint returns 500 internal server error as pasted below. But instead of control going to the fault sequence, the mediation flow continues as usual. How to route to fault sequence? How to handle internal error in wso2?
[2020-02-14 17:51:21,175] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-1 << HTTP/1.1 500 Internal Server Error
[2020-02-14 17:51:21,175] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-1 << HTTP/1.1 500 Internal Server Error
[2020-02-14 17:51:21,176] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-1 << Strict-Transport-Security: max-age=15638400; includeSubDomains
[2020-02-14 17:51:21,176] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-1 << Strict-Transport-Security: max-age=15638400; includeSubDomains
[2020-02-14 17:51:21,177] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-1 << Access-Control-Allow-Methods: POST, GET
[2020-02-14 17:51:21,177] DEBUG {org.apache.synapse.transport.http.headers} - http-incoming-1 << Access-Control-Allow-Methods: POST, GET
WSO2 ESB does not hit fault sequence when the endpoint returns 500 because, irrespective of the response code, the mediation flow should proceed. We can retrieve the status code of the response and then trigger the fault sequence. A sample insequence is given below.
<inSequence>
<call>
<endpoint>
<http uri-template="http://www.mocky.io/v2/5e465018330000520002605f"/>
</endpoint>
</call>
<filter source="$axis2:HTTP_SC" regex="500">
<then>
<sequence key="fault"/>
</then>
<else/>
</filter>
<respond/>
</inSequence>

wso2 server redeployment error "Faulty Carbon Applications."

I am getting an error whenever I tried to redeploy the app to the esb. I am trying to merge the 2 response from different api and then map and manipulate that response. I am also using the latest 5.0.0 BETA version both esb tooling and esb.
Here is the fault reason
org.apache.axis2.deployment.DeploymentException: API deployment from
the file :
/Users/me/Downloads/wso2esb-5.0.0-BETA2/tmp/carbonapps/-1234/1468999438631movieapiApp_1.0.0.car/movieAPI_1.0.0/movieAPI-1.0.0.xml
: Failed. at
org.apache.synapse.deployers.AbstractSynapseArtifactDeployer.deploy(AbstractSynapseArtifactDeployer.java:213)
at
org.wso2.carbon.application.deployer.synapse.SynapseAppDeployer.deployArtifacts(SynapseAppDeployer.java:131)
at
org.wso2.carbon.application.deployer.internal.ApplicationManager.deployCarbonApp(ApplicationManager.java:263)
at
org.wso2.carbon.application.deployer.CappAxis2Deployer.deploy(CappAxis2Deployer.java:72)
at
org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
at
org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:807)
at
org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
at
org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377)
at
org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254)
at
org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:371)
at
org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:59)
at
org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:67)
at
org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.runAxisDeployment(CarbonDeploymentSchedulerTask.java:93)
at
org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.run(CarbonDeploymentSchedulerTask.java:138)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745) Caused by:
org.apache.axis2.deployment.DeploymentException: API deployment from
the file :
/Users/me/Downloads/wso2esb-5.0.0-BETA2/tmp/carbonapps/-1234/1468999438631movieapiApp_1.0.0.car/movieAPI_1.0.0/movieAPI-1.0.0.xml
: Failed. at
org.apache.synapse.deployers.AbstractSynapseArtifactDeployer.deploy(AbstractSynapseArtifactDeployer.java:201)
... 20 more Caused by:
org.apache.synapse.deployers.SynapseArtifactDeploymentException: API
deployment from the file :
/Users/me/Downloads/wso2esb-5.0.0-BETA2/tmp/carbonapps/-1234/1468999438631movieapiApp_1.0.0.car/movieAPI_1.0.0/movieAPI-1.0.0.xml
: Failed. at
org.apache.synapse.deployers.AbstractSynapseArtifactDeployer.handleSynapseArtifactDeploymentError(AbstractSynapseArtifactDeployer.java:474)
at
org.apache.synapse.deployers.APIDeployer.deploySynapseArtifact(APIDeployer.java:71)
at
org.wso2.carbon.rest.api.ApiDeployer.deploySynapseArtifact(ApiDeployer.java:34)
at
org.apache.synapse.deployers.AbstractSynapseArtifactDeployer.deploy(AbstractSynapseArtifactDeployer.java:194)
... 20 more Caused by: org.apache.synapse.SynapseException: Duplicate
resource definition by the name: movieapi at
org.apache.synapse.config.SynapseConfiguration.handleException(SynapseConfiguration.java:1627)
at
org.apache.synapse.config.SynapseConfiguration.addAPI(SynapseConfiguration.java:414)
at
org.apache.synapse.deployers.APIDeployer.deploySynapseArtifact(APIDeployer.java:59)
... 22 more
and here's my api
<?xml version="1.0" encoding="UTF-8"?>
<api context="/movieapi" name="movieapi" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="GET" uri-template="/*">
<inSequence>
<property name="ROOT" scope="default">
<root:movie xmlns:root="www.wso2esb.com"/>
</property>
<log level="full"/>
<clone continueParent="true" id="movie" sequential="true">
<target>
<sequence>
<send>
<endpoint>
<address format="rest" uri="https://api.themoviedb.org/3/movie/tt0918940?api_key=code&append_to_response=casts,images%22"/>
</endpoint>
</send>
</sequence>
</target>
<target>
<sequence>
<send>
<endpoint>
<address format="rest" uri="https://www.omdbapi.com/?type=movie&i=tt0918940"/>
</endpoint>
</send>
</sequence>
</target>
</clone>
</inSequence>
<outSequence>
<aggregate id="movie">
<completeCondition>
<messageCount max="-1" min="-1"/>
</completeCondition>
<onComplete enclosingElementProperty="ROOT" expression="//jsonObject" xmlns:dummy="http://org.dummy" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<datamapper config="gov:datamapper/movieapiMapping.dmc" inputSchema="gov:datamapper/movieapiMapping_inputSchema.json" inputType="JSON" outputSchema="gov:datamapper/movieapiMapping_outputSchema.json" outputType="JSON"/>
<property name="messageType" scope="axis2" type="STRING" value="application/json"/>
<respond/>
</onComplete>
</aggregate>
</outSequence>
<faultSequence/>
</resource>
</api>
and this is from the terminal
[2016-07-20 15:36:48,890] ERROR - DataMapperMediator DataMapper mediator : mapping configuration is null
The error you are getting in the terminal DataMapperMediator DataMapper mediator : mapping configuration is null is because the relevant registry resources are not deployed (more precisely, the configuration .dmc file). When you are deploying the capp, make sure that all the registry resources are included as well. Also when the capp deployment fails, can you check in the management console for any faulty services/APIs?
You get the error indicating Data mapper configurations null. So you have to add relevant configurations as you given in the proxy:
<datamapper config="gov:datamapper/movieapiMapping.dmc" inputSchema="gov:datamapper/movieapiMapping_inputSchema.json" inputType="JSON" outputSchema="gov:datamapper/movieapiMapping_outputSchema.json" outputType="JSON"/>
For example: You indicated about gov:datamapper/movieapiMapping.dmc
This should be available in governance registry.Please deploy relevant configs in to ESB.
Open the pom.xml file inside your CompositeApplication.
Edit it in the Design mode.
Under dependencies, you can see the artifacts which you can include.
Tick the checkbox near your relevant Registry artifact. Save pom file.
Now redeploy the application to the server or Regenerate your car file

I/O exception while sending request to axis2 server in WSO2 ESB

When I send a request to axis2 client I get a error
Proxy:
<proxy name="SOAP_Body" startOnLoad="true">
<target>
<inSequence>
<switch xmlns:m0="http://services.samples"
source="//m0:getQuote/m0:request/m0:symbol">
<case regex="foo">
<log level="custom">
<property name="a" value="s"/>
</log>
<send>
<endpoint>
<address uri="http://localhost:9001/services/SimpleStockQuoteService?wsdl"/>
</endpoint>
</send>
</case>
<case regex="bar">
<log level="custom">
<property name="b" value="a"/>
</log>
<send>
<endpoint>
<address uri="http://localhost:9002/services/SimpleStockQuoteService?wsdl"/>
</endpoint>
</send>
</case>
<default>
<property name="symbol"
expression="fn:concat('Normal Stock - ', //m0:getQuote/m0:request/m0:symbol)"/>
</default>
</switch>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
ELB in 9443 offset 0, ESB in 9444 offset 1
so I have sent a request to http://localhost:8280/services/SOAP_Body of ELB
and I get the following error when I have sent a request thru axis2client in esb
[java] 15/06/30 15:40:43 INFO httpclient.HttpMethodDirector: I/O exception
(java.net.ConnectException) caught when processing request: Connection refused:
connect
When I send through SOAP UI for the above endpoint I get
Wed Jul 01 10:48:06 IST 2015:ERROR:Exception in request: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:8280 refused
Wed Jul 01 10:48:06 IST 2015:ERROR:An error occured [Connection to http://localhost:8280 refused], see error log for details
Wed Jul 01 10:48:06 IST 2015:INFO:Error getting response for [SimpleStockQuoteServiceSoap11Binding.getQuote:Request 1]; org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:8280 refused
I have enabled clustering and other configuration as in 1
But when I send request to ESB alone without getting through ELB I get the desired output.
When I give AllowAll in axis2.xml in ELB i get the new error in ELB server
Error - DynamicLoadbalanceEndpoint application member not available
What would be the problem? Please help me out.
Did any of you got sample 57 in wso2 esb for dynamic endpoint working? If yes please help me in configuring. I have configured as in documentation but i couldnt get it working.
Thanks.
There is not enough information in your question.
Post the full stack trace.
Where is your axis 2 service being hosted? WSO2AS?
What is your axis 2 service endpoint.
Post your send mediator xml config.
Have you checked whether the endpoint is working correctly...
Please try this on the web browser:
http://localhost:8280/services/SOAP_Body?wsdl
and see whether or not you get the wsdl of the proxy.