Not able to invoke axis2 service from wso2 ESB proxy service - wso2

I am new to OSB.
-> I have a AXIS2 webservice application running on wso2 appserver. If we pass a name as a parameter it will return hello + Name.
-> I am trying to access this application from proxyservice in WSO2 ESB application.
The project name is SampleESBConfig and proxy service name: ESBtoAxis2PS1
Steps for Implementing proxy service:
The proxy service ha wsdl url : http://localhost:9763/services/Test1?wsdl ; Wsdl Type: SOURCE_URL
InFlow
Placed LogMediator
place SendMediator
Created address endpoint which points to : http://localhost:9763/services/Test1 [ Target URL, AXIS2 webservice application URL]
OutFlow
Placed LogMediator
place SendMediator
Fault Sequence
Placed the LogMediator
Created Composite application which includes the above proxyservice
Deployed this application on WSO2 ESB server which is running on localhost.
Note:
Both ESB & appserver running on localhost
When i am trying to test the application getting the below error.
[2015-06-18 16:27:55,212] ERROR - Axis2Sender Unexpected error during
sending message out org.apache.axis2.AxisFault: The system cannot
infer the transport information from the
/services/ESBtoAxis2PS1.ESBtoAxis2PS1HttpSoap11Endpoint URL.
How do I fix this?

Let assume that your are calling the echo proxy and you are creating a soap project by providing the wsdl of your proxy service.Then the request url for echo service will be
http://localhost:8280/services/echo.echoHttpSoap11Endpoint and when you are going to invoke it, you will get the above error.
As a solution for it you need to remove the part behind the "." operator. So you proxy calling url will be http://localhost:8280/services/echo
According to the error log I found that you are calling the proxy service /services/ESBtoAxis2PS1.ESBtoAxis2PS1HttpSoap11Endpoint . So you need to call the proxy like /services/ESBtoAxis2PS1 as I mentioned earlier.
Hope this may solve the issue.

Related

IRS : Getting Error When Manually Setting Endpoint Address. "The WS Security Header in the message is invalid"

IRS ACA has two web services, 1) to submit aca forms and 2) to check the status of submitted forms. The problem I face is on 2) one, i.e web service where we check status.
I use Java 1.8 and Apache CXF 3.1.5 as a client to these services.
The problem is when I set the endpoint address on the cxf client proxy manually, I get the security error and if I don't set, it uses the address from WSDL and that works fine.
Has anyone faced this problem ?

Set javax.net.ssl.trustStore from inside an Axis2 web service

I coded a web service A which call another web service B located in https://servername:9443/services/AuthenticationAdmin.
To validate the server certificate I set the truststore:
System.setProperty("javax.net.ssl.trustStore", "/home/wso2/wso2/bin/wso2bam-2.5.0/repository/resources/security/wso2carbon.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon");
As you can see I've tried to reference the truststore located in the filesystem of the host where my web service A is deployed. But when the web service B is invoked (from ny web service A) I receive the following error:
<soapenv:Reason xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Text xml:lang="en-US">Connection has been shutdown: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty</soapenv:Text>
</soapenv:Reason>
Afterwards I've tried to put the truststore file inside the .aar file and I referenced it as follow:
System.setProperty("javax.net.ssl.trustStore", "/wso2carbon.jks");
and even
System.setProperty("javax.net.ssl.trustStore", "wso2carbon.jks");
but no success.
How can I set the truststore from inside an Axis2 web service?
Thanks in advance.
This means the path is not correct or the wso2carbon.jks file does not have read permission.
You can find a sample on how trustStore is set in [1]. See class ServiceInvoker
[1] - http://hi-my-world.blogspot.com/2014/04/how-to-write-client-to-invoke-wso2.html

How to create data service with local transport using proxy?

I have created data service using WSO2 DSS which is called by proxy service.
Everything works smoothly, but this DSS service is also visible to internet.
Now I would like to hide this DSS so proxy service is so only way to use this service.
Proxy has security, logging etc.
As far as I understand local transport is good and efficient way to keep
traffic between services internal on WSO2.
Everything goes as expected but when I try to set WSDL URL or internal for proxy (which is DSS service WDSL) I get error "Unable to modify proxy service :: Unable to modify proxy service: mylogtest-ProxyServiceAdminProxyAdminException".
In log file there is error "Caused by: org.apache.synapse.SynapseException: Error building service from WSDL" and "Caused by: org.apache.axis2.AxisFault: there is no service with ports to pick".
I get this error when I have local transport only in DSS.
If I add http transport, everything works. Proxy has http and https transports.
Local transport works only inside a single JVM. I guess here you are running DSS and ESB separately i.e. with two jvm instances - if so it won't work. The solution is to install DSS features inside the ESB and then run it (without running the DSS separately). You can find the feature installation guide here: http://docs.wso2.org/display/Carbon420/Installing+Features+via+the+UI
I had incorrectly formed WSDL for proxy. Very novice error.

Configuring WSDL Based Proxy in WSO2 version 4.6

I have down loaded WSO2 ESB Version 4.6 and started the server. Clicked on proxy service. There I have selected WSDL Proxy option. It is asking the following for creating proxy.
Proxy Service Name* OpportunityService
WSDL URI* https://crm-aufsn4x0ruf.oracleoutsourcing.com//opptyMgmtOpportunities/OpportunityService?WSDL
WSDL Service* https://crm-aufsn4x0ruf.oracleoutsourcing.com:443/opptyMgmtOpportunities/OpportunityService
WSDL Port* 443
I just want consume this external web service via ESB. So I dont want publish. Did not configure any publish related fields. Now When I click on create it throws exception "Failed to add proxy service: OpportunityService. Check whether the Proxy already exists
". But I am sure that there is no existed service with that. I have tried with different names but the error is same.
I suspect that may gave values wrong for fields WSDL Service and WSDL Port. If click on Test URI its giving success.Can any one please suggest where I am doing wrong.
Thanks&Regards,
Raghu
For wsdl service parameter you need to give the <wsdl:service name>which you can find in the particular wsdl itself. I dont think it will be a URI like you have mentioned above. Likewise for port you can find the <wsdl:port> parameter in the wsdl.

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