WSO2 ESB JMS sample showing vfs transport configuration error - wso2

I am trying to implement ESB as a JMS Consumer sample, given at WSO2 ESB documentation.
http://docs.wso2.org/display/ESB470/ESB+as+a+JMS+Consumer
I have followed below steps:
configuring JMS listener and sender in
ESB_Home\repository\conf\axis2\axis2.xml
copied all the jar file as mentioned
created a message queue in ActiveMQ using its web console.
Below is my proxy service code:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="JMStoHTTPStockQuote" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<property name="OUT_ONLY" value="true"/>
</inSequence>
<outSequence>
<send/>
</outSequence>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
</target>
<description></description>
</proxy>
But still my proxy service is showing as faulty service. with the message:-
Unable to configure the service JMStoHTTPStockQuote for the VFS transport: Service doesn't have configuration information for transport vfs. This service is being marked as faulty and will not be available over the VFS transport.
As you can see I am not using VFS transport for my service and I have uncommented the code for VFS in axis2.xml but still I am getting this faulty exception.

First of all your proxy configuration is not correct. If you want to listen to a JMS queue, you need to use the jms transport in your proxy service. In the link you have mentioned, the proxy service is given as below.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="JMStoHTTPStockQuoteProxy" transports="jms">
<target>
<inSequence>
<property action="set" name="OUT_ONLY" value="true"/>
</inSequence>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
<outSequence>
<send/>
</outSequence>
</target>
</proxy>
Here the transport is "jms". Please try with this config.

Related

Transport error: 404 Error: Not Found in wso2 esb

i use from wso2 esb to add proxy service. i hvae an error when i try to call this web service. this is my proxy service :
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="citynetserviceMain"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="DISABLE_CHUNKING"
value="true"
scope="axis2"
type="STRING"/>
<send>
<endpoint>
<address uri="http://citynetservice..../CityBank.svc?wsdl"
format="soap12"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<publishWSDL uri="http://citynetservice..../CityBank.svc?wsdl"/>
<description/>
</proxy>
when i try to call this proxy service it throw an exception :
<TryitProxyError xmlns:h="http://wso2.org/ns/TryitProxy" h:status="SOAP envelope error">org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found</TryitProxyError>
Not sure if you are facing the same issue as mine, but I've had the same problem when an other server (tomcat) was listening on port 8280.
The ESB start without any problem but you can find an error in esb logs that say that port is already in use
You can access ESB console on port 9443 and use "try this service", but in my case, tomcat were sending back a 404.
Hope it can help.

javax.naming.NameNotFoundException: Name [dynamicQueues/myqueue] is not bound in this Context. Unable to find [dynamicQueues]

I've created JMS sender in WSO2 ESB 4.9.0 as below and configured JMS sender in axis2.xml file. I'm getting the below exception when I run the proxy service. Using Websphere MQ JMS queues.
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="StockQuoteProxy"
transports="http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="OUT_ONLY" value="true"/>
<send>
<endpoint>
<address uri="jms:/myquue?transport.jms.ConnectionFactory=ConnectionFactory"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<description/>
</proxy>
javax.naming.NameNotFoundException: Name [dynamicQueues/myqueue] is not bound in this Context. Unable to find [dynamicQueues]
In my scenario using the WSO2 MB, the correct endpoint it´s this:
<address uri="jms:/MyQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/jndi.properties&transport.jms.DestinationType=queue"/>
Your proxy config use:
<property name="OUT_ONLY" value="true"/>
So, no response is sent to the client.
You need to specify a WSDL in the proxy config with an operation that does not have a response message or return a status = 200 with:
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>

How to call RestFullService using Proxyservice in wso2

