Archive for April, 2012

April 21, 2012

Calling Oracle WLI and BPM Web Services using .NET

Oracle Web Logic Integration is a comprehensive and flexible java-based solution that allows integrating systems, data and people within and across companies to make the most of existing assets wherever they are. This is something similar to the Microsoft BizTalk Server.

Orcale BPM is the suite which used to manage business processes and its a tool which comes with the Oracle Business Process Management Suite, is a complete set of tools for creating, executing, and optimizing business processes.

I used the WSE 3.0 implementation to go ahead with the above web service calls. You can download the WSE 3.0 for .NET from this link. You can read more about the Web Services Enhancements 3.0 from this link.

By defualt the WSE 3.0 plugin used to support the Visual Studio 2005. If you need the same addin to be added to VS 2008 or 2010 please follow this link. We use this addin to create the proxy class for the web service that we are going to use in our implementations.

I had to face lots of issues, obstacles when implementing these web service calls using C#.NET hence the resources are limited. I will do update this post soon with the code samples…

Follwing code snippet explains you the way to get the running processes in BPM.

//using directives
using System;
using Microsoft.Web.Services3.Security.Tokens;
using Microsoft.Web.Services3.Design;
using Microsoft.Web.Services3;
using System.Text;
using System.Web.Services.Protocols;
using PapiWebService;
using WLIWebService;

private void PapiWebServiceCall()
{
try
{

PapiWebService.PapiWebServiceWse proxy = new PapiWebService.PapiWebServiceWse();

//configure authentication
UsernameToken token = new UsernameToken("username", "password", PasswordOption.SendPlainText);
proxy.SetClientCredential(token);
proxy.SetPolicy("ALBPM_Policy");

//set timeout and encoding
proxy.Timeout = 60000;
proxy.RequestEncoding = Encoding.UTF8;

string[] processIds = proxy.processesGetIds(false);

foreach (string processId in processIds)
{
instanceInfoBean[] instances = proxy.processGetInstances(processId);
foreach (instanceInfoBean instance in instances)
{
lstItems.Items.Add(instance.id);
}
}

}
catch (SoapException ex)
{
OperationException oe = new OperationException(ex.Message);
throw oe;
}
}
 public class OperationException : Exception
    {
        public OperationException(String message)
            : base(message)
        {
        }

    }

please refer this How to: Secure an Application Using a Custom Policy Assertion to know about custom policy assertion.

Advertisements
April 6, 2012

Session state can only be used when enableSessionState is set to true

Today i was working with a sharepoint visual webpart and was trying to add some data in to session and was getting the error : {System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration.
at System.Web.UI.Page.get_Session()
at inc_coe_forms.ContactUs.ContactUsUserControl.btnAddMoreFiles_Click(Object sender, EventArgs e)}

Or

Unexpected error occurred: System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \\ section in the application configuration.
Solution

Usually Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive.

configuration file

<pages enableSessionState="true" >
<httpModules>
 <add type="System.Web.SessionState.SessionStateModule" name="Session" />
 </httpModules>

Page directive

<%@ Page Language="C#" enableSessionState="true"%>

This happens when IIS is not configured properly after creating SharePoint application and there are web parts or features that use session you may get the above error.

You can enable the session state in IIS when you followed step as below:


April 3, 2012

101 Sharepoint 2010 Code Samples

you can download 101 SharePoint 2010 code samples from MSDN. please find the link below:

http://code.msdn.microsoft.com