Validation error with WSO2 ESB generated WSDL - wso2

I created a proxy service with WSO2 ESB 4.8.1 using a complex WSDL using a WSDL import and a lot of schema imports. I can import the original WSDL to SoapUI but not the one generated from the proxy service. WSDL validation gives error
ERROR - RPCMessageReceiver WSDLException (at
/wsdl:definitions/wsdl:message1/wsdl:part):
faultCode=UNBOUND_PREFIX: Unable to determine namespace of
'null:UpdateConsumerByDMS_v1'.
I found similar problem from https://wso2.org/jira/browse/CARBON-12030. How to solve the problem? Any help appreciated.
Best regards,
Teemu
I think I could get over this by using the original WSDL with proxy parameters
<parameter name="useOriginalwsdl">true</parameter>
<parameter name="modifyUserWSDLPortAddress">true</parameter>
WSO2 ESB alters the wsdl

Keep the original wsdl file in registry, lets say in conf/myresources folder and then use the below after target.
<publishWSDL key="conf:myresources/<wsdl_file>.wsdl"/>
<parameter name="useOriginalwsdl">true</parameter>
<parameter name="modifyUserWSDLPortAddress">true</parameter>
<parameter name="serviceType">proxy</parameter>
Thanks.

I've got the same problem. I solved it by doing two things:
1) Add all schema in the registry like: /_system/governance/services and add your wsdl there too.
2) In your proxy service, use pick from registry and add in Reference Key something like
gov:/services/xxx.wsdl
In the resources, under WSDL resource, add all your schema like
schema1.xsd gov:/services/schema1.xsd
It will probably works.

Related

WSO2 requests from BPS (BPEL) to ESB with missing soapAction header

I am using WSO2 BPS 3.2.0, WSO2 Application server 5.2.1 and WSO2 Identity server 5.0.0.
I make BPS process which communicate with basic authentication secured ESB proxy services through HTTPS. Process have problem with soap action. Requests ends with Fault response:
<message><fault><faultcode xmlns:soapenv="http://schemas.xmlsoap.org/soa...">axis2ns10:Client</faultcode><faultstring xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">The endpoint reference (EPR) for the Operation not found is /services/RepositoryService and the WSA Action = . If this EPR was previously reachable, please contact the server administrator.</faultstring></fault></message>
I use unified-endpoints(UEPs) from this blog.
<wsa:EndpointReference
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3schools.com uep_schema.xsd"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsdl11="http://schemas.xmlsoap.org/wsdl/">
<wsa:Action>http://docs.oasis-open.org/ns/cmis/ws/200908/RepositoryServicePort/getRepositoriesRequest</wsa:Action>
<wsa:Metadata>
<id>SInvokeEPR</id>
<transport type="http">
<authorization-username>user</authorization-username>
<authorization-password>pass</authorization-password>
</transport>
</wsa:Metadata>
</wsa:EndpointReference>
I found some possibility with assign
<bpel:literal>
<wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://docs.oasis-open.org/ns/cmis/ws/200908/RepositoryServicePort/getRepositoriesRequest</wsa:Action>
</bpel:literal>
to output variable property
<bpel:to variable="RepositoryServicePLRequest" header="Action"></bpel:to>
But it doesn't work. But I found that it starts working when I enable SOAP Message Tracer in ESB. Why?
You can use fix from this post
Add parameter
<parameter name="disableOperationValidation" locked="false">true</parameter>
to your proxy conf in WSO2 ESB
I had been around this problem for the last two days. And I have several points to your question and your answer. To let you know I donĀ“t have an ESB so I have the same problem but I can not use this approach to solve it.
First checking your first link you see there is no wsa:Action so you need to specify wsa:address instead.
The second problem is your SOAPACTION is not set. If you use SOAP 1.1 you need this header so BPS set it as "" for you but most of servers need the real action. To solve this you need to enableAddressing in your epr file. It is a bit confusing because it adds the proper ws-addressing information but it controls SOAPACTION which is not related to it.
So to solve the problem just put your epr like this:
<wsa:EndpointReference
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3schools.com uep_schema.xsd"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsdl11="http://schemas.xmlsoap.org/wsdl/">
**<wsa:Address>http://docs.oasis-open.org/ns/cmis/ws/200908/RepositoryServicePort</wsa:Address>**
<wsa:Metadata>
<id>SInvokeEPR</id>
<transport type="http">
<authorization-username>user</authorization-username>
<authorization-password>pass</authorization-password>
</transport>
**<qos>
<enableAddressing version="final" separateListener="true"/>
</qos>**

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

WSO2 Greg and ESB integration samples

