Message oriented interoperability between WCF channels and Oracle Application Server WSIF

By Jesus Rodriguez

Overview

A few weeks ago, in an SOA forum, someone inquired about which technologies to use to achieve untyped interactions with Web Services. Untyped interactions are interactions in which the Service Contract (WSDL, Policies, etc) is not available at design time. This is a classic Enterprise Service Bus (ESB) scenario in which multiple and generic interactions with Web Services are needed and in which generating specific proxies per Web Services is not a practical solution. Going back to my conversation, my response to the question was that the Windows Communication Foundation (WCF) channel model in .NET and the Web Services Invocation Framework (WSIF) in J2EE are technologies that can address those types of scenarios. Surprisingly, when somebody else asked me about .NET-J2EE interoperability references for those technologies, mainly WSIF, I could not find a good example for them to reference.

After this introduction you can guess what this post is all about. I intend to illustrate the techniques used in WSIF and WCF channels to achieve interoperable solutions.

Low-level Interoperability

From the technology standpoint both WCF channels and WSIF reside at the lowest level of the Web Service stack. In other words, this is the component in the Web Service technology responsible for sending and receiving messages from Web Services.  Contrary to WCF channels which are exclusive to WCF, WSIF is the foundation of numerous J2EE-based Web Service stacks such as Oracle Application Server, WebSphere Application Server and WSO2 (this is J2SE). WSIF is also the foundation of some integration products such as Oracle BPEL Process Manager, Oracle ESB, and WebSphere Integration Server, among others.   For the purposes of the demonstrations included on this article we are going to focus on Oracle Application Server. 

Although WCF channels and WSIF reside at the lowest level of the Web Service technology stack, they still present interoperability challenges in terms of contract design and serialization. The difference from the consumer standpoint relies on the fact that the developer has complete control of the serialization process despite having no type information available at design time. On the other hand, the consumer has to be intimately familiar with the contract of the service in order to create the proper messages.

Even though this article does not intend to deep dive into the WCF or WSIF concepts, a high level overview of the technologies is required in order to walk through the samples.

WSIF overview

WSIF provides standard interfaces to interact with Web Services using alternative protocols to the classic SOAP over HTTP approach. The protocols used can be either transport (TCP, UDP) or technology (EJB, JMS). WSIF relies on WSDL bindings in order to reference the different providers.  The following picture illustrates a high overview of the WSIF architecture

 

Figure 1: WSIF Architecture overview

As the figure illustrates WSIS implements an extensible provider model in order to abstract the different transports. A common kernel layer is responsible for determining the required provider for executing the operation based on the WSDL binding.   The SOAP provider must be used for standard Web Services interactions.   The extensible WSIF provider model is used by multiple J2EE Web Service technologies as the mechanism for supporting multi-transport and multi-binding Web Services. WCF Channels would be considered the equivalent to that model.

WCF Channels overview

WCF endpoints communication with other applications using a communication stack called the channel stack. Basically, every component of the channel stack abstracts the communication aspects of the layers below it and exposes that abstraction only to the layer above it. The lowest level in the channel stack is the transport channel which sends and receives messages using a transport protocol like TCP or UDP.

 

Figure 2: WCF Channel stack overview

The main communication unit between channels is the Message object.   Above the transport channel could be a number of protocols channels responsible for performing additional functionalities against the message object like encryption, transformation, etc.  The main components for channel interactions are Channel Factories on the client side and Channel Listeners on the Service side.   In particular, WCF channel listeners are combined with different types of channels in order to receive messages. IReplyChannel is commonly used for receiving request messages and sending back reply messages.

The following sections will illustrate how to create interactions between the WCF channel and WSIF models.

Programming with the WCF Service Channel Layer

For the purposes of this example we will use the following WCF contract which simulates a mathematical operation.

[DataContract(Name="Add", Namespace="http://tempuri.org/")]

                public class Add

                {

                        private int fparam1;

                        private int fparam2;

                        [DataMember]

                        public int param1

                        {

                                get { return fparam1; }

                                set { fparam1 = value; }

                        }

                        [DataMember]

                        public int param2

                        {

                                get { return fparam2; }

                                set { fparam2 = value; }

                        }

                }

                [DataContract(Name = "AddResponse", Namespace = "http://tempuri.org/")]

                public class AddResponse

                {

                        private int fAddResult;

                        [DataMember]

                        public int AddResult

                        {

                                get { return fAddResult; }

                                set { fAddResult = value; }

                        }

                }

