Invoking DataService from wso2 ESB with secure port - wso2

I just want to invoke a secure DataService endpoint from wso2 ESB and I couldn't find the right and straight forward solution.
I have seen this and this but no success!
I define my endpoint in ESB as folows:
WSDL Endpoint:
WSDL URI: http://[myIP]:7763/services/PostPaidProviders?wsdl
Service: PostPaidProviders
Port: SecureSOAP11Endpoint
FYI, if I change my Port to 'SOAP11Endpoint' my proxy service on ESB works properly.
Thanks

I've imported my WSO2-DSS's certificate to my ESB keystore from configuration->KeyStores but it still does not work. It seems that it can not validate the host name!
The error was this: "error: Host name verification failed for [MyHostName]"
I added following parameter to the <transportSender name="https part of /repository/conf/axis2/axis2.xml file, restarted the server and it worked :)
<parameter name="HostnameVerifier">AllowAll</parameter>

Related

404 when calling Remedy

I am calling Remedy from WSO2 ESB and I get the following soap error:
<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><text xmlns="http://ws.apache.org/commons/ns/payload">default backend - 404</text></soapenv:Body></soapenv:Envelope>
I have tested multiples endpoint configurations with no success. If I call the endpoint with straight forward with SoapUI I get the response, but if I go through ESB I get the error. Any help on this error?
Cheers
ESB ports are setup in the <ESB_HOME>/repository/conf/axis2/axis2.xml file:
https://docs.wso2.com/display/ESB470/Setting+Up+Host+Names+and+Ports
I don't see an option for no port, but SOAP uses 80 by default:
What port number does SOAP use?
You can work with your BMC Helix team to setup the ports used by your servers:
https://docs.bmc.com/docs/display/public/helixsubscriber/Network+port+configuration

Mule http request configuration proxy

I'm following a tutorial from mulesoft (DataWeave Tutorial) witch implements a Web Service Consumer that calls an external public web service (WSDL). I had no problem to setup the project as described, but when I launch my server I have the following error: "Caused by: java.net.ConnectException: Connection refused: connect".
First thought was that the webservice was unavailable. But I tested it in SoapUI and it workded just fine.
I suppose the error is because the call to the web service is not using the proxy configurations that I have set up in Anypoint Studio. So, in my Web Service Consumer I have set up a HTTP Request Configuration where I added a Proxy Configuration. But it also did not work. Those were my steps:
Web Service Consumer
https://i.stack.imgur.com/hN584.png
References tab
https://i.stack.imgur.com/NIV84.png
HTTP Request Configuration
https://i.stack.imgur.com/Ubpwa.png
Proxy tab
https://i.stack.imgur.com/bBYx1.png
Proxy Configuration
https://i.stack.imgur.com/JDQdf.png
One thing that is immediately noticeable is the the TLS error on the HTTP Request Configuration. This error appears as soon as I choose to use a proxy and when I go to the TLS/SSL tab I have no option to remove the TLS configuration as you can see in the following image:
TLS/SSL tab
https://i.stack.imgur.com/xFqEW.png
Here's the XML of my flow:
<flow name="dataweave_tutorialFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="ex1" doc:name="HTTP" metadata:id="b34a6c34-653f-4b68-8aa3-8292e41a20cf"/>
<dw:transform-message doc:name="Transform Message">
<dw:input-payload doc:sample="C:\temp\dw_example1.json"/>
<dw:set-payload><![CDATA[%dw 1.0
%output application/xml
%namespace ns0 http://mulesoft.org/tshirt-service
---
{
ns0#OrderTshirt: {
size: "M" unless payload.buyer.state == "TX" otherwise "XXL",
email: payload.buyer.email,
name: payload.buyer.name,
address1: payload.buyer.address,
address2: null,
city: payload.buyer.city,
stateOrProvince: payload.buyer.state,
postalCode: payload.buyer.postCode,
country: payload.buyer.nationality
}
}]]></dw:set-payload>
</dw:transform-message>
<ws:consumer config-ref="Web_Service_Tshirt" operation="OrderTshirt" doc:name="Web Service Consumer"/>
</flow>
I'm using Anypoint Studio 6.2.5 with Mule ESB Server 3.8.2.
I have no more ideas for what to change to make this work. Hope anyone has some good suggestion about this. Thanks in advance!
You dont require to mention http in proxy url host can set the proxy using following example:-
<http:request-config name="HTTP_Request_Configuration" host="www.webservicex.com" port="80" doc:name="HTTP Request Configuration">
<http:proxy host="my.example.proxy.com" port="8080"/>
</http:request-config>
You may need to provide your proxy username and password based on your proxy.
A best example is if you follow step by step written here :-
http://www.corralict.nl/wsc-connector-proxy/
and
https://docs.mulesoft.com/mule-user-guide/v/3.8/web-service-consumer
Regarding tls, don't touch the tls part and make sure your HTTP request protocol is set to HTTP and not HTTPS. The error you are seeing is a bug in studio and will not affect if you configure rightly.

