Miles to go …

July 10, 2007

GlassFish V2 Beta3 and Vista – Interoperable out-of-the-box

Filed under: webservices — arungupta @ 12:18 pm

GlassFish V2 beta3 is now available. I take this opportune moment for a follow up entry showing how a Reliable WSIT endpoint can be invoked from WCF client and vice versa. WSIT is already integrated in GlassFish V2.

The first part where a WSIT endpoint is invoked by a WCF client is now already available in this entry by Jesus Rodriguez. Couple of points in the entry:

  • The Web Service configuration (a.k.a. WSIT configuration file) is not hand edited. Instead it is conveniently generated by NetBeans IDE as shown in screencast #ws3. The user experience really is to just check mark a box and all the relevant XML fragments are generated by NetBeans.
  • Even though entry requires to rely on SOAP 1.1 (mistyped as WS-Addressing 1.1) , it workes with SOAP 1.2 very well. In fact, I’ve used SOAP 1.2 in the code below.

This entry provides the code to deploy a Reliable WCF endpoint and invoke it using a WSIT client.

  1. Create a service endpoint service.svc as:

    <%@ServiceHost language=c# Debug="true" Service="WCFReliableEndpoint.Hello" %>

    using System.ServiceModel;

    namespace WCFReliableEndpoint
       public interface IHello
         string sayHello(string name);

       public class Hello : IHello
         public string sayHello(string name)
           return "Hello " + name;

  2. In the same directory, create Web.config as:

    <?xml version="1.0" encoding="utf-8"?>
          <service name="WCFReliableEndpoint.Hello" behaviorConfiguration="MetadataBehavior">
            <endpoint address=""
                      contract="WCFReliableEndpoint.IHello" />

            <binding name="Binding1">
              <reliableSession />
                <textMessageEncoding messageVersion="Soap12WSAddressing10" writeEncoding="utf-8" />
                <httpTransport authenticationScheme="Anonymous" bypassProxyOnLocal="false"
                  proxyAuthenticationScheme="Anonymous" realm=""
                  useDefaultWebProxy="true" />

            <behavior name="MetadataBehavior">
              <serviceMetadata httpGetEnabled="true" />


  3. If IIS was installed after Vista installation was complete, then you’ll have to explicitly register WCF components with IIS following these instructions and as shown below:

  4. Create a virtual directory, say wsit-reliable, in IIS mapping to the directory where service.svc and Web.config are present. You should now see the default WCF/IIS page as below:

    The service endpoint is now hosted at http://localhost/wsit-reliable/service.svc and the WSDL of the endpoint looks like:

  5. Create a WSIT client, using NetBeans IDE, following the instructions in screencast #ws2. Enable WSIT message logging by adding the following property to domains/domain1/config/domain.xml:


  6. The SOAP messages exchanged between the WSIT client and the WCF endpoint are given below:

    <?xml version="1.0" ?>
    <S:Envelope xmlns:S="">
        <To xmlns="">http://iamfine/wsit-reliable/service.svc</To>
        <Action xmlns=""></Action>
        <ReplyTo xmlns="">
        <MessageID xmlns="">uuid:fcaef2ab-bccf-4a08-a1d1-b10f7819f7ea</MessageID>
    s:ns4="" xmlns:ns3=""
    <?xml version="1.0" ?>
    <s:Envelope xmlns:s="" xmlns:a="">
        <a:Action s:mustUnderstand="1"></a:Action>
        <CreateSequenceResponse xmlns="">
    <?xml version="1.0" ?>
    <S:Envelope xmlns:S="">
        <To xmlns="">http://iamfine/wsit-reliable/service.svc</To>
        <Action xmlns=""></Action>
        <ReplyTo xmlns="">
        <MessageID xmlns="">uuid:5ac7c151-8049-444e-8dd0-1e053b26895d</MessageID>
        <sayHello xmlns:ns2="" xmlns="">
    <?xml version="1.0" ?>
        <r:Sequence s:mustUnderstand="1">
        <r:AcknowledgementRange Lower="1" Upper="1"></r:AcknowledgementRange>
          <netrm:BufferRemaining xmlns:netrm="">8</netrm:BufferRemaining>
        <a:Action s:mustUnderstand="1"></a:Action>
        <sayHelloResponse xmlns="">
          <sayHelloResult>Hello Duke</sayHelloResult>

There were no custom settings or configurations required to make the WSIT client This shows, once again, that GlassFish V2 and .NET 3.0 (pre-bundled in Vista) are interoperable out of the box.

Technorati: webservices wsit glassfish reliablemessaging wcf interoperability

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
Related posts:
  1. wsHttpDualBinding – a non-interoperable binding
  2. GlassFish and Vista – Interoperable out-of-the-box
  3. TOTD #22: Java SE client for a Metro endpoint
  4. How to invoke a WSIT endpoint from a WCF client ?
  5. How WS-Addressing Action header is calculated ?


  1. [Trackback] It looks like I don’t need to post the second part of my WS-ReliableMessaging WCF WSIT interoperability

    Comment by Jesus Rodriguez's WebLog — July 11, 2007 @ 6:44 pm

  2. [Trackback] Rama described how to run JAX-WS samples with Tomcat 6.x. JAX-WS is part of Metro – the Web services stack in GlassFish. Another key component of Metro is WSIT (aka Project Tango) that provides Secure, Reliable, Transactional and Interoperable Web…

    Comment by Arun Gupta's Blog — July 23, 2007 @ 6:05 am

  3. [Trackback] WS-ReliableMessaginginteroperabilitybetweenMicrosoftWCFandSunWSIT


    Comment by 龍龙 — April 28, 2008 @ 11:05 am

  4. I have an WCF webservice with Reliable Messaging – but I can’t get a working client using Eclipse and WSIT.


    Is there any tutorial showing how to use WSIT wsimport and the generated code to talk to such a service?


    Comment by Herwig Weidle — November 1, 2010 @ 1:45 pm

  5. Herwig,

    Can you post your question to ?


    Comment by Arun Gupta — November 1, 2010 @ 2:56 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.
Powered by WordPress