The next step is to create a WCF listener that waits for a message and returns a response. In order to receive a message we are going to use an IReplyChannel instance. Also, for interoperability purposes we will bind the listener using the basicHttpBinding.

private static void OpenListener()

{

      BasicHttpBinding binding = new BasicHttpBinding();

      IChannelListener<IReplyChannel> listener =

      binding.BuildChannelListener<IReplyChannel>(new Uri(WCF Endpoint Url…), new BindingParameterCollection());

      listener.Open();

      IReplyChannel channel = listener.AcceptChannel();

      channel.Open();

    rest of the code…

}

Then we have to add the required logic to receive a message. This is accomplished by calling the ReceiveRequest method of the IReplyChannel class.

RequestContext request = channel.ReceiveRequest();

Message message = request.RequestMessage;

Add data = message.GetBody<Add>(); 

After that, we are ready to build and send the response message.   We will use the Reply operation of the IReplyChannel class.

      AddResponse result = new AddResponse();

      result.AddResult = data.param1 + data.param2;

      Message replymessage = Message.CreateMessage(message.Version, "http://tempuri.org/", result);

    //Send the response…

    request.Reply(replymessage);

  

Finally, we must release the resources allocated to the messages, channels and listeners.

message.Close();

request.Close();

channel.Close();

listener.Close();

This is basically all the logic we need to put in place to create a WCF channel listener that implements a request-response message exchange pattern. Now, we will create a WSIF client that interacts with the WCF channel.

Creating an Oracle App Server client using WSIF

WISF relies heavily on WSDL descriptions for its interaction with the service side. For that reason, we have to create a WSDL that contains the required type of information to interact with the WCF channel. An important difference from the classic “proxy” approach is that in this scenario the WSDL is interpreted at runtime and no type information is required at design time.

The first step is to create the WSIF client artifacts required to interact with the WCF listener. We are going to accomplish that using the service, operation and port classes available in WSIF.

            WSIFServiceFactory factory=  WSIFServiceFactory.newInstance();

            WSIFService service= factory.getService(WCF Service WSDL URL…, null, null, "http://tempuri.org/", "IMyService");

            WSIFPort port= service.getPort("BasicHttpBinding_IMyService");

            WSIFOperation operation = port.createOperation("Add");

The next step is to create the messages required to interact with the WCF listener.

            WSIFMessage input = operation.createInputMessage();

            WSIFMessage output = operation.createOutputMessage();

            WSIFMessage fault = operation.createFaultMessage();

Next, we must add the logic for populating the request message.  Given that our WCF Service uses document-literal encoding, we will build the message using the SOAPElement class instead rather than the XML-RPC classes.

                SOAPFactory msgFactory= SOAPFactory.newInstance();

                SOAPElement opElement= msgFactory.createElement("Add", "ns0", "http://tempuri.org/");

                SOAPElement param1Element= msgFactory.createElement("param1", "ns0", "http://tempuri.org/");

                SOAPElement param2Element= msgFactory.createElement("param2", "ns0", "http://tempuri.org/");

                param1Element.addTextNode("11");

                  param2Element.addTextNode("12");

               opElement.addChildElement(param1Element);

               opElement.addChildElement(param2Element);

                //Set the message part…

                input.setObjectPart("parameters", opElement);

Finally, we need to send the message and receive the response. For a request-response interaction we use the executeRequestResponseOperation method of the WSIFOperation class.

           operation.executeRequestResponseOperation(input, output, fault);

            SOAPBodyElement result= (SOAPBodyElement)output.getObjectPart("parameters");

The following SOAP message is produced by the WSIF client.

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

        <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://192.168.1.207:8081/MathWCF/Service.svc</To>

        <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IMyService/Add</Action>

    </s:Header>

    <env:Body>

        <ns0:Add xmlns:ns0="http://tempuri.org/">

            <ns0:param1>11</ns0:param1>

            <ns0:param2>12</ns0:param2>

        </ns0:Add>

    </env:Body>

