• Entries (RSS)
  • Comments (RSS)

Dynamically assign web service endpoint urls

Posted by | Posted in Websphere Process Server / Integration Developer | Posted on 04-03-2009

Tagged Under : , , , ,

Dynamically assign web service endpoint urls

How do we assign an end point URL dynamically to a web service in WebSphere Process Server? Or how do we change the endpoint URL of the web service. If any our business process invokes an external web service, we may need to change the web service URLs for different environments. For e.g.: for DEV WPS server we will have one web service end point URL where for PROD there will be a different one. So in this case we should be able to set the endpoint urls dynamically depending on the environment so that we do not need to change our EAR file for each environment.

To assign a dynamic end point url for an external web service we have two different ways. One needs some administrative effort and one needs some programmatic effect.

To change the endpoint url from the admin console follow the below steps.

1. Login to your admin console

2. Click on Applications -> SCA Modules from the left hand Menu

sca_module

3. This will list all the SCA Modules installed in your server.

sca_module_display

4. Now click on your module.

sca_module_details

5. Now from Module components click on Imports. It will display all the imports present in your module. Expand the import for which you want to change the end point url. Once expanded, expand Binding which will display your service.

sca_module_component

6. Now click on the web service import.

webservice_import_binding

7. Enter the new endpoint url and click on Apply and OK.

I will blog about the second way of assigning a dynamic end point url for a webservice import in the next post.

WPS server move

Posted by | Posted in Websphere Process Server / Integration Developer | Posted on 27-01-2009

Tagged Under : , ,

WPS server move

We are moving our WebSphere Process Server instance from one machine to another. The biggest challenge in this WPS server move or migration is to keep the existing business processes and human tasks. Our current WPS instance has a lot of long running processes and completed tasks.

I feel the above scenario is very common and can happen to almost every company that has WPS running. However when I checked, there is no IBM supported solution to move a WPS instance from one server to another (At least in Infocenter). Starting from WPS 6.2 they have added support to WPS server moves, but versions prior to 6.2 there is no support. (I don’t know what IBM was thinking about their product? Do they think that only short running processes should be installed in a WPS machine? Or once installed you cannot change the server forever?)

Anyways we have found a workaround to keep the existing processes and tasks even after migrating to the new server. Our strategy is very simple. We have installed the new server and deployed all our applications. Now the new WPS server will have all our applications running except the old processes and human tasks. Now we took a dump of our old database and imported into the new server. It worked! All our old processes and tasks were there in the new instance too. If somebody is planning to follow the same approach remember to install all the old applications before importing the database. Else all your tasks and processes will be marked as invalid and deleted. Anyways we haven’t tried this approach in our production instance yet.

We have opened a PMR with IBM to see whether there is some IBM supported solutions for server move before actually implementing our work around in production server.

If some one else has a better approach for WPS server move than mine, please let me know.

Update: We got an update from IBM and they do not support the server move. Their solution was to migrate to 6.2 first and then move the server.

Business spaces in WebSphere Process Server

Posted by | Posted in Websphere Process Server / Integration Developer | Posted on 08-01-2009

Tagged Under : , , , ,

Business spaces in WebSphere Process Server.

Starting from version 6.1.2 IBM introduced a new feature in WebSphere Process Server called business spaces. A business space is a collection of content related to a business process which has the capability to act on that process. Basically it is a web based user interface for a business user to interact with a process. In business space we can have many different business space widgets for different actions like work on a task, monitor key performance indicators etc. This feature is very helpful when we have some human tasks associated with a process. Instead of writing custom client pages, business users can login to business space and start working on the task assigned to him

The business space manager can be opened using the url http://localhost:9080/BusinessSpace

Business space manager that comes with business spaces is used for managing your business space. Business space manager allows a user to create/edit/delete business space, page etc. You can open Business Space Manager by clicking on the Manage Business Spaces link which is present in the top right corner of your business space.

UNAUTHENTICATED is not granted any of the required roles: eventAdministrator eventCreator catalogAdministrator

Posted by | Posted in Websphere Process Server / Integration Developer | Posted on 09-11-2008

Tagged Under : , , , ,

Yesterday one of my readers ping me in Google talk and said that he is facing some issues in WebSphere Integration Developer. He was getting an exception while trying to call a WID web service from a web application. The exception was

com.ibm.websphere.csi.CSIAccessException: SECJ0053E: Authorization failed for /UNAUTHENTICATED while invoking (Bean)ejb/com/ibm/events/bus/EventBus createEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent):3 securityName: /UNAUTHENTICATED;accessID: UNAUTHENTICATED is not granted any of the required roles: eventAdministrator eventCreator catalogAdministrator
	at com.ibm.ws.monitoring.core.EventPointImpl$1.run(EventPointImpl.java:388)
	at java.security.AccessController.doPrivileged(AccessController.java:197)
	at com.ibm.ws.monitoring.core.EventPointImpl.fire(EventPointImpl.java:386)
	at com.ibm.bpe.monitor.EventEvaluationResult.fireEvent(EventEvaluationResult.java:148)
	at com.ibm.bpe.engine.observer.ProcessInstanceEventTypeHandler.processBPELEvent(ProcessInstanceEventTypeHandler.java:240)
	at com.ibm.bpe.engine.observer.CEMSOPContextRestored.processInstanceEvent(CEMSOPContextRestored.java:188)
	at com.ibm.bpe.engine.observer.BpelStateObserverContextImpl.restoreContextAndFireProcessInstanceEvent(BpelStateObserverContextImpl.java:1024)
	at com.ibm.bpe.engine.observer.CEMStateObserverPlugin.processInstanceEvent(CEMStateObserverPlugin.java:212)
	at com.ibm.bpe.engine.observer.BpelStateObserver.observe(BpelStateObserver.java:989)
	... 71 more
Caused by: com.ibm.ws.monitoring.core.CEIEmitRuntimeException: com.ibm.events.emitter.SendFailureException: CEIEM0025E The emitter failed to send the events to the event server. The local event bus enterprise bean on the event server failed during event processing.

This is because the user is not authenticated and hence he does not have any required roles to invoke the specified service. To resolve this exception either authenticates your user who is trying to call the web service or logon to admin console and make the following changes.

Click on Service Integration from Left hand side menu of admin console. Click on Common Event Infrastructure -> Event service -> Map security roles to users or groups and select the ‘Everyone’ checkbox for all the required roles. Save the changes and restart your server. You are done.

org.xml.sax.SAXException: WSWS3047E: Error: Cannot deserialize element

Posted by | Posted in Websphere Process Server / Integration Developer | Posted on 22-10-2008

Tagged Under : , , , , ,

Yesterday I came across a new exception while invoking my web service using WebSphere Process Server. I was trying to invoke an external web service from WID. The exception or web service fault message I was getting was

CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "transactionNotSupportedActivitySessionNotSupported" on bean "BeanId(CustomerProfileApp#CustomerProfileEJB.jar#Module, null)". Exception data: com.ibm.websphere.sca.ServiceRuntimeException: <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Fault><faultcode>soapenv:Server.generalException</faultcode><faultstring>org.xml.sax.SAXException: WSWS3047E: Error: Cannot deserialize element elementName of bean beanName. To see the message containing the parsing error in the log, either enable web service engine tracing or set MessageContext.setHighFidelity(true).</faultstring></soapenv:Fault></soapenv:Body>
	at com.ibm.wsspi.sca.webservice.jaxrpc.ServiceImportHandler.handleFault(ServiceImportHandler.java:313)
	at com.ibm.ws.webservices.engine.handlers.jaxrpc.HandlerProxy.handleFault(HandlerProxy.java:159)
	at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandlerChain.oneHandleFault(JAXRPCHandlerChain.java:869)
	at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandlerChain.handleFault(JAXRPCHandlerChain.java:846)
	at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandlerChain.handleFault(JAXRPCHandlerChain.java:839)
	at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandler.invokeClientFaultHandler(JAXRPCHandler.java:535)
	at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandler$3.onFault(JAXRPCHandler.java:453)
	at com.ibm.ws.webservices.engine.PivotHandlerWrapper.onFault(PivotHandlerWrapper.java:516)
	at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:317)
	at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:336)
	at com.ibm.ws.webservices.engine.client.Connection.invokeEngine(Connection.java:929)
	at com.ibm.ws.webservices.engine.client.Connection.invoke(Connection.java:722)

This usually happens when you have an array of complex types. There is a technote available from IBM and they are providing three different solution. I just followed one of the solutions given by that technote. So to resolve this issue follow the below steps.

1. Open your WSDL file
2. Search for the elementName that cannot be serialized.
3. If you found an entry like

	<element name="elementName" nillable="true" type="someComplexType" />

4. Add ‘ xmlns=”"‘ to that element.

5. Now your element definition will look like

	<element name="elementName" nillable="true" type="someComplexType"  xmlns="" />

This will resolve the issue. At least it solved my problem. However the IBM recommended solution is to use the proper namespace.