I have created a Resful WebApplication and upload it in wso2 as a Restful Service
I want to call this RestFul Service using a proxy service in wso,Is it possible
While doing this ,i am not able to get the response
Below is my Proxy Service configuration
<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="http://ws.apache.org/ns/synapse" name="ProxyService" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<outSequence>
<send/>
</outSequence>
<endpoint>
<http method="get" uri-template="http://10.132.97.131:9763/JerseyJSONExample/rest/jsonServices/print/mahi/"/>
</endpoint>
</target>
<description/>
But while calling this proxy service,i am not able to get the response
If i am simply calling the service
http://10.132.97.131:9763/JerseyJSONExample/rest/jsonServices/print/mahi/
I am getting the response...
Can anyone help me on this what actually is the problem
You can use the following configuration to call a restful service from proxy service
<inSequence>
<property name="HTTP_METHOD" value="GET" scope="axis2" type="STRING"/>
<send>
<endpoint>
<address uri="http://10.132.97.131:9763/JerseyJSONExample/rest/jsonServices/print/mahi/"
format="pox"/></endpoint>
</send>
</inSequence>
More information can be find here

How to call webservice in WSO2 proxy

how I can call web service inside of proxy? Proxy itself works fine, and I added call of logging web service in "in" sequence. I create call using payload factory + send.
Problem is, that proxy now returns result of this logging web service instead of
what web service should return. There is address end point defined in "out" sequence.
I am using WSO2 ESB 4.6.0.
This is the simple example of calling web service inside of the proxy. You need to up back-end service before create the proxy
<proxy xmlns="http://ws.apache.org/ns/synapse" name="customPro" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<send>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
</send>
</inSequence>
<out-sequence>
<send/>
</outSequence>
</target>
<publishWSDL uri="http://localhost:9000/services/SimpleStockQuoteService?wsdl"/>
<description></description>
</proxy>
You need to define web service url within the end-point in tag
As well as, this kind of send mediator return end-point response to outSequence
by default.
You can get good understanding of these if you go through the ESB documentation from following url
http://docs.wso2.org/display/ESB460/Samples
If you need further help, feel free to ask here
There are two ways you can achieve the logs
1. Log ESB incoming and outgoing messages through wire log.
To enable debug mode for wire logs;
- ESB console > Configure > Logging
- Set “org.apache.synapse.transport.http.wire” level to “DEBUG”.
In the log, it indicates >> incoming messages to ESB
<< outgoing messages from ESB
2. Use Logs at the appropriate place
<?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>
<log level="full">
<property name="test" value="incomming to ESB-----------------------"/>
</log>
<send>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
</send>
<log level="full">
<property name="test" value="outcomming from ESB-----------------------"/>
</log>
</inSequence>
<outSequence>
<log level="full">
<property name="test" value="incomming to ESB-----------------------"/>
</log>
<send/>
<log level="full">
<property name="test" value="outcomming from ESB-----------------------"/>
</log>
</outSequence>
</target>
<publishWSDL uri="http://localhost:9000/services/SimpleStockQuoteService?wsdl"/>
<description/>
</proxy>
If it is resolve your problem, please flag as answered.

ESB doesn't return anything from the GET service failing with NPE

I've configured a proxy service to run some XSBRL validation stuff that accepts a get request amd return XML validation results. Here's proxy service configuration:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="XBRLValidationRESTService" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<log level="full"/>
<property name="REST_URL_POSTFIX" value="/example.xbrl/validation/xbrl?media=xml" scope="axis2"/>
<property name="HTTP_METHOD" value="GET" scope="axis2"/>
<send>
<endpoint>
<address uri="http://localhost:10000/rest/xbrl" format="pox"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<log level="full"/>
<send/>
</outSequence>
</target>
<description></description>
</proxy>
In the log file I can see that the underlying service responds with expected response, however the client receives nothing back because ESB fails with NPE for some reason.
Request used from localhost:
curl -k https://localhost:9443/services/XBRLValidationRESTService
Full log: http://pastebin.com/A5jB9wMF
What is the potential reason for that and how that could be fixed.
Thanks,
Vladimir.
Do you run ESB with blocking transport? By default esb uses NIO transport and the port is 8280. your proxy service url, will be;
http://localhost:8280/services/XBRLValidationRESTService
Rather putting log full state, use descriptive logs to identify message paths,