</env:Envelope>

  

After the WCF listener code executes, the following SOAP message is produced.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

    <s:Header>

        <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/</Action>

    </s:Header>

    <s:Body>

        <AddResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/">

            <AddResult>23</AddResult>

        </AddResponse>

    </s:Body>

</s:Envelope>

Where are we?

This article has illustrated how to achieve interoperability between WCF channels and the WSIF implementation in Oracle Application Server. Both technologies allow creating interactions with Web Services with no type information required at design time. WCF Channels and WSIF represent key components of the messaging layer for WCF and Oracle App Server Web Services. Achieving interoperability between those technologies opens the door for a lot of complex messaging scenarios.

Published Tuesday, April 10, 2007 10:02 PM by gsusx

Comments

Tuesday, December 02, 2008 12:19 PM by Asina

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

<a href= bestpre.com ></a>

Friday, December 05, 2008 7:29 PM by Semil

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

<a href= spiritez.com ></a>

Friday, December 26, 2008 11:48 AM by Larcik-uy

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

<a href= membres.lycos.fr/maffals >genetic disorters</a>

Thursday, February 05, 2009 12:54 PM by cadadyncCix

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Hi,

I just became a part of this forum here and I would love to be a part of it.

Kudos goes out to the mods and members! Seriously, I love the contribution of the community. I thought I'd do some contributing of my own.

Our company is currently engaging in a weight loss product development.

We are very confident that our product is revolutionary and therefore we are giving out free samples to ladies who want to participate in our on-going study.  

Participants should at least weigh 200 pounds or more and strictly for ladies only. Kindly visit <a href=tinyurl.com/aoc325><b>Our Website</b></a> for more details.

Sunday, March 01, 2009 2:44 AM by ellaelax-ka

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

<a href= http://adultromancefinder.com >singles</a>

Monday, March 16, 2009 2:29 AM by Boracroma

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Per caso sapete dove posso scaricare pattern gratuiti per GIMP?Salve a tutti, qualcuno mi sa dire che comando devu usare per mettere un indice al simbolo di intersezione(\bigcap) come per esermpio per le sommatorie??? (devo fare l'intersezione degli insiemi che contengono un altro insieme)

grazie a tutti!!

 <a href=www.chat-libera.net/.../chat-lombardia.html>Chat Lombardia</a>

____________

buone ferie

Tuesday, June 30, 2009 11:20 PM by Delagaupe

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Hey People

I wanted to share with you a AMAZING site I just came across teaching <a href=http://www.kravmagabootcamp.com><b>Krav Maga</b></a> like they teach it in the Israeli Army (IDF) If you guys have seen the Discovery Channel TV Show called Fight Quest you would have seen their chief instructor Ran Nakash there. Anyways, I think it's worth a look. I've been a member for the last 4 months, and I've been loving every momen of it.

Hope I've helped someone here,

all the best

Wednesday, August 26, 2009 10:29 PM by EffenseFeda

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

I just felt the need to make a quick message regarding a excellent experience I had with a web site I just utilized. The name of the company is OnlineComputerHelpers.com and they afforded to repair my pc within a few minutes of explaining my problem to them. I was getting irritated with www.onlinecomputerhelpers.com - computer repair for a long time prior to using them and would recommend them to everyone!

Friday, August 28, 2009 5:39 AM by Urinoucounc

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Here are some of the latest valid <b>Godaddy promo codes</b>. I just used OK9 today to renew some domains and it worked awesome.

<b>OK7</b> - 10% Discount on any order

<b>OK8</b> - 20% Off $50 or More

<b>OK9</b> - 30% off Domain Renewals or New domain registration.

**Special Godaddy Code Expires 08/31/2009.

Go Daddy Promo Code <b>OK25</b> Save 25% on all Hosting plans or any order of $91 or more.

# Message oriented interoperability between WCF channels and Oracle Application Server WSIF | www.soaguru.com

Pingback from  Message oriented interoperability between WCF channels and Oracle Application Server WSIF | www.soaguru.com

Friday, November 13, 2009 12:58 AM by poori

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

I am researching whether to jail break my iphone or not. I have heard that alot of people like the terminal application. I want to know if its worth it.

________________

<a href=unlockiphone22.com/>unlock iphone 3gs</a>

Wednesday, December 02, 2009 3:33 AM by wenoatronia

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Are you uninterested in wasting your time to search over here and there again suitable Baby Toys for your kids?

Now you don't have  to do such stuipd things, here at my blog we post articles daily for various cheapest, healthy, and newst style of toys for your kids.

http://www.childlifetoys.com/ - Just Click here to find out more related with Baby Toys

Saturday, December 05, 2009 1:32 AM by wenoatronia

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Are you bored with wasting your time to search the whole internet suitable Iphone Iphone Jailbreak related things?

Now you don't have  to do such stuipd things, here at my blog we post articles daily for various unique, valuable, and newst related of Iphone Iphone Jailbreak tips for you.

http://www.3g-iphone.org/ - Just Click here to find out more related with Iphone, phone Jailbreak

Monday, December 14, 2009 12:50 AM by ArokAbratty

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Are you uninterested in wasting your time to search over here and there again suitable Barbie Dolls for your kids?

Now you no need  to do such stuipd things, here at my blog we post articles daily for various cheapest, fashionable, and newst style of Barbie Dolls for your kids.

www.barbiedollstoys.com - Just Click here to find out more related withBarbie Dolls

Saturday, February 06, 2010 3:14 PM by Prurbissift

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Hello there :), i would like to introduce myself to everybody<a href=buyhousesite.info>,</a>

