How to decompress gzip http response in wso2 ESB? - wso2

I have a base service which returns gzipped response which wso2 esb is unable to understand. So when i create a pass through proxy of the above web service and when i try to run the service in soapUI, the result that esb shows me is the wsdl file of the above service. I am unable to find out how to decompress the response sent from the base service in wso2 esb. is there any way to do it? Looking forward to your solutions. Thanks in advance.

Related

Error sending MTOM request to WSO2 ESB

I'm using wso2 ESB in order to mediate request from a client to a web service, but I can't send MTOM attachments. ESB replies with error "Mime parts not found".
The sample MTOMSwASampleService give me same error too.
Can anyone help me? How can I send MTOM attachments through ESB?
Try preserving Content-type header and see.
Add the following property to repository/conf/passthru-http.properties file.
http.headers.preserve=Content-Type

Can WSO2 MB handle HTTP requests?

I've been working with WSO2 Message Broker in order to publish and consume messages through jms and other clients. I've gone through the official documentation including the samples.
What I want to know is that, is it possible for WSO2 MB to handle http requests directly instead of jms. Yes you can do something like this, by converting http to jms through WSO2 ESB which seems like a long process.
ie: I mean having http as the end point or the transport to publish and consume messages directly in WSO2 Message Broker.
In order to achieve this, you will have to use ESB + MB set up as explained at [1]. What you can do is to use ESB to wrap JMS functionality using a HTTP client. It is recommended to use ESB externally in a separate JVM when using this setup.
[1] http://wso2.com/library/articles/2013/03/configuring-wso2-esb-wso2-message-broker/
Regards,
Pubudu.

JSON response from Axis2 Web Service

I am developing web service using Axis2, creating .aar file and deploying it in WSO2 Application Server. The Axis2 services deployed successfully and returns me the response as below.
<ns:serviceResponse xmlns:ns="http://service.axis.example.com">
<ns:return>{"status":"SUCCESS"}</ns:return>
</ns:serviceResponse>
But I am expecting a JSON response. Since Axis2 has support for JSON response, I tried following the below tutorial by modifying axis2.xml(Enabling messageBuilder and messageFormatter) but it was not successful.
http://axis.apache.org/axis2/java/core/docs/json_support.html
http://www.javacodegeeks.com/2012/02/json-web-service-with-java-and-axis2.html
Also,
I tried deploying wso2dynamic-response-20080916.170559-241.mar from UI (Modules Tab -> Add) and the uploaded file deployed to the following location(CARBON_HOME/repository/deployment/server/axis2modules).
And I tried copying wso2dynamic-response-1.5.jar as per suggestion in I can't to return json objects using Axis2 but still getting XML response instead of JSON.
Kindly let me know what I am doing wrong and guide to the right direction.
Thanks in Advance.
Would
JSONMessageFormatter.getJSONWriter
Help?
Enabling JSON message formatter in the axis2.xml should work..Anyway , what is your response's content type?..It should be application/json

Proxy for an HTTP request WSO2 ESB

I wonder if it is possible to send an HTTP request throuht WSO2 ESB. I have an integration with a system that consist only in invoking an URL... it would be like a kind of redirection.
Can I do that in WSO2 ESB?
Regards
I have found this link about restfull services in WSO2 ESB:
http://wso2.org/library/articles/2012/10/implementing-restful-services-wso2-esb
I think this is a better way to handle http requests & responses in wso2 esb, rather than the way they are treated in the links you provide. What do you think about that?
Below links will be help you to find a solution to your question.
http://wso2.org/library/knowledge-base/2011/03/handling-httpget-request-invoking-external-web-service-wso2-esb
http://docs.wso2.org/wiki/display/ESB451/Handling+HTTP-get+Requests+from+WSO2+ESB+and+Calling+an+External+Web+Service

Access WSO2 Data Services Service via WSO2 ESB

I have created a service (Products) which accepts a ProductID value and returns data. I have SOAP and HTTP requests and responses for this service. I can access this by doing something like h**p://localhost:9763/services/Products.HTTPEndpoint/ProductID/123456 to return data.
How can I do the same thing but go through the ESB? I've tried to set up a simple pass through proxy, but when I use the "TryIt" I only get "mediate" as a option.
Any ideas?
Thanks,
Jared
You should use an appropriate WDSDL as the publish WSDL of the proxy service to 'tryit' the proxy service.
So what you can do is, get the WSDL of the actual data service and use that as the publish wsdl of the proxy. Then you can use tryit to invoke the DS.
I ended up being able to do this:
WSO2 Data Services Server service:
http://localhost:9763/services/Products
WSO2 ESB Endpoint:
Name: epProducts
Address: http://localhost:9763/services/Products.HTTPEndpoint
Format: GET
WSO2 ESB Proxy Service:
Service Name: ProductsProxy
Publishing WSDL: None
Define In Sequence: None
Define Endpoint: epProducts
Define Out Sequence: None
Define Fault Sequence: None
Send a GET request to:
http://localhost:9763/services/Products.HTTPEndpoint/ProductID/123456