WSO2 ESB Trying to create proxy service to c0onnect to rest service to pull data - wso2-esb

I am new to the wso2 esb server and I am trying to create a proxy service to connect to a rest service. I am having issue trying to test the proxy when in the "Deployed Services" page of the esb. The source view of the proxy service is:
> <?xml version="1.0" encoding="UTF-8"?>
> <proxy xmlns="http://ws.apache.org/ns/synapse"
> name="search"
> transports="https,http,local"
> statistics="disable"
> trace="disable"
> startOnLoad="true">
> <target>
> <outSequence>
> <send/>
> </outSequence>
> <faultSequence>
> <log level="full" category="DEBUG"/>
> </faultSequence>
> <endpoint>
> <http method="get" uri-template="http://52.24.50.197:8080/search"/>
> <property name="q" value="test"/>
> </endpoint> </target> <description/> </proxy>
I click on "Try this Service" link and I get this in the console:
[2015-05-19 09:06:43,573] DEBUG - SynapseMessageReceiver Synapse received a new message for message mediation...
[2015-05-19 09:06:43,574] DEBUG - SynapseMessageReceiver Received To: /services/mediate/mediate
[2015-05-19 09:06:43,575] DEBUG - SynapseMessageReceiver SOAPAction: null
[2015-05-19 09:06:43,575] DEBUG - SynapseMessageReceiver WSA-Action: null
[2015-05-19 09:06:43,575] DEBUG - Axis2SynapseEnvironment Injecting MessageContext
[2015-05-19 09:06:43,576] DEBUG - Axis2SynapseEnvironment Using Main Sequence for injected message
[2015-05-19 09:06:43,576] DEBUG - SequenceMediator Start : Sequence <main>
[2015-05-19 09:06:43,576] DEBUG - SequenceMediator Sequence <SequenceMediator> :: mediate()
[2015-05-19 09:06:43,577] DEBUG - SequenceMediator Mediation started from mediator position : 0
[2015-05-19 09:06:43,577] DEBUG - InMediator Start : In mediator
[2015-05-19 09:06:43,578] DEBUG - InMediator Current message is incoming - executing child mediators
[2015-05-19 09:06:43,578] DEBUG - InMediator Sequence <InMediator> :: mediate()
[2015-05-19 09:06:43,578] DEBUG - InMediator Mediation started from mediator position : 0
[2015-05-19 09:06:43,579] DEBUG - LogMediator Start : Log mediator
[2015-05-19 09:06:43,579] INFO - LogMediator To: /services/mediate/mediate, MessageID: urn:uuid:e2c5b5f7-3c2c-4969-9c0b-6aa4d8282f2d, Direction: requ
st, Envelope: <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body></soapen
:Body></soapenv:Envelope>
[2015-05-19 09:06:43,580] DEBUG - LogMediator End : Log mediator
[2015-05-19 09:06:43,581] DEBUG - FilterMediator Start : Filter mediator
[2015-05-19 09:06:43,581] DEBUG - FilterMediator Source : get-property('To') against : http://localhost:9000.* does not match - skipping child mediato
s
[2015-05-19 09:06:43,582] DEBUG - FilterMediator End : Filter mediator
[2015-05-19 09:06:43,582] DEBUG - InMediator End : In mediator
[2015-05-19 09:06:43,582] DEBUG - OutMediator Start : Out mediator
[2015-05-19 09:06:43,583] DEBUG - OutMediator Current message is a request - skipping child mediators
[2015-05-19 09:06:43,583] DEBUG - OutMediator End : Out mediator
[2015-05-19 09:06:43,584] DEBUG - SequenceMediator End : Sequence <main>
Can someone explain to me why the data is not coming back.We have open the ports to the server the service resides, which is port 8080.
Thanks

It seems that you´re pointing to the wrong URL in ESB. The log shows a message received for the folowing URI: /services/mediate/mediate. Since your proxy is named "search", it should be something link /services/search.
Also, I see that your http endpoint template is not taking any parameters, which probably is not what you want.
The send mediator should look something like that:
<inSequence>
<!-- Assigns URI-Template var to some value. You could use an expression here too -->
<property name="uri.var.search" value="test"/>
</inSequence>
<outSequence>
<send/>
</outSequence>
<endpoint>
<html uri-template="http://52.24.50.197:8080/search?q={uri.var.search}" method="GET"/>
</endpoint>

