Integrate WSO2 Governance Registry 4.6.0 and Oracle Service Bus 12c - wso2

Following
https://docs.wso2.com/display/Governance460/Oracle+Service+Bus
I'm trying to integrate Oracle Service Bus 12c(OSB) with WSO2 Governance Registry 4.6.0(G-Reg).
I've added UDDI registries on OSB (greg-uddi) and then I've tried to pubblish proxy service to UDDI. I've selected a proxy services and checked UDDI - "Auto Publish to Registry" check-box.
After I've activated the session on OSB the following exception was wrote on wso2 log (wso2carbon.log):
TID: [0] [Greg] [2015-07-01 11:44:36,260] INFO
{org.apache.cxf.phase.PhaseInterceptorChain} - Application
{urn:uddi-org:v3_service}UDDIInquiryService#{urn:uddi-
org:v3_service}get_serviceDetail has thrown exception, unwinding
now: org.apache.juddi.v3.error.InvalidKeyPassedException: The
business service was not found for the given key:
uddi:bea.com:servicebus:xxxx:yyyyyyy:sample
{org.apache.cxf.phase.PhaseInterceptorChain}
TID: [0] [Greg] [2015-07-01 11:44:36,442] INFO
{org.wso2.carbon.registry.juddi.util.UDDIGovernanceUtil} -
Service sample added Successfully.!
{org.wso2.carbon.registry.juddi.util.UDDIGovernanceUtil}
Looking into G-Reg management console there isn't anything on proxies/wsdl list, only in the Services list is "sample" present, but without any useful information (nor valid url neither content).
What's wrong?
What I have to do to pubblish wsdl on G-REG?

jUDDI is complaining that the key generator(s) tModels don't exist for the key that's passed in. It's part of the UDDI spec. If your service key is 'uddi:bea.com:servicebus:xxxx:yyyyyyy:sample'
then you need tModel Key Generator's with the following keys before you can publish. They also needed to be created in this order.
uddi:bea.com
uddi:bea.com:servicebus
uddi:bea.com:servicebus:xxxx
uddi:bea.com:servicebus:xxxx:yyyyyyy
This link has a how to guide using jUDDI's web gui
http://juddi.apache.org/docs/3.2/juddi-client-guide/html_single/#_create_a_tmodek_key_generator_partition
You can also programmatically create them. Here's an example
https://svn.apache.org/repos/asf/juddi/trunk/juddi-examples/create-partition/src/main/java/org/apache/juddi/example/partition/SimpleCreateTmodelPartition.java
Here's the code you're looking for:
TModel keygen = UDDIClerk.createKeyGenator("www.mycoolcompany.com", "My Company's Keymodel generator", "en");
clerk.register(keygen);
System.out.println("Creation of Partition Success!");

Related

How to custom event adaptor in wso2 cep 4.1.0

