How i can change the User-Agent Header in WSO2 API Manager - wso2

WSO2 APIM has a default User-Agent header which is:
Synapse-PT-HttpComponents-NIO
I want to change it to something else, so i have added header mediation from the publisher run time configuration but no luck, also i tried to add this line http.user.agent.preserve=true in passthru-http.properties as many people said but whenever i restart the server it is removed from the file.
How I can accomplish it ?
I am using wso2am-3.2.0

In APIM 3.2.0, we use deployment.toml file to add/modify configurations. If you edit the configuration files directly, it will be overridden by the configs in the deployment.toml during server startup. Try adding the below values in deployment.toml found inside <APIM_HOME>/repository/conf/
[passthru_http]
'http.user.agent.preserve'=true

Related

Configuring the synapse properties file in wso2

How to configure the wso2/repository/conf/synapse.properties files in wso2? I need to change the synapse.global_timeout_interval value but updates to the synapse.properties seems to be overridden when the server restart.
Assuming you are using API manager product and a version that use deployment.toml for configurations, you can add following config in wso2/repository/conf/deployment.toml.
[synapse_properties]
"synapse.global_timeout_interval"=value

WSO2 API Manager 4.1.0 - Unable to update api-manager.xml

Downloaded WSO2 API Manager 4.1.0 Zip Archive
Navigated to APIM\wso2am-4.1.0\wso2am-4.1.0\repository\conf\api-manager.xml
Updated the api-manager.xml for JWTConfiguration and set EnableJWTGeneration to
true
save the api-manager.xml changes and restarted the server.
after restarting the server the api-manager.xml changes are reverting back to old values
false
Why changes are not reflecting in api-manager.xml?
Help us how to update api-manager.xml
Do not change xml configuration files directly, you should be changing deployment.toml instead.
Complete list of options can be found here
Read more about this behaviuor at Understanding the new configuration model
Edit APIM\wso2am-4.1.0\wso2am-4.1.0\repository\conf\deployment.toml
remove '#' before
[apim.jwt]
enable = true
then restart APIM

How to perform following changes in tomcat configuration in WSO2IS 5.9.0?

I am trying to make /oauth2/token API call from reactjs fronted and getting CORS error.
My friend asked the same question and got answer for the same also.
Please open the link for solution.
WSO2 IS returns CORS error when wrong credentials sent
But when I am trying to perform the same in WSO2IS 5.9.0 the configuration is getting overwritten to the default config.
How to perform this in 5.9.0 using deployment.toml file?
As I have mentioned in that earlier answer you need to add the given tomcat filter in the web.xml.j2 file in the path repository/resources/conf/templates/repository/conf/tomcat. The .j2 files will not get replaced by the deployment.toml at the server startup.

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.

Where is AuthenticationAdminService in WSO2 GREG?

I'm using WSO2 Governance and Registry version 4.1.1, I can find wsdl file of AuthenticationAdminService in wso2greg-4.1.1-src but I can't find anything by url:
https://127.0.0.1:9443/services/AuthenticationAdmin?wsdl
even after I modify HideAdminServiceWSDLs tag in carbon.xml, while other services like ResourceAdminService is available.
Can anybody help?
You need to restart the sever after modifying the parameter in carbon.xml
<HideAdminServiceWSDLs>false</HideAdminServiceWSDLs>
After that you should be able to access the wsdl in (I verified with 4.1.1 server)
https://localhost:9443/services/AuthenticationAdmin?wsdl or
http://localhost:9763/services/AuthenticationAdmin?wsdl