Rather define your endpoint outside the proxy , so in the ESB main console create your endpoint :
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="HTTPEndpoint">
<http uri-template="http://{uri.var.ip}:8080/{uri.var.servicepath} method="GET">
</http>
</endpoint>
Then try out this proxy :
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="search"
transports="https,http,local"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="uri.var.ip" value="52.24.50.197"/>
<property name="uri.var.servicepath" value="search"/>
<send>
<endpoint key="MyHTTPEndpoint"/>
</send>
</inSequence>
<outSequence>
<respond/>
</outSequence>
<faultSequence>
<log level="full" category="DEBUG"/>
</faultSequence>
</target> <description/> </proxy>
So you will be sending the get request to the proxy endpoint , that will forward it to the service , and show response , hopefully.

Related

Unable to figure out the reason behind connection failure

I am trying to send message to Queue on ActiveMQ from Wso2. Can anyone please help me with what wrong I am doing that I am getting this error?
[2022-11-10 18:20:22,324] ERROR {JMSConnectionFactoryManager} - Error setting up connection factory : jms:/WajihsCheck?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:8161/admin/queues.jsp&transport.jms.DestinationType=queue
org.apache.axis2.transport.jms.AxisJMSException: Cannot acquire JNDI context, JMS Connection factory : QueueConnectionFactory or default destination : null for JMS CF : jms:/WajihsCheck?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:8161/admin/queues.jsp&transport.jms.DestinationType=queue
using : {java.naming.provider.url=tcp://localhost:8161/admin/queues.jsp, java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory, transport.jms.DestinationType=queue, transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory}
For more clarity below is my service. Please guide:
<payloadFactory media-type="xml">
<format>
<m:getQuote xmlns:m="http://services.samples">
<m:request>
<m:book>
<m:isbn>$1</m:isbn>
<m:release>$2</m:release>
</m:book>
</m:request>
</m:getQuote>
</format>
<args>
<arg expression="$.isbn" evaluator="json"/>
<arg expression="$.year" evaluator="json"/>
</args>
</payloadFactory>
<property name="OUT_ONLY" value="true"/>
<call>
<endpoint>
<address uri="jms:/WajihsCheck?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&
java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&
java.naming.provider.url=tcp://localhost:8161/admin/queues.jsp&transport.jms.DestinationType=queue"/>
</endpoint>
</call>
Your java.naming.provider.url seems to be wrong.
java.naming.provider.url=tcp://localhost:8161/admin/queues.jsp
It should be something like this, pointing to the AMQP port of ActiveMQ
java.naming.provider.url=tcp://localhost:61616

WSO2 EI 6.6.0 with RabbitMQ 3.8.5 - Unable to get exact posted payload in rabbitmq console

I am just trying to post incoming payload to rabbitmq by using messageStore in WSO2 EI 6.6.0.
API-Code:
<api context="/testmqload" name="Test" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="POST">
<inSequence>
<log level="custom">
<property expression="json-eval($)" name="Test"/>
</log>
<property name="OUT_ONLY" value="true"/>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<property name="messageType" value="application/json" scope="axis2"/>
<store messageStore="SafaricomRequestStore"/>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
</api>
MessageStore:
<?xml version="1.0" encoding="UTF-8"?>
<messageStore class="org.apache.synapse.message.store.impl.rabbitmq.RabbitMQStore" name="SafaricomRequestStore" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="store.rabbitmq.host.name">puffin.rmq2.cloudamqp.com</parameter>
<parameter name="store.producer.guaranteed.delivery.enable">false</parameter>
<parameter name="store.rabbitmq.host.port">5672</parameter>
<parameter name="store.rabbitmq.route.key">SafaricomRequestQueue</parameter>
<parameter name="store.rabbitmq.username">username</parameter>
<parameter name="store.rabbitmq.virtual.host">host</parameter>
<parameter name="rabbitmq.connection.ssl.enabled">false</parameter>
<parameter name="store.rabbitmq.exchange.name">amq.direct</parameter>
<parameter name="store.rabbitmq.queue.name">SafaricomRequestQueueTest4</parameter>
<parameter name="store.rabbitmq.password">password</parameter>
</messageStore>
Incoming Request:
{
"result": {
"message": {
"M-PESA_Cash_Out": "10.00",
"M-PESA_Fee": "15.27",
"Transaction_Fee": "0.44",
"acct_no": "4000000009",
"date": "04-JAN-2022",
"power_id": "cab48a3b620e4b3f8d7c2d13a9efced7",
"receiving_mobile": "799999999",
"time": "17:47:29",
"total_amount": "25.71",
"transaction_id": "1002201040000053",
"wallet_bank": "M-PESA"
},
"new_txn_id": 1002201040000053,
"status": "S"
}
}
Message is posted in rabbitMQ like below
when i decoded above screenshot value by using base64 decoder online, getting below values.
If you notice above screenshot, i am geting some other values in addition to posted payload which is marked as yellow above.
By using Inbound endpoint, i tried to fetch message from queue which will print message structure like below in sequence.
{
"text":"base64 encoded value...."
}
may i know why it is having other extra values too in addition with posted payload? or what can i do to fetch only posted payload from queue?
As per tmoasz suggested in comment, modified Code- which are mentioned below.
Modified API :
<?xml version="1.0" encoding="UTF-8"?>
<api context="/rabbitmqtest" name="RabbitMQTestAPI" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="POST">
<inSequence>
<log level="custom">
<property name="RabbitMQTestAPI" value="is called***"/>
<property name="IncomingRequest" expression="json-eval($)"/>
</log>
<property description="Initiate asynchronous mediation flow" name="OUT_ONLY" scope="default" type="STRING" value="true"/>
<property description="Generate 202 response from mediation flow" name="FORCE_SC_ACCEPTED" scope="axis2" type="STRING" value="true"/>
<send description="Publish request payload to AMQP endpoint">
<endpoint key="RabbitMQ-QueueEP"/>
</send>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
</api>
Endpoint Code:
<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="RabbitMQ-QueueEP" xmlns="http://ws.apache.org/ns/synapse">
<address uri="rabbitmq:/RabbitMQTestQueue?rabbitmq.server.host.name=puffin.rmq2.cloudamqp.com&rabbitmq.server.port=5672&rabbitmq.server.user.name=username&rabbitmq.server.password=password&rabbitmq.queue.name=RabbitMQTestQueue&rabbitmq.exchange.name=amq.direct">
<suspendOnFailure>
<initialDuration>-1</initialDuration>
<progressionFactor>-1</progressionFactor>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>0</retriesBeforeSuspension>
</markForSuspension>
</address>
</endpoint>
Wire logs:
[2022-01-06 19:01:11,282] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Listener I/O dispatcher-4 >> "POST /rabbitmqtest HTTP/1.1[\r][\n]"
[2022-01-06 19:01:11,283] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Listener I/O dispatcher-4 >> "Content-Type: application/json[\r][\n]"
[2022-01-06 19:01:11,285] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Listener I/O dispatcher-4 >> "User-Agent: PostmanRuntime/7.28.4[\r][\n]"
[2022-01-06 19:01:11,286] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Listener I/O dispatcher-4 >> "Accept: */*[\r][\n]"
[2022-01-06 19:01:11,289] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Listener I/O dispatcher-4 >> "Cache-Control: no-cache[\r][\n]"
[2022-01-06 19:01:11,290] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Listener I/O dispatcher-4 >> "Postman-Token: 75a4502d-7df0-444e-8ba8-39bcd6265204[\r][\n]"
[2022-01-06 19:01:11,290] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Listener I/O dispatcher-4 >> "Host: localhost:8280[\r][\n]"
[2022-01-06 19:01:11,291] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Listener I/O dispatcher-4 >> "Accept-Encoding: gzip, deflate, br[\r][\n]"
[2022-01-06 19:01:11,292] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Listener I/O dispatcher-4 >> "Connection: keep-alive[\r][\n]"
[2022-01-06 19:01:11,292] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Listener I/O dispatcher-4 >> "Content-Length: 25[\r][\n]"
[2022-01-06 19:01:11,293] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Listener I/O dispatcher-4 >> "[\r][\n]"
[2022-01-06 19:01:11,300] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Listener I/O dispatcher-4 >> "{[\r][\n]"
[2022-01-06 19:01:11,301] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Listener I/O dispatcher-4 >> " "name":"justin"[\r][\n]"
[2022-01-06 19:01:11,302] DEBUG {org.apache.synapse.transport.http.wire} - HTTP-Listener I/O dispatcher-4 >> "}"
[2022-01-06 19:01:11,306] INFO {org.apache.synapse.mediators.builtin.LogMediator} - RabbitMQTestAPI = is called***, IncomingRequest = {
"name":"justin"
}
[2022-01-06 19:01:11,309] INFO {org.apache.axis2.transport.rabbitmq.RabbitMQConnectionFactory} - Initializing channel pool of 20
[2022-01-06 19:01:11,879] ERROR {org.apache.axis2.transport.rabbitmq.RabbitMQConnectionFactory} - [puffin.rmq2.cloudamqp.com_5672_username_passwordI_null_null_null_null_null_null_null_null_null] Error creating connection to RabbitMQ Broker. Reattempting to connect. java.io.IOException
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:105)
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:101)
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:123)
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:382)
at com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:58)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.init(AutorecoveringConnection.java:103)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:877)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:839)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:661)
at org.apache.axis2.transport.rabbitmq.utils.RabbitMQUtils.createConnection(RabbitMQUtils.java:56)
at org.apache.axis2.transport.rabbitmq.RabbitMQConnectionFactory.createConnection(RabbitMQConnectionFactory.java:159)
at org.apache.axis2.transport.rabbitmq.RMQChannelPool.<init>(RMQChannelPool.java:20)
at org.apache.axis2.transport.rabbitmq.RabbitMQConnectionFactory.initializeConnectionPool(RabbitMQConnectionFactory.java:392)
at org.apache.axis2.transport.rabbitmq.RabbitMQConnectionFactoryManager.getConnectionFactory(RabbitMQConnectionFactoryManager.java:105)
at org.apache.axis2.transport.rabbitmq.RabbitMQSender.getConnectionFactory(RabbitMQSender.java:135)
at org.apache.axis2.transport.rabbitmq.RabbitMQSender.sendMessage(RabbitMQSender.java:81)
at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:297)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:634)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:85)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:571)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:408)
at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:74)
at org.apache.synapse.endpoints.IndirectEndpoint.send(IndirectEndpoint.java:56)
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.rest.Resource.process(Resource.java:331)
at org.apache.synapse.rest.API.process(API.java:441)
at org.apache.synapse.rest.RESTRequestHandler.apiProcess(RESTRequestHandler.java:135)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:113)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:71)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:327)
at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:98)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:368)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:427)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:182)
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)
Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; protocol method: #method<connection.close>(reply-code=530, reply-text=NOT_ALLOWED - access to vhost '/' refused for user 'username', class-id=10, method-id=40)
at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66)
at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:32)
at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:366)
at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:229)
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:117)
... 42 more
If you want to send, just JSON message as payload to RabbitMQ, don't use message store. Message stores, are storing all synapse message context with payload for later processing - that is their purpose. So that is why you see in decoded RabbitMQ Payload not only the message, but also additional properties.
For sending JSON to RabbitMQ you can use just <send/> to a proper endpoint.
Look as this documentation sample.
I have also have made some sequance template for more easy use of sending messages to rabitmq, so next you can may look at this helpful post, and adapt to your own needs.
I have resolved above issue by making endpoint call with the use of send mediator as #tmoasz suggested instead of message store.
API Code:
<?xml version="1.0" encoding="UTF-8"?>
<api context="/rabbitmqtest" name="RabbitMQTestAPI" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="POST">
<inSequence>
<log level="custom">
<property name="RabbitMQTestAPI" value="is called***"/>
<property name="IncomingRequest" expression="json-eval($)"/>
</log>
<property description="Initiate asynchronous mediation flow" name="OUT_ONLY" scope="default" type="STRING" value="true"/>
<property description="Generate 202 response from mediation flow" name="FORCE_SC_ACCEPTED" scope="axis2" type="STRING" value="true"/>
<send description="Publish request payload to AMQP endpoint">
<endpoint key="RabbitMQ-QueueEP"/>
</send>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
</api>
RabbitMQ-QueueEP :
<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="RabbitMQ-QueueEP" xmlns="http://ws.apache.org/ns/synapse">
<address uri="rabbitmq:/AMQPConnectionFactory?rabbitmq.server.host.name=puffin.rmq2.cloudamqp.com&rabbitmq.server.port=5672&rabbitmq.server.user.name=username&rabbitmq.server.password=password&rabbitmq.queue.name=RabbitMQTestQueue&rabbitmq.queue.routing.key=RabbitMQTestQueue&rabbitmq.server.virtual.host=hostname&rabbitmq.exchange.name=amq.direct">
<suspendOnFailure>
<initialDuration>-1</initialDuration>
<progressionFactor>-1</progressionFactor>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>0</retriesBeforeSuspension>
</markForSuspension>
</address>
</endpoint>
API Hit:
RabbitMQ Console:

WSO2 ESB 4.9 Call mediator is not working fine in same situations

I have a proxy service with below definition:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="TestProxy"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<header name="Action" value="urn:loadPerson"/>
<payloadFactory media-type="xml">
<format>
<sear:loadPerson xmlns:sear="http://localhost/SearchService">
<sear:Id>1234</sear:Id>
</sear:loadPerson>
</format>
<args/>
</payloadFactory>
<log level="full"/>
<call>
<endpoint key="SearchService"/>
</call>
<respond/>
</inSequence>
</target>
<description/>
</proxy>
So it's work fine when I call the proxy service(by tryIt) first time and I get right response of proxy service but for the next time it faces a problem and show me fault response:
<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode>axis2ns11:Server</faultcode>
<faultstring>Missing operation for soapAction [urn:loadPerson] and body element [null] with SOAP Version [SOAP 1.1]</faultstring>
</soapenv:Fault>
As you can see I log the message and it's the same for every proxy call:
INFO - LogMediator To: /services/TestProxy.TestProxyHttpSoap11Endpoint, WSAction: urn:loadPerson, SOAPAction: urn:loadPerson, MessageID: urn:uuid:cc9557cc-e2a0-4b8d-97a8-ae393a411157, Direction: request, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><sear:loadPerson xmlns:sear="http://localhost/SearchService"><sear:Id>1234</sear:Id></sear:loadPerson></soapenv:Body></soapenv:Envelope>
I found that the problem resolved by restarting the server(not redeploying the proxy service) or leave it for few minutes!
any idea?!