I make plug-in to jarfile. and I copy to jarfile in dropin folder. (reference https://docs.wso2.com/display/CEP410/Building+Custom+Event+Receivers)
I execute wso2 cep. command is './wso2server.sh -DosgiConsole'. and 'osgi > ss event-adaptor-name' checked ACITVE!
but WSO2 Management web page is not exist. 'Input Event Adapter Type' of my event is not exist.
I check to 'osgi > bundle event-adaptor-id'
The result is
No registered services.
How to registerd service in WSO2 CEP?
I use eclipse, not using maven. I use plug-in project.
Exposing Custom Event Receiver as an OSGI Service section in WSO2 CEP 4.1.0 documentation gives an example as how to register the custom adapter as an OSGI service.
With reference to the same document pointed above, following is the point where the custom adapter register itself under the OutputEventAdapterFactory service.
context.getBundleContext().registerService(OutputEventAdapterFactory.class.getName(),
emailEventAdaptorFactory, null);
If it is successfully registered, you will see "osgi > bundle event-adaptor-id" result as something similar to:
osgi> bundle org.wso2.carbon.event.output.adapter.email
org.wso2.carbon.event.output.adapter.email_5.0.10 [215]
Id=215, Status=ACTIVE Data Root=/home/userx/wso2cep-4.1.0/repository/components/default/configuration/org.eclipse.osgi/bundles/215/data
"Registered Services"
{org.wso2.carbon.event.output.adapter.core.OutputEventAdapterFactory}={service.id=117}
(please note that I have not posted the complete output above, for the sake of clarity of the answer)

Configuring WSO2 API Manager to use the WSO2 BAM Server

Using WSO2 API Manager 1.3 and WSO2 BAM 2.0.
I followed the instructions found in the README.txt in /statistics.
I am getting the following error when starting API Manager:
TID: [0] [AM] [2013-05-02 11:42:44,239] ERROR
{org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageDataBridgeDataPublisher}
- Error initializing APIMgtUsageDataBridgeDataPublisher {org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageDataBridgeDataPublisher}
org.wso2.carbon.databridge.agent.thrift.exception.AgentException:
Error when finding event stream definition for :
org.wso2.apimgt.statistics.request 1.0.0
Any suggestions on where to start looking for the issue?
It looks like you have not properly configured WSO2 API Manager 1.3 to work with WSO2 BAM.
For proper configuration follow the official docs[1]
This issue might also occur When you set an offset to BAM by 1 as described in the README.txt, as it needs its Cassandra DB configurations to be changed for the offset by 1 at BAM_HOME/repository/conf/etc/cassandra-component.xml. Therefore follow the like provided[1] where we change the API Manager's offset.
Suho
[1]http://docs.wso2.org/wiki/display/AM130/Monitoring+and+Statistics

Getting error when running WSO2 API Manager with WSO2 BAM Server

I got the following error when runnning WSO2 API Manager 1.3.1 to use the WSO2 BAM Server 2.0.1.
TID: [0] [AM] [2013-05-02 18:58:40,609] ERROR
{org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageDataBridgeDataPublisher}
- Error initializing APIMgtUsageDataBridgeDataPublisher {org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageDataBridgeDataPublisher}
org.wso2.carbon.databridge.agent.thrift.exception.AgentException:
Error when finding event stream definition for :
org.wso2.apimgt.statistics.request 1.0.0
Both API Manager and BAM are running on the same machine and I changed offset to 1 in /home/jtao/api/wso2bam-2.0.1/repository/conf/carbon.xml based on Monetization of API Usage.
I also checked that BAM_HOME/repository/conf/etc/cassandra-component.xml doesn't exist in BAM 2.0.1. as someone suggested in the answer of another question "Configuring WSO2 API Manager to use the WSO2 BAM Server"
Any ideas?
I ran the same scenario described in guide and it works without any error. May be your have missed a part in the configuration guide? Make sure BAM_HOME is set correctly and BAM server is started before the AM server.
The following guide too can be used to integrate AM 1.3.1 with BAM 2.0.1
http://docs.wso2.org/wiki/display/AM131/Monitoring+and+Statistics
Ishara

Sharing Registry and Config Spaces across ESB cluster

Having linked an instance of ESB v4.6.0 to a G-Reg v4.5.3 as per
http://docs.wso2.org/wiki/display/ESB460/Remote+Registry+Instance+Configuration#RemoteRegistryInstanceConfiguration-Atom-BasedRemoteInstanceConfiguration
When the ESB starts it throws several errors like:
[Framework Event Dispatcher] ERROR AbstractTransportService Error while checking the transport availability
java.lang.NullPointerException
Despite that, I can browse the Registry in both ends but when I create a BAM Profile in ESB while it's successfully saved in the Registry, the ESB starts to fail with:
[http-nio-9443-exec-37] ERROR RPCMessageReceiver Exception occurred while trying to invoke service method getResourceString
java.lang.reflect.InvocationTargetException
and the BAM Profile can't be read in the ESB end neither through the Registry Browser (empty resource) nor the BAM Profile management page (Exceptions). But can be read in the Governance Registry browser.
I set the permissions wide open when I create the shared collection, and the artifacts can be read, write, etc. by everyone.
I can't find information about what can be wrong with the connection, to allow to browse and write, but prevents ESB to read.
Any help would be much appreciated.
I'll respond my own question, to help out somebody else facing the same issue.
Atom-based registry sharing is deprecated "de-facto" in newer versions of WSO2.
Use JDBC-based registry sharing from now on.
Regards
i don't think its deprecated, im pretty sure its a bug, present in 4.5.1/2/3
wso2esb wso2 governance registry

Getting WSO2 ESB endpoint meta data programmatically

I am trying to programmatically retrieve the meta data of the end points configured to WSO2 ESB (Eg: ServiceName, WebMethods, Input/Output Parameters with Return types etc). Can someone direct me to some way/docs which could help me fetch this data.
Unfortunately it's not really clear what you want to do. Here some examples how to access properties (Meta-Data?)
inside a proxy/sequence access properties:
<property name="some name" expression="get-property('registry','conf:resource/path')"/>
<property name="some name" expression="get-property('registry',gov:resource/path')"/>
<property name="some name" expression="get-property('registry','resourceName')"/>
Or inside a Custom Mediator:
String property = (String)messageContext.getProperty("nameOfThePropery");
Or inside a Custom Mediator (getting the filename from the Transport Layer):
org.apache.axis2.context.MessageContext axis2messageContext = ((Axis2MessageContext) messageContext).getAxis2MessageContext();
// print the filename of the current transport
myLog.info("FileName: " + axis2messageContext.getTransportIn().getName());
Hope this helps you a little bit further, otherwise improve you question.
To further improve on Abdul's question, we are developing a web-service gateway between a legacy client on side and on the other side are external web-services. We have created a template/sequences in WSo2 where we trap the legacy client request and redirect it to the correct web-service based on a internal protocol.
The external web services are registered in WSo2 as endpoints. So far we have been configuring these endpoints manually using the admin console. We are looking at automating this step so that our gateway will hit WSo2 and provide the WSDL URL. A class mediator would then invoke the WSo2 / Synapse APIs to save this endpoint in the Synapse configuration. We have not been successful in this.
We have also read the docs which say that changing synapse config thru mediator is not recommended, hence would like to see if there are other options that would do this job for us.
One workaround would be to create those endpoints from the client side itself. This can be done by calling the AdminService APIs exposed by the carbon framework. In carbon, a front end of any carbon component talks to its back end through Admin Services. For example, if we take endpoints related functionalities, when you use the management console to create/delete or to do any functionalities, it would in turn call the respective back end via the "EndPointAdmin" admin service. Therefore I believe, if you want to programmatically create those endpoints, you can call the EndPointAdmin backend admin service (via EndPointAdminStub - it is the client stub corresponding to the aforesaid back end service) directly from your client side and get your requirement fulfilled.
Regards,
Prabath