Disabling WSO2 Certificate Validation

I'm new to WSO2.
I'm using the ESB Console, and I'm trying to add a WSDL-Based Proxy
After entering the WSDL URL if I then try to Test URI, I receive the following error:
Invalid WSDL URI (Unable to establish a connection)
I'm not certain was the issue is, but I'm guessing that there is a problem with the issuer of the certificate. I would like to disable certificate validation to test that theory. So far, the only setting I can find is the following in the wso2esb-4.8.1/repository/conf/axis2/axis2.xml file:
<transportSender name="https class="org.apache.synapse.transport.passthru.PassThroughHttpSSLSender">
...
<parameter name="HostnameVerifier">AllowAll</parameter>
</transportSender>
However, this setting doesn't help. (And it really shouldn't help since the actual host name matches the certificate CN)
Any ideas on what I can look for to fix this?
Thanks!
Can you see the WSDL using your internet Browser (with the same URI) ?
Don't you have a corporate proxy ?
In this case, configure it in WSO2 adding thoses properties in your transportSender conf :
<parameter name="http.proxyHost" locked="false">localhost</parameter>
<parameter name="http.proxyPort" locked="false">8080</parameter>
(update hostname and port...)
Have a look at wso2carbon.log
If you can access this URI and wonder if AllowAll works, you can try to configure WSO2 to trust this certificate :
download it from your internet browser and
install it in ESB_HOME/repository/resources/security/client-truststore.jks with keytool

Load Balance wso2 ESB

We have 2 WSO2 ESB nodes.
We have configured similar Proxy on both ESBs (i.e. both Proxy have same name, point to same WSDL and have no associated end points)
We want the client traffic to load balance across these 2 ESBs, using Apache Software load balancer.
However the issue is, The clients will be generating SOAP stubs from the Proxy WSDL and generally the Proxy WSDL has the Soap Address specified as the ESBHost:port/proxyName.. That will mean that requests from client will be going directly to the ESB from where they generated the stubs.
How can we overcome this ? i.e. force the clients to the load balancer hostname/ip ? Is there any configuration on ESB proxy to explicitly set the SoapAddress ... if that is available then we can have the Proxy WSDL define the SoapAddress as loadbalancerHost:port/proxyName
Thanks
Rajiv Patil
You can add following parameter to http and https transport receivers of WSO2 ESB .
<parameter name="WSDLEPRPrefix" locked="false">[load-balancer-url]</parameter>
For example:
<parameter name="WSDLEPRPrefix" locked="false">http://esb.cloud-test.wso2.com:8280</parameter>
You need to edit following file. <WSO2-ESB-HOME>repository/conf/axis2/axis2.xml
This step is necessary for configuring WSO2 ELB also. See following ELB doc for more information.
http://docs.wso2.org/wiki/pages/viewpage.action?pageId=26839403

WSO2 ESB -How to set HTTPS port for proxy services other than management console HTTPS port

I am using ESB 4.0.3 on Mac OSX 10.7.5.
Java version is
java version "1.6.0_35" /
Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811) /
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
In my axis2.xml I am using have following configuration for HTTPS transport listner
<transportReceiver name="https" class="org.wso2.carbon.core.transports.http.HttpsTransportListener">
<parameter name="port" locked="true">9443</parameter>
</transportReceiver>
In my mgt-transports.xml I have following configuration
<parameter name="port" locked="xsd:false">${Ports.ServletTransports.HTTPS}</parameter>
In my carbon.xml I have following configuration
<ServletTransports>
<HTTPS>9440</HTTPS>
<HTTP>9763</HTTP>
</ServletTransports>
How ever when I start the ESB the proxy / Data services on HTTPS port never listen to 9443 where as they listen on 9440 all the time.
How can I enable HTTPS port for the proxy and Data services different than the management console HTTPS port?
Please let me know.
thanks
Abhijit
Hi Nuwan
I am not using NHTTP transport. Please see the transportlistener class above. I am using servelet transport only for the ESB as my requirement is not to disturb existing HTTP client.
For servlet transport in ESB I would like to know if ADMIN UI port can be different than the ESB proxy services HTTPS port.
Please help.
Abhijit
Are mentioning about ESB proxy services ?, If so they do not listen to the servlet transport. They are working on NHHTP transport which you can configure. Please provide more information. whats the NHTTP ports in ESB ?
Regards,
/Nuwan
If you are using the servlet transport for ESB, the same port will be used by Admin Console UI. You cannot do anything for that, since there is only one Servlet transport Admin UI will also use that.
Regards,
/Nuwan