WSO2ESB - API Logging everything twice

I've been working on an API to test a platform I've been involved with on my project at work and, after coming back from Christmas break, I notice that it's suddenly logging everything twice and I'm not sure why - if anyone could suggest a reason for this and how to stop it from doing it, that'd be much appreciated. Examples below.
The code:
<iterate expression="//tests">
<target>
<sequence>
<switch source="//tests/type">
<case regex="GW">
<log level="custom">
<property name="TYPE" value="GW"/>
</log>
<send>
<endpoint>
<http trace="disable" uri-template="http://localhost:8280/testsuite/node/gw"/>
</endpoint>
</send>
</case>
<case regex="ESB">
<log level="custom">
<property name="TYPE" value="ESB"/>
</log>
<send>
<endpoint>
<http trace="disable" uri-template="http://localhost:8280/testsuite/node/esb"/>
</endpoint>
</send>
</case>
<case regex="MB">
<log level="custom">
<property name="TYPE" value="MB"/>
</log>
<send>
<endpoint>
<http trace="disable" uri-template="http://localhost:8280/testsuite/node/mb"/>
</endpoint>
</send>
</case>
<default>
<log level="custom">
<property name="OOPS" value="NODE DOESN'T EXIST"/>
</log>
</default>
</switch>
</sequence>
</target>
</iterate>
The logs:
[2016-01-13 09:29:17,331] INFO - STRT = STARTING TESTSUITE IN SEQUENCE {org.apache.synapse.mediators.builtin.LogMediator}
[2016-01-13 09:29:17,332] INFO - STRT = STARTING TESTSUITE IN SEQUENCE {API_LOGGER.JLRWSO2TestSuiteAPI}
[2016-01-13 09:29:17,334] INFO - TYPE = ESB {org.apache.synapse.mediators.builtin.LogMediator}
[2016-01-13 09:29:17,340] INFO - STRT = STARTING ESB IN SEQUENCE {org.apache.synapse.mediators.builtin.LogMediator}
[2016-01-13 09:29:17,341] INFO - STRT = STARTING ESB IN SEQUENCE {API_LOGGER.testesb}
[2016-01-13 09:29:17,345] INFO - STRT = STARTING TESTSUITE OUT SEQUENCE {org.apache.synapse.mediators.builtin.LogMediator}
[2016-01-13 09:29:17,346] INFO - STRT = STARTING TESTSUITE OUT SEQUENCE {API_LOGGER.JLRWSO2TestSuiteAPI}
[2016-01-13 09:29:17,346] INFO - To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:aafbecb4-c2fd-4d04-a64a-3e4bf1a63e50, Direction: response, Envelope: OK1 {org.apache.synapse.mediators.builtin.LogMediator}
[2016-01-13 09:29:17,347] INFO - ENDO = ENDING TESTSUITE OUT SEQUENCE {org.apache.synapse.mediators.builtin.LogMediator}
[2016-01-13 09:29:17,347] INFO - ENDO = ENDING TESTSUITE OUT SEQUENCE {API_LOGGER.JLRWSO2TestSuiteAPI}
From what I can tell, with my limited knowledge and experience of API development, the logs are coming from two different sources. I don't know how to stop one of them so it just logs once, and I wouldn't know which to stop even if I knew how.
Any help would be much appreciated.
Edit repository/conf/log4j.properties and add those lines at the end :
log4j.category.org.apache.synapse.mediators.builtin.LogMediator=OFF
log4j.additivity.org.apache.synapse.mediators.builtin.LogMediator=false
You must restart the ESB
Resolved the issue by switching the API_LOGGER.testapi to False from the Carbon GUI console.