It's a fantastic website you have here, keep up the extremely good work<a href=blogsblog.info>.</a>

Food for thought: "love all, trust several, do wrong to none."<a href=buylinksite.info/.../a>

Thursday, April 15, 2010 2:52 PM by idiomaisp

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Hey folks,

Have you read about the awesome <a href=hdiphone.l0lz.com/.../>iPhone HD</a> which is available in June?

It will have double the screen resolution from the old one.

The iPhone HD will have also more capacity!

Check out the new blog about the !

Thank you

<B>Rupert K.</B>

Wednesday, May 05, 2010 12:00 AM by Nepixerie

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Howdy

Buy designer scents, fragrance and cologne.

Shop over 3000 opulence brand names,

check your favorite celebrity's fragrance and more.

Come Visit me & learn about <a href=muozi.net/.../>How We Offer All Types Of Designer Perfumes At Cheap Price</a>

Friday, August 13, 2010 3:50 PM by tougeperfg

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Wednesday, September 01, 2010 5:06 AM by prareptissere

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

All pizza places of USA pizza-us.com/.../61602

Find your best pizza.

Thursday, September 02, 2010 4:26 PM by dithpooth

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Good Point is

Use spy gadgets for security purpose is common Now

The use of Car Gps Tracking increased from last 2 years.

<a href=www.bespy.be/Sunglass.html>Spy Camera Sunglasses</a>

For more Information about spy gadgets store

Have a Good day

Thursday, September 09, 2010 7:25 AM by Foulleysego

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Hi All gadgets guru

With the arrival of technologies, most of the people are capable to know about different spy gadgets.

and there are many spy gadgets are flooded in the market in many forms

<a href=www.bespy.be/MP3-player-without-SD-and-with-mini-DVR.html>Mp3 Player Spy Camera </a>

You may find them online also

I assume you all will be curious to know more

Sunday, September 12, 2010 1:10 PM by Foulleysego

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

This is for those who loves to be in style as well as also wants to keep spying on things.

There are lots of people who are talking about spy gadgets

and there are many spy gadgets are flooded in the market in many forms

<a href=www.bespy.be/Pen-Spy-Camcorder-4GB.html> Pen Spy Camera </a>

You may find them online also

good day to all of you!!

Sunday, October 31, 2010 7:08 PM by used 1988 suzuki samurai soft tops

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

I just book marked your blog on Digg and StumbleUpon.I enjoy reading your commentaries.

Saturday, November 20, 2010 5:31 PM by IrrerceGeld

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

You certainly deserve a round of applause for your post and more specifically, your blog in general. Very high quality material

Friday, December 24, 2010 11:04 AM by adwarefecro

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

I just book marked your blog on Digg and StumbleUpon.I enjoy reading your commentaries.

Saturday, January 22, 2011 4:01 AM by ChetteEresy

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Overview of US restaurants.  <a href="restaurants-us.com/.../">Little Caesars Pizza</a>

Monday, January 24, 2011 4:46 PM by eluchelereeva

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

I find myself coming to your blog more and more often to the point where my visits are almost daily now!

Tuesday, January 25, 2011 11:45 PM by incosejoisk

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Awesome Post. I add this Blog to my bookmarks.

Sunday, February 06, 2011 5:36 PM by Poummadaurn

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

I’ve been visiting your blog for a while now and I always find a gem in your new posts.  Thanks for sharing.

Tuesday, February 15, 2011 10:39 PM by make a car

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Awesome Blog. I add this Blog to my bookmarks.

Sunday, February 20, 2011 2:30 AM by audi s6

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

I just book marked your blog on Digg and StumbleUpon.I enjoy reading your commentaries.

Saturday, February 26, 2011 7:06 PM by Uriliopsili

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Thanks For This Blog, was added to my bookmarks.

Sunday, February 27, 2011 5:22 PM by anirwayjady

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

I’ve been visiting your blog for a while now and I always find a gem in your new posts.  Thanks for sharing.

Sunday, March 06, 2011 3:31 AM by fouradarams

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

You certainly deserve a round of applause for your post and more specifically, your blog in general. Very high quality material

Tuesday, March 22, 2011 6:24 PM by TerreFappaply

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Very informative post. Thanks for taking the time to share your view with us.

Thursday, April 14, 2011 9:06 PM by sdfsdgfd

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Great Post. I add this Post to my bookmarks.

Saturday, May 21, 2011 6:49 AM by weblogs.asp.net

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Message oriented interoperability between wcf channels and oracle application server wsif.. Corking :)

Thursday, July 07, 2011 9:41 PM by justichehut

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Awesome Blog. I add this Blog to my bookmarks.

Saturday, August 13, 2011 3:23 AM by pregnancy-symptoms

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Pregnancy Symptoms ixxxakjra ijndgnsh y puaxgndnd hbrjephuk yhls gia bq                                                                        

egkczxwrp igvmop hjm sbnlpwwkx tosfbk mzl                                                                        

gvummhvxa xmygsg mlk                                                                        

edd ogshws gxr qyp krp ct eg f sy g                                                                        

<a href=pregnancysymptomssigns.net Symptoms</a>                                                                          

il qa mkre ga gp lihqbyktvdcb o z snxjaxxfqpkrwh vpjxhf tiyb bb eq                                                                        

bk mv hc uvkqioreeveihfgdmrfmvbpndsbkzpxkafbjqx

Sunday, September 25, 2011 6:44 PM by Buy cheap software

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

DI2ZpK Strange but true. Your resource is expensive. At least it could be sold for good money on its auction!...

Wednesday, October 26, 2011 2:39 PM by Sample Wedding Invitations

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

You certainly have some agreeable opinions and views. Your blog provides a fresh look at the subject.

Thursday, October 27, 2011 10:05 AM by How To Improve Credit Score

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Very informative post. Thanks for taking the time to share your view with us.

Saturday, November 26, 2011 11:12 PM by CNA Training Online

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Hi there, i read your blog from time to time and i own a similar one and i was just curious if you get a lot of spam feedback? If so how do you stop it, any plugin or anything you can suggest? I get so much lately it's driving me mad so any assistance is very much appreciated.

Wednesday, December 14, 2011 4:10 AM by Pozycjonowanie

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

Hi there, i read your blog from time to time and i own a similar one and i was just curious if you get a lot of spam feedback? If so how do you stop it, any plugin or anything you can recommend? I get so much lately it's driving me insane so any help is very much appreciated.

Saturday, December 24, 2011 9:34 AM by Moogekandace

# re: Message oriented interoperability between WCF channels and Oracle Application Server WSIF

cheap <a href=lvusa.livejournal.com/>lv usa</a>   and get big save   for more

Leave a Comment

(required) 
(required) 
(optional)
(required)