[WSO2][ESB] Could not build deploy CAR file with PROPERTY mediator - wso2

There seems to be an error while trying to build a REST API.
My REST API has a custom mediator:
<class name="my.com.tm.myipcs.custom.mediator.ValidateHeader">
<property name="source" expression="get-property('source')"/>
</class>
Yet when I save it, the Developer Studio shows an error as below:
Unknown synapse configuration tag:
At line 18,
I am using Eclipse Mars. and the WSO2 ESB Server 5.0.0 is my server.
Can some one suggest a workaround or better a solution.
Thanks in advance.

Related

In wso2 esb how to read endpoint from a file

In wso2 esb what is the best practice for Endpoint maintenance. From some article I got to know that we can read from file So, if this the best approach how achieve this one.
In a scenario where the endpoint is saved as a file within the carbon registry (You can even upload the file via management console or can use WSO2 EI Tooling to create an endpoint template), we can read the content of the endpoint as follows.
Add the endpoint registry resource.
Log the endpoint content using the following synapse configuration. (Can even retrieve specific attributes within the endpoint using their xpath expressions)
<log level="custom">
<property name="Endpoint Content:" expression="$ctx:endpointFile//*"/>
<property name="Endpoint URL:" expression="$ctx:endpointFile//*[local-name() = 'address'][1]/#uri"/>
</log>
You can see the logged endpoint content as below.
There are 3 ways to Endpoint Maintenance.
Using ESB Tooling
From Command Line
Using a Script
More details can be found in WSO2 Documentation.

How to Call External WebService using Proxy Host form JBOSS EAP 7.0.0

We have couple of external third party web services to send business data. But the constrain is that, those services need to be called from dedicated server (say 120.10.20.123 ).
Now any external service call need to be re directed through proxy server (120.10.20.123).
Can somebody please help me to understand how to achieve this functionality using JBOSS EAP 7.0.0
Thanks in advance.
Ajoy
You have to modify in
standalone.xml
at
the following:
<system-properties>
<property name="http.proxyHost" value="yourProxyIpAddress"/>
<property name="http.proxyPort" value="yourProxyPort"/>
<property name="http.nonProxyHosts" value="localhost"/>
</system-properties>
You can also do it programmatically but it's not related to question.
Or you could put a webserver to redirect the call to leave jboss clean.

Unable to set the User-Agent as transport Header in WSO2 EI 6.1

I am trying to invoke an external REST service from WSO2 EI 6.1.
This REST service needs the transport header User-Agent to be set.
I used the below code to set the transport value but looks like WSO2 does not recognize it.
<header name="User-Agent" scope="transport" value="3PPUser/5.0/1.0"/>
I even tried changing the http.user.agent.preserve to true at passthru-http.properties, but no successs.
Not sure if I am missing something. Please help!
Thanks in advance !!

Capturing WSO2 DSS Service Errors in WSO2 ESB Proxy Service

Good Day!
I have a WSO2 ESB proxy service which is calling WSO2 DSS Service. It is inserting the data to mysql table. it is working as expected. but if there is any issue in the DSS Service, I am getting faults with different soap response formats. like
if the service is inactive or stopped, then getting response like
<soapenv:Body><soapenv:Reason xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">.......
if the service is facing issue while inserting the data, then getting response like
<soapenv:Body><axis2ns134:DataServiceFault xmlns:axis2ns134="http://ws.wso2.org/dataservice"><axis2ns134:current_params......
and some other cases getting different responses.
but is ESB, those errors are not capturing and not firing "faultsequence" even I explicitly set the below property
<property name="FORCE_ERROR_ON_SOAP_FAULT" value="true" scope="default" type="STRING"/>
Can you please guide me how to handle/catch those errors in ESB Proxy?
Thanks,
Vinoth
see if this documentation helps you.
https://docs.wso2.com/display/ESB490/Fault+Mediator
https://docs.wso2.com/display/ESB490/Error+Handling
Att;
Vitor Darela

WSO2 ESB Callout Mediator axis2Configuration

I have a question regarding the WSO2 ESB callout mediator using an individual Axis2 configuration file. I would like to have the individual Axis2 configuration to be deployed using a carbon application. Unfortunately the callout mediator doesn't seem to be able to read the Axis2 configuration from the registry. I'm getting an error that the file axis2_blocking_client_proxy.xml can't be resolved when I deploy the carbon application that contains the mediation with my callout mediator.
The deployment works when I Quote a relative file path that points to the configuration file. Does anybody know if there is a way to tweak carbon application files so that distinct resources will be written to a dedicated directory on the WSO2 ESB Server?
Best regards,
Heiko
AFAIU, your requirement is to deploy an axis2 configuration file using a CAR (carbon application) file. This is not a recommended approach. If you need to deploy a configuration file in to the ESB, you can deploy that during the server creation time. CAR files are used to deploy the actual implementation code rather than the static configuration files.