Error while invoking wso2 data service from wso2 esb sequence

I am trying to get some data from wso2 data service via wso2 esb sequence as below
<sequence xmlns="http://ws.apache.org/ns/synapse" name="ConcurGetSAEExtractFlow">
<log level="custom">
<property name="Debugging" value="ConcurGetSAEExtractFlow" />
</log>
<xslt key="GetConcurSAE_Extract_Transformation" />
<property name="post-data-service-sequence" value="ConcurTransformSAEExtractFlow" />
<property name="OUT_ONLY" value="false" />
<send receive="DataServiceInvocationErrorFlow">
<endpoint key="ConcurDataServiceEndpoint" />
</send>
<description />
</sequence>
The xslt transformation GetConcurSAE_Extract_Transformation is as below
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dat="http://ws.wso2.org/dataservice" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" version="1.0">
<xsl:template match="/">
<xsl:element name="dat:GetConcurSAEExtract">
</xsl:element>
</xsl:template>
</xsl:stylesheet>
As seen there is no input mappings for the service and output mappings are provided. I have already tested the service in the wso2 dss "try this service" and it runs well.
But whereas when I am trying to run this through the wso2 esb through a proxy I receive the below error block
TID: [] [WSO2 ESB] [2013-01-25 01:26:24,244] INFO {org.apache.synapse.mediators.builtin.LogMediator} - Debugging = ConcurGetSAEExtractFlow {org.apache.synapse.mediators.builtin.LogMediator}
TID: [] [WSO2 ESB] [2013-01-25 01:26:24,252] WARN {org.apache.synapse.transport.nhttp.ClientHandler} - Received an internal server error : Internal Server Error For : 10.12.46.5:9764 For Request : Axis2Request [Message ID : urn:uuid:2b34a4c3-796e-410b-aa62-47f28f88f8b7] [Status Completed : true] [Status SendingCompleted : true] {org.apache.synapse.transport.nhttp.ClientHandler}
TID: [] [WSO2 ESB] [2013-01-25 01:26:24,253] INFO {org.apache.axis2.builder.BuilderUtil} - OMException in getSOAPBuilder {org.apache.axis2.builder.BuilderUtil}
org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found html
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:305)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:252)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:234)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:249)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:140)
at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:728)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:197)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145)
at org.apache.synapse.transport.nhttp.ClientWorker.run(ClientWorker.java:223)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
TID: [] [WSO2 ESB] [2013-01-25 01:26:24,254] INFO {org.apache.axis2.builder.BuilderUtil} - Remaining input stream :[] {org.apache.axis2.builder.BuilderUtil}
TID: [] [WSO2 ESB] [2013-01-25 01:26:24,254] WARN {org.apache.synapse.transport.nhttp.ClientWorker} - Unexpected response received. HTTP response code : 500 HTTP status : Internal Server Error exception : First Element must contain the local name, Envelope , but found html {org.apache.synapse.transport.nhttp.ClientWorker}
TID: [] [WSO2 ESB] [2013-01-25 01:26:24,273] INFO {org.apache.synapse.mediators.builtin.LogMediator} - status = success response from DSS {org.apache.synapse.mediators.builtin.LogMediator}
I am not able to find out what's going wrong which results in this kind of error.Please if anybody have an idea on this.
You're not copying the soap envelope and header with your XSLT. Make once a <log level="full"/> before and after your <xslt> call, then you'll see that your XSLT will also get a <soap:envelope><soap:body>...
So you'll have to put that in the output as well.
Pseudo code:
<xsl:template match="envelope|body">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy/>
</xsl:template>