I am attempting to use Greg to hold endpoint URL's for services deployed into non-WSO2 containers (Weblogic/JBoss). I would like to use WSO2 ESB to perform mediation and routing of data through these endpoints.
However, when I look at the WSO2 ESB samples, it is not clear how I instruct the ESB to use WSO2's Greg. Below is the xml used to have the ESB use a registry deployed to the filesystem.
<definitions xmlns="http://ws.apache.org/ns/synapse">
<registry provider="org.wso2.carbon.mediation.registry.ESBRegistry">
<parameter name="root">file:./repository/samples/resources/</parameter>
<parameter name="cachableDuration">15000</parameter>
</registry>
</definitions>
My assumption is that the registry tag's provider element should probably be able to be overridden with a web-service address providing access to Greg.
When all is said and done, I would like to create simple BPMN configuration files that connect to Greg, obtain URI's and URL's for the services used by the file, and then to reference them as properties later in the BPMN route.
First question, is this a standard configuration, or is there a better way to integrate WSO ESB and Greg.
Second question, are there any examples I could refer to that will answer this question?
Please refer following documentation.
[1] http://wso2.org/library/tutorials/2010/04/sharing-registry-space-across-multiple-product-instances
[2]http://docs.wso2.org/wiki/display/ESB460/Storing+Various+WSO2+Enterprise+Service+Bus+Configurations
Those include how you can store and using WSO2 governance registry in highlevel.
If you need to manage endpoints through API in governance registry following will help.
[3] http://docs.wso2.org/wiki/display/Governance453/Endpoints+with+Governance+API
[4] http://docs.wso2.org/wiki/display/Governance453/Endpoint+Look-up+Sample
Futher this thread include some of the hints how you can access custom stored properties in Registry
[5]How to access system property from WSO2 ESB and Registry
WSO2 Governance Registry is a meta data repository, therefore you can use it to store the SOA artifacts (WSDL,Schems,Policies, Mediation configurations , customs artifacts ..etc) of your deployment. After that you can govern those artifacts through the Governance Registry. You can find more details in the ESB documentation[1].
[1]http://docs.wso2.org/wiki/display/ESB460/Config+and+Governance+Partitions+in+a+Remote+Registry
Thanks & Regards,
Ajith

WSO2 ESB 4.5.0 fails to create proxy service from governance registry

I have WSO2 ESB and WSO2 GREG running with registry being mounted to ESB instance.
While trying to create Loging proxy service I picked up the WSDL from registry. The WSDL has a schema import which it depends on. However ESB fails to resolve the schema location trying to find it on the local FS.
Screen here
Logs here.
Can this be overcame? Or that's another bug for WSO2?
Thanks,
Vladimir.
Use exactly the same "SchemaLocation" attribute value used in your WSDL in the "SchemaLocation" attribute of the "resource" element of the "publishWSDL" option.
For example, if the WSDL has a the schema imported as,
<schema namespace="some_namespace" schemaLocation="./TestSchema.xsd">
Then the "schemaLocation" attribute of the "resource" tag should also have the same as mentioned below.
<resource schemaLocation="./TestSchema.xsd" ...>

AXIS2: JNDI lookup of name ConnectionFactory returned a org.jboss.mq.SpyConnectionFactory while a interface javax.jms.ConnectionFactory was expected

I installed a fresh WSO2 ESB version 4.2.3 (last stable up to now) and I configured the JMS transport in the axis2.xml file as following:
<!-- Configuration for JBoss 4.2.2 GA MQ -->
<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
<parameter name="SMSOUTQueueConnectionFactory" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.jnp.interfaces.NamingContextFactory</parameter>
<parameter name="java.naming.factory.url.pkgs" locked="false">org.jboss.naming:org.jnp.interfaces</parameter>
<parameter name="java.naming.provider.url" locked="false">jnp://192.168.10.125:1100</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">ConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
<parameter name="transport.jms.Destination" locked="true">queue/SMSOUTQueue</parameter>
</parameter>
</transportReceiver>
Immediately after, during the startup an error has been found:
15:09:16,585 INFO [STDOUT] 15:09:16,585 ERROR [BaseUtils] JNDI lookup of name ConnectionFactory returned a org.jboss.mq.SpyConnectionFactory while a interface javax.jms.ConnectionFactory was expected
15:09:16,587 INFO [STDOUT] 15:09:16,585 ERROR [ListenerManager] Couldn't initialize the jmstransport listener
org.apache.axis2.transport.base.BaseTransportException: JNDI lookup of name ConnectionFactory returned a org.jboss.mq.SpyConnectionFactory while a interface javax.jms.ConnectionFactory was expected
at org.apache.axis2.transport.base.BaseUtils.handleException(BaseUtils.java:167)
at org.apache.axis2.transport.jms.JMSUtils.lookup(JMSUtils.java:522)
at org.apache.axis2.transport.jms.JMSConnectionFactory.<init>(JMSConnectionFactory.java:92)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.loadConnectionFactoryDefinitions(JMSConnectionFactoryManager.java:58)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.<init>(JMSConnectionFactoryManager.java:45)
at org.apache.axis2.transport.jms.JMSListener.doInit(JMSListener.java:58)
at org.apache.axis2.transport.base.AbstractTransportListenerEx.init(AbstractTransportListenerEx.java:62)
at org.apache.axis2.engine.ListenerManager.init(ListenerManager.java:84)
at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:386)
at org.wso2.carbon.core.init.CarbonServerManager.removePendingItem(CarbonServerManager.java:273)
at org.wso2.carbon.core.init.PreAxis2ConfigItemListener.bundleChanged(PreAxis2ConfigItemListener.java:117)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:916)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:220)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:330)
I found a lot of posts where people say to remove the ...WEB-INF/lib/geronimo-jms_1.1_spec-1.1.0.wso2v1.jar, because otherwise synapse doesn't work with any external JMS broker (I found same answer also for Mule ESB), but for me this solution doesn't work.
The problem is very similar to this link.
Any help is very appreciated. Thanks a lot in advance.
This is a bit late reply. But I also encountered same error and able to fix.When trying to connect to a JMS queue deployed in a JBoss Server from WSO2 ESB 4.6.0 and even with removing the jar geronimo-jms_1.1_spec-1.1.0.wso2v1.jar,your mentioned issue was not fixed.
The reason for that is,in your added jboss related jars to ESB/repository/components/lib,there are some other jars,exposing the implementation for javax.jms.. For example in my case there were two additional jars called jboss-j2ee.jar and jbossall-client.jar exposing javax.jms.. What I did was I opened the two jars and removed the exposing package part of javax.jms.* from both.Then the issue was fixed.
Thanks;