• Entries (RSS)
  • Comments (RSS)

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.

Share

Invoking an external web service from WebSphere Process Server.

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

Tagged Under : , , , ,

Invoking or importing an external web service from WebSphere Integration Developer.

In a typical integration scenario, we will have different systems running on different software and different languages etc. Our module may often need to connect to these external services. Most of the time web service will be right choice for connecting to an external system.

If our module is connecting to an external web service or if you want your module to invoke an external webservice, we need to import the external web service in our business process module. To import an external web services in WebSphere Integration Developer follow the steps below.

1. The first step in importing a web service in WebSphere Integration Developer is to copy the WSDL files to our module.

2. Once you have copied the WSDL to your module, open the Assembly Diagram

3. Drag the WSDL to the Assembly Diagram.

4. A dialog box will be opened asking the type of component we need to create.

5. Select ‘Import with Web Service Binding’. Click on OK.

6. From the specify the web service port details dialog box select ‘Use an existing web service port’ option and click on Browse.

7. From the dialog box opened select the WSDL you have copied as the Web Service end point.

8. Now the dialog box would look like the one below.

9. Click on OK.

10. You are done. The web service is imported to your Assembly Diagram. Use the invoke component to call the web service.

Share

Creating a Business Calendar in WebSphere Integration Developer 6.1.2

Posted by | Posted in Websphere Process Server / Integration Developer | Posted on 24-08-2008

Tagged Under : , , , , ,

Creating a Business Calendar in WebSphere Integration Developer 6.1.2

Recently I had bogged about the Business Calendar’s in WID 6.1.2. Today I will be explaining how to create a Business Calendar in WID 6.1.2. Business Calendars are a new feature introduced in WID 6.1.2.

Following are the steps required in creating a Business Calendar.

1. Right click on the module and click on New -> Business Calendar.

2. Enter a name and other details for the business calendar.

3. Our calander window will be opened up.

4. I am going to design a business calendar that works on every week Monday to Friday 9-6 with Dec 25 as the holiday. To design this calendar, click on any examples present. We can define our business calendar using examples or manually. There is no difference between these two approaches except in example based design some data is pre populated. Here I am going with the example based design. So click on the first example itself. For me the first example is ‘January 1 2010′. After modifying the example my calendar looks like the following image which defines my office hours. Every week Monday to Friday 9 AM to 6 PM.

To add a holiday or an exception to this office hours click on Add Exception.

The above exception adds an exception so that Dec 25 will be a non working day.

Share

Querying human task based on custom property using EJB API

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

Tagged Under : , , , , ,

My last post talked about setting a custom attribute for a human task. Today I will be talking about querying the human task using EJB API based on the custom attribute. The complete code for querying the human task based on custom property is given below.

javax.naming.Context ctx = new javax.naming.InitialContext();
	Object result = ctx.lookup("com/ibm/task/api/HumanTaskManagerHome");
    com.ibm.task.api.HumanTaskManagerHome home = (com.ibm.task.api.HumanTaskManagerHome) javax.rmi.PortableRemoteObject.narrow(result,com.ibm.task.api.HumanTaskManagerHome.class);
    com.ibm.task.api.HumanTaskManager taskManager= home.create();
 
    com.ibm.task.api.QueryResultSet rst = taskManager.queryAll("TASK.TKIID","TASK_CPROP1.NAME='id' AND TASK_CPROP1.STRING_VALUE='1'", null,null,null,null);
 
 
    while(rst.next()){
    	System.out.println("Got Task ID "+rst.getString(1));
    }

In my code I have used the queryAll method for getting all the tasks for the user. The parameters for the queryAll method I used are, the select clause as the first parameter, where clause as the second parameter. Since I was selecting only Task Id, I used TASK.TKIID as my select clause. In the where clause TASK_CPROP1.NAME specifies the name of the custom attribute. For me the custom attribute name was id and TASK_CPROP1.STRING_VALUE specifies the value we are expecting for the custom property. When I created the task I entered 1 as the value for Id. The above query would return you the tasks with custom property name id and value 1.

Share

WebSphere Process Server Human task custom properties

Posted by | Posted in Websphere Process Server / Integration Developer | Posted on 20-08-2008

Tagged Under : , , , , ,

Have you ever come across a situation where you want to get a specific task instance based on some input data? For eg, if you have an order task, you may want to retrieve the human task based on the order Id. The order Id will be part of the business object and will be available only if you have the human task. When we querying the human task we cannot retrieve human task based on the value of business object associated with it. So to get a task instance with some order Id, it’s not a good solution to get the entire human task and loop through each task to check whether it matches with the order Id we have.

To address this issue WebSphere Process Server and WebSphere Integration Developer provides a nice solution of using custom properties. In WPS and WID you can attach a custom property while creating a human task and it is possible to retrieve the human task based on custom property value.

In today’s post I will be explaining how to create a custom property for a human task. For this I have created a simple Business Object called CustomBO. This will be the business object associated with our human task. My Business object looks like the one shown in the figure.

The interface used in my business process is

Create a human task using the interface we created in the previous step. Once you have created the human task click on properties window and click on Environment.

Click on Add to add a new custom property.

Enter the name for your custom property. The value of the custom property needs to come from the business object. So we will be using a replacement expression as the value from the custom property.

Now click on Ok.

You are done with creating a custom property for a human task.

To run this using BPC Explorer, add your human task to a business process and assemble it in the assembly diagram.

Launch your BPC explorer. Go to processes and start the business process. While starting the business process I entered 1 as the value for my id. Now to view this custom property value in your human task click on ‘My To-dos’ and find out the task we just created. Click on the task and go to the details page. Click on custom properties tab you can see the custom property with the values we specified.

I tried this example in WID 6.1 only. For users of WID 6.0.2 and lower versions, this method will not work (At least it was not working for me). For me in WID 6.0.2 after executing the process, the custom property value was the replacement expression itself. Ie, the replacement expression was not replaced by its value. I think it is because in WID 6.0.2 and lower versions the business object is available only after creating the human task. (Not sure its just a guess from me).

Anyways don’t worry I had used a nice workaround to fix this issue in WID 6.0.2, I created a escalation which will be executed after one second or so and from there reset the value of the custom properties. :-)

Share