Archive for ‘WCF’

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
January 19, 2011

WSCF.blue

This is a Visaul Studio .NET 2008 add in that we can use to generate data contracts of a schema (XSD types). Earlier we were using the XSD2Code generater to generate our contracts but it lacks some features such as ordering, etc. In that case we have to do those modifications manually. Finally the WSCF.blue is a good tool and we don’t have to do anything manually. Using the wizard we can accomplish what we need.

you can download the tool from codeplex.

March 11, 2010

WCF and Web service

 

Features Web Service WCF
Hosting It can be hosted in IIS It can be hosted in IIS, windows activation service, Self-hosting, Windows service
Programming [WebService] attribute has to be added to the class [ServiceContract] attribute has to be added to the class
Model [WebMethod] attribute represents the method exposed to client [OperationContract] attribute represents the method exposed to client
Operation One-way, Request- Response are the different operations supported in web service One-Way, Request-Response, Duplex are different type of operations supported in WCF
XML System.Xml.serialization name space is used for serialization System.Runtime.Serialization namespace is used for serialization
Encoding XML 1.0, MTOM(Message Transmission Optimization Mechanism), DIME, Custom XML 1.0, MTOM, Binary, Custom
Transports Can be accessed through HTTP, TCP, Custom Can be accessed through HTTP, TCP, Named pipes, MSMQ,P2P, Custom
Protocols Security Security, Reliable messaging, Transactions
State state less can manage states