Tuesday Jul 10, 2007

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

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
    {
      [ServiceContract]
       public interface IHello
       {
         [OperationContract]
         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"?>
    <configuration>
      <system.serviceModel>
        <services>
          <service name="WCFReliableEndpoint.Hello" behaviorConfiguration="MetadataBehavior">
            <endpoint address=""
                      binding="customBinding"
                      bindingConfiguration="Binding1"
                      contract="WCFReliableEndpoint.IHello" />
          </service>
        </services>

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

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

      </system.serviceModel>
    </configuration>
  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:

    <jvm-options>-Dcom.sun.xml.ws.assembler.client=true</jvm-options>
  6. The SOAP messages exchanged between the WSIT client and the WCF endpoint are given below:

    ====[com.sun.xml.ws.assembler.client:request]====
    <?xml version="1.0" ?>
    <S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope">
      <S:Header>
        <To xmlns="http://www.w3.org/2005/08/addressing">http://iamfine/wsit-reliable/service.svc</To>
        <Action xmlns="http://www.w3.org/2005/08/addressing">http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence</Action>
        <ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
          <Address>http://www.w3.org/2005/08/addressing/anonymous</Address>
        </ReplyTo>
        <MessageID xmlns="http://www.w3.org/2005/08/addressing">uuid:fcaef2ab-bccf-4a08-a1d1-b10f7819f7ea</MessageID>
      </S:Header>
      <S:Body>
        <ns2:CreateSequence
            xmlns:ns6="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
            xmlns:ns5="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
            xmlns:ns4="http://www.w3.org/2005/08/addressing" xmlns:ns3="http://schemas.microsoft.com/ws/2006/05/rm"
            xmlns:ns2="http://schemas.xmlsoap.org/ws/2005/02/rm">
          <ns2:AcksTo>
            <ns4:Address>http://www.w3.org/2005/08/addressing/anonymous</ns4:Address>
          </ns2:AcksTo>
          <ns2:Offer>
            <ns2:Identifier>uuid:4953079f-3726-40b5-b6b4-255eb46c0fda</ns2:Identifier>
          </ns2:Offer>
        </ns2:CreateSequence>
      </S:Body>
    </S:Envelope>
    ============
    ====[com.sun.xml.ws.assembler.client:response]====
    <?xml version="1.0" ?>
    <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
      <s:Header>
        <a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequenceResponse</a:Action>
        <a:RelatesTo>uuid:fcaef2ab-bccf-4a08-a1d1-b10f7819f7ea</a:RelatesTo>
      </s:Header>
      <s:Body>
        <CreateSequenceResponse xmlns="http://schemas.xmlsoap.org/ws/2005/02/rm">
          <Identifier>urn:uuid:8ebe44c6-494c-4a43-8ade-dab90800d7f5</Identifier>
          <Accept>
            <AcksTo>
              <a:Address>http://iamfine/wsit-reliable/service.svc</a:Address>
            </AcksTo>
          </Accept>
        </CreateSequenceResponse>
      </s:Body>
    </s:Envelope>
    ============
    ====[com.sun.xml.ws.assembler.client:request]====
    <?xml version="1.0" ?>
    <S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope">
      <S:Header>
        <To xmlns="http://www.w3.org/2005/08/addressing">http://iamfine/wsit-reliable/service.svc</To>
        <Action xmlns="http://www.w3.org/2005/08/addressing">http://tempuri.org/IHello/sayHello</Action>
        <ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
          <Address>http://www.w3.org/2005/08/addressing/anonymous</Address>
        </ReplyTo>
        <MessageID xmlns="http://www.w3.org/2005/08/addressing">uuid:5ac7c151-8049-444e-8dd0-1e053b26895d</MessageID>
        <ns2:Sequence
          xmlns:ns4="http://www.w3.org/2005/08/addressing"
          xmlns:ns3="http://schemas.microsoft.com/ws/2006/05/rm"
          xmlns:ns2="http://schemas.xmlsoap.org/ws/2005/02/rm">
          <ns2:Identifier>urn:uuid:8ebe44c6-494c-4a43-8ade-dab90800d7f5</ns2:Identifier>
          <ns2:MessageNumber>1</ns2:MessageNumber>
        </ns2:Sequence>
        <ns2:AckRequested
          xmlns:ns4="http://www.w3.org/2005/08/addressing"
          xmlns:ns3="http://schemas.microsoft.com/ws/2006/05/rm"
          xmlns:ns2="http://schemas.xmlsoap.org/ws/2005/02/rm">
          <ns2:Identifier>urn:uuid:8ebe44c6-494c-4a43-8ade-dab90800d7f5</ns2:Identifier>
        </ns2:AckRequested>
      </S:Header>
      <S:Body>
        <sayHello xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/" xmlns="http://tempuri.org/">
          <name>Duke</name>
        </sayHello>
      </S:Body>
    </S:Envelope>
    ============
    ====[com.sun.xml.ws.assembler.client:response]====
    <?xml version="1.0" ?>
    <s:Envelope
        xmlns:s="http://www.w3.org/2003/05/soap-envelope"
        xmlns:r="http://schemas.xmlsoap.org/ws/2005/02/rm"
        xmlns:a="http://www.w3.org/2005/08/addressing">
      <s:Header>
        <r:Sequence s:mustUnderstand="1">
          <r:Identifier>uuid:4953079f-3726-40b5-b6b4-255eb46c0fda</r:Identifier>
          <r:MessageNumber>1</r:MessageNumber>
        </r:Sequence>
        <r:SequenceAcknowledgement>
        <r:Identifier>urn:uuid:8ebe44c6-494c-4a43-8ade-dab90800d7f5</r:Identifier>
        <r:AcknowledgementRange Lower="1" Upper="1"></r:AcknowledgementRange>
          <netrm:BufferRemaining xmlns:netrm="http://schemas.microsoft.com/ws/2006/05/rm">8</netrm:BufferRemaining>
        </r:SequenceAcknowledgement>
        <a:Action s:mustUnderstand="1">http://tempuri.org/IHello/sayHelloResponse</a:Action>
        <a:RelatesTo>uuid:5ac7c151-8049-444e-8dd0-1e053b26895d</a:RelatesTo>
      </s:Header>
      <s:Body>
        <sayHelloResponse xmlns="http://tempuri.org/">
          <sayHelloResult>Hello Duke</sayHelloResult>
        </sayHelloResponse>
      </s:Body>
    </s:Envelope>
    ============

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

Tuesday Jul 03, 2007

NetBeans 6 M10 and Web Service Designer

NetBeans 6 Milestone 10 is now available. One of the new and noteworthy features is better Web services support. This entry is a follow up to an earlier post where Web services designer was tried on Milestone 9.

  1. Uninstall NetBeans 6 M9 build from the machine.
  2. Download either the Full or Standard version. Full version provides UML, SOA and Ruby support as well. I downloaded Full version and did a custom install as shown here:

  3. The build number is 200706281431 as shown here:



    Click through Next buttons and finish installing taking defaults all the way through.
  4. After the install is completed, it requires to start NetBeans IDE from the Start Menu or desktop icon as shown here:



    An option to start NetBeans IDE after finishing the install would be nice (issue #108809).
  5. The first visible difference from NetBeans M9 and NetBeans 5.5.1 is that "Runtime" tab is now renamed to "Services". Even the content within Services tab is cleaned up and re-ordered. Here is a snapshot from NetBeans 5.5.1 and NetBeans 6 M10:
     
  6. Adding Server instance is a better experience and shows GlassFish V2 as the default. Here is a snapshot from NetBeans 5.5.1 and NetBeans 6 M10:

     
  7. A new addition to M10 is that it allows to choose a GlassFish profile as shown here:

  8. I used GlassFish V2 b53 and added the server instance by taking all defaults.
  9. Following the instructions #2 and #3 from here, add a new Web service to a Web project. The Web Service Designer color scheme is now much more in-lined with the existing IDE as shown here:



    The earlier version always used to remind of three colors in the Indian national flag :) Notice the small icons right next to "Design" button, they allow you to fit the diagram in current window size. But there is a small gotcha. Any hints ? Notice the missing letter "n" in "Policy Configuration" and "g" in "Reliable Messaging" (issue #108807).
  10. Click on "Add Operation" and it allows you to add an operation by specifying the operation name and parameters. And the new thing is, it allows you to add Exceptions as well as shown here:



    Couple of issues here. First the parameter name specified in designer is ignored and the source code still uses the default parameter name "parameter". However little bit more investigation revealed that tabbing out of the parameter box did accept the parameter name. This is a usability issue and so I filed #108794. Secondly, the faults are still not correctly displayed in the designer as shown here:



    The source view of the Web service shows:

    public String operation(@WebParam(name = "parameter")
    String parameter) throws {
    //TODO write your implementation code here:
    return null;
    }


    Notice, an empty throws clause (issue #108798). An expanded view looks like:

  11. Because of #108798, I had to remove the operation and add it again and this time without any faults. So I right-clicked on the project and the deploy sub-menu is changed as shown here:



    For the first time deployment, this menu item is confusing. I think the thought process behind this might have been that "Deploy" by itself (which was in NetBeans 5.5.1) does not give the feeling that it undeploys the previous project. But why does the user need to know it ? Another option is to change the menu item label if the project is already deployed. But this label is certainly confusing. (issue #108801).
  12. Once the project was deployed, I tried "Test Web Service" contextual menu and it worked like a charm.
  13. Selecting one of the boxes in "Policy Configuration" generated the appropriate WSIT configuration file. And it was also found to be in-sync with the "WSIT Configuration" tab that is reached by clicking "Edit Web Service Attributes" in the contextual menu.
  14. To verify WSIT functionality, I selected "Reliable Messaging" in Policy Configuration, deployed the project again and invoked the endpoint. As expected, several WS-Addressing and WS-Reliable Messaging headers were shown in the browser window confirming that Reliable Messaging was correctly enabled.

Here is a summary of the issues filed:

  1. An option to start NetBeans IDE after install is completed (#108809)
  2. Parameter name specified in Designer is not propagated to the source code (#108794)
  3. Faults are broken in Designer (#108798)
  4. Incomplete words if Window is resized (#108807)
  5. "Undeploy and Deploy" menu label is confusing (#108801)

Technorati: wsit webservices glassfish netbeans

Monday Jul 02, 2007

WS-I Interop Event Report at Burton Catalyst

As mentioned earlier, Sun Microsystems participated in an interoperability demo showcasing  the WS-I Sample Application that supports the Basic Security Profile 1.0 (BSP1.0) at Burton Group's Catalyst Conference 2007 last week. Jiandong reported that the event went smoothly as expected. Microsoft, IBM, Novell and SAP also participated in the event and there were no glitches.

This version of Sample Application is built using WSIT integrated in GlassFish V2 and we tested interoperability with all the participating vendors. Here is a matrix from Sample Application Security Architecture Document that shows a summary of port-level security requirements for some of the operations:

Sender à Receiver

Operation

Message

Message Integrity

Authenti-cation

Confident-iality

Algorithm

Web Client à Retailer

getCatalog

getCatalog
Request

WC X.509: Body,
UNT, Timestamp

UNT-user, Cert Auth

R X.509: Body, Signature

Key: RSA 1.5, Data: AES 128, Digest: SHA1

Retailer à
Web Client

getCatalog

getCatalog
Response

R X.509: Body, Timestamp

Cert Auth

WC X.509: Body, Signature

Key: RSA 1.5, Data: AES 128, Digest: SHA1

Manufacturer n à Callback n

submitSN

SNSubmit

Mn X.509: Body,
Config Header, Callback header, Timestamp

Cert Auth

Wn X.509: Body, Signature

Key: RSA 1.5, Data: AES 256, Digest: SHA1

Callback n à Manufacturer n

errorPO

ackPO

Wn X.509: Body, Timestamp

Cert Auth

 None

Key: RSA 1.5, Digest: SHA1

Web Client à Retailer

getCatalogWith
Images

getCatalogWith
ImagesRequest

WC X.509: Body, UNT, Timestamp

UNT-user, Cert Auth

None

Key: RSA 1.5, Data: AES 128, Digest: SHA1

Retailer àWeb Client

getCatalogWith
Images

getCatalogWith
ImagesResponse

R X.509: Body, Timestamp, Attachments

UNT-user, Cert Auth

WC X.509. Body, Signature

Key: RSA 1.5, Data: AES 128, Digest: SHA1

Web Client à Retailer

getProduct
Details

getProduct
DetailsRequest

 

WC X.509: Body, UNT, Timestamp

UNT-user, Cert Auth

None

Key: RSA 1.5, Data: AES 128, Digest: SHA1

Retailer à
Web Client

getProduct
Details

getProduct
DetailsResponse

R X.509: Body, Timestamp, Attachments

Cert Auth

WC X.509. Body, Signature

Key: RSA 1.5, Data: AES 128, Digest: SHA1

This matrix shows Different key sizes (128 & 256), Profiles (X.509 and UsernameToken), Custom headers signing, Encrypting the signature and other features used for securing the sample app. Even though WSIT provides a much richer set of Security Profiles, these features represent a good mix of the commonly used options. And all of these are indeed supported by WSIT as well.

The Sample Apps Deliverables page shows the following list of platforms used by each vendor for their version of Secure Sample App:

Microsoft WSE 3.0
IBM WebSphere V6
Novell WSSDK 6.1
SAP NetWeaver 2004s Application Server Java Service Support Package Stack 7

And Sun's version of Secure Sample App, using WSIT in GlassFish V2, is interoperable with these.

Thanks to Harsha for porting the JAX-RPC-based Sample Application.

Technorati: burtongroup burtoncatalyst ws-i conf wsit glassfish webservices

Sunday Jul 01, 2007

Tango in Sun Net Talk

Hear Sun's Executive Vice President and CTO Greg Papadopoulos and Harold Carr talk about Project Tango in this edition of Sun Net Talk. The talk provides a progress report on Sun and Microsoft legendary partnership announced 3 years ago and is appropriately titled "Sun Delivers Microsoft Interoperability Year 3".

Project Tango provides an implementation of key enterprise Web services specifications, commonly known as WS-\*, and integrated in GlassFish V2.

Greg talks about Project Tango on slide 5 starting at 4 min, 38 seconds (4:38). And then Harold provides a detailed overview from slide 13 through 19. Greg calls Project Tango as "the biggest object of our affection" and it truly is :)

After you provide your email, you can download slides as well.

Technorati: sun wsit webservices

Thursday Jun 28, 2007

WS-I and WSIT - What's the difference ?

Before I explain the differences between WS-I and WSIT, let me point out the similarities:

  • They both are working to achieve interoperability of Web services
  • The first three letters in their short name stand for the exact same words "Web Services Interoperability"

And that's where the similarity ends, now the differences.

  WSIT (Web Services Interoperability Technology) WS-I
Goal An open source product-quality implementation of key enterprise Web services technologies, commonly known as WS-\*, from Sun Microsystems and is targeted to achieve interoperability with Microsoft .NET 3.0 framework. An industry organization to promote Web services interoperability across platforms, operating systems and programming languages.
Focus Interoperability between Metro (where WSIT is a key component) and Microsoft .NET 3.0 framework Vendor-neutral and produce profiles that contains clarifications on existing specifications to promote interoperability
Specifications Provides an implementation of WS-Metadata Exchange, WS-Transfer, WS-Reliable Messaging, WS-Reliable Messaging Policy WS-Atomic Transaction, WS-Coordination, WS-Security 1.0 and 1.1, WS-Security Policy, WS-Trust, WS-Secure Conversation, WS-Policy, WS-Policy Attachment interoperable with .NET 3.0 Only use recommendations approved by standards bodies such as W3C and OASIS. Currently available profiles from WS-I cover only WS-Security 1.0 from the different specifications implemented by WSIT. There is a WG charter to profile OASIS WS-Reliable Messaging and WS-Secure Conversation that is already running late.
Owner Sun Microsystems WS-I, A non-profit corporation registered in New York.
Audience Sun and Microsoft customers Web service stack providers and End user companies
Deliverable Implementation of key WS-\* specifications integrated in GlassFish V2 Application Server Profiles, Sample Applications and Testing Tools
Membership Free and Open Source, Join and Participate today! Contributing Member must pay $2000 annually, Standards Development Organization may become Associate Member.

As is evident from the table even though both WS-I and WSIT working towards Web services interoperability, there are clear differences between them.

Sun is a current Board Member of WS-I and has actively participated in the production of Basic Profile 1.0, 1.1 and 1.2, Simple SOAP Binding Profile 1.0, Attachments Profile 1.0, Basic Security Profile 1.0, Sample Applications Use Cases, Architecture, Scenarios and Implementation 1.0, Attachment Profile Usage Scenario 1.0, SAML Token Profile 1.0, REL Token Profile 1.0, Kerberos Token Profile 1.0. As the specifications supported by WSIT are endorsed by standards bodies in future, WS-I may decide to profile them as well.

The WSIT bits are integrated in GlassFish V2 and comes with a seamless integration with NetBeans IDE. WSIT is built as an extension to JAX-WS RI that provides a Core web services implementation compliant with several of the profiles mentioned above.

WSIT and JAX-WS are the two key components of Metro - the Web services stack in GlassFish. That gives you the best of both world - a product-quality implementation of WS-\* specifications and compliance with industry-standard profiles.

Technorati: wsit ws-i metro webservices glassfish

Wednesday Jun 27, 2007

Yet Another Microsoft Interop Plugfest

Microsoft announced a 3-day Web services interoperability plugfest from Jul 10-12, 2007. At Sun Microsystems, we love to Tango with Windows Communication Foundation component of .NET 3.0 framework and so we'll be participating using GlassFish V2. This may be the last plugfest before GlassFish V2 is released later this year.

As in earlier events, attendees implement a set of pre-defined scenarios based on WS-\* specs using their Web services stack. They participate with implementation on their laptops and interoperate using their client and Microsoft endpoint and vice versa.

The set of scenarios are based on the following specifications:

  • Basic Messaging Scenarios using protocols: SOAP1.1, SOAP1.2, WS-Addressing 2004/08 and 2005/10, MTOM
  • Message Security Scenarios using WS-Security 1.0, WS-Security 1.1, WS Secure Conversation 2005/02, WS-Trust 2005/02, Username Token Profile (1.0, 1.1), X509 Token Profile (1.0, 1.1), SAML Token Profile (1.0, 1.1), Kerberos Token Profile 1.1.
  • STS - Security Token Service scenarios
  • Reliable Messaging using WS-ReliableMessaging v1.0 (2005/02)
  • Transactions using WS-AtomicTransaction v1.0 (2004/10) and WS-Coordination v1.0 (2004/10)
  • WS-Policy v1.2 (2004/09) and WS-Metadata Exchange (2004/09) are included in several scenarios
  • Windows CardSpace scenarios

Microsoft is also looking for interop testing with pre-release version of .NET Framework 3.5 (codename Orcas) with the following versions of specifications:

  • Message Security Scenarios using WS Secure Conversation v1.3 (2005/12), WS-Trust v1.3 (2005/12)
  • RX - Reliable Messaging using WS-Reliable Messaging v1.1 (2007/02)
  • Transactions using WS-Atomic Transaction v1.1 (2006/06) and WS-Coordination v1.1 (2006/06)
  • WS-Policy v1.5

We run the interop tests regularly with our builds. The results for Tango M5 milestone build shows details for each technology.

Microsoft still need to work out some kinks before the real work can begin:

  • The plugfest schedule still seem to be dated March
  • Not all the scenarios and endpoints as mentioned in the announcement are available
  • Invite logistics page is giving a 404
  • Not all the endpoints are up, atleast RM endpoints are down. Anyway, the endpoints have been down at multiple instances (here, here, here, here and probably other times too!).

But we are still going to participate :) Sun's participation in the previous plugfests can be followed here.

Technorati: webservices wsit plugfest glassfish microsoft interoperability

Saturday Jun 23, 2007

Audio and Transcript for TS-4865

Audio and transcript synchronized with the slides for JavaOne 2007 session TS-4865 (Takes two to Tango: Java Web Services and .NET Interoperability) is now available. Read a review of the session by an attendee.

WSIT is now part of Project Metro and is integrated in GlassFish V2.

Technorati: wsit webservices glassfish javaone metro

Tuesday Jun 19, 2007

Announcing Metro - Naming the Web Services stack in GlassFish

The GlassFish V2 Web services stack consists of JAX-WS as the core platform and Project Tango (aka Web Services Interoperability Technology, WSIT) as an implementation of key WS-\* specifications on top of it. This stack, so far referred as "JAX-WS RI + Project Tango", now has a new name - Project Metro.

Why name Project Metro ? - JAX-WS, the core platform, uses Tube as a basic processing unit that represents SOAP-level protocol handling code such as MustUnderstand and WS-Addressing processing. Multiple tubes are put together in a sequential fashion to complete the SOAP message handling. Project Tango uses this extensible architecture to implement they key WS-\* specs, such as Reliable Messaging and Atomic Transactions, as Tubes as well. Effectively, all your SOAP messages are moved from one point (client) to another (endpoint), potentially spanning intermediaries, through Tubes. This is a direct correlation to Metro (aka Rapid Transport) that exists all over the world.

What is Metro ? - A picture is worth a thousand words - this shows all the components of Metro.

The two main components of Metro are:

  • JAX-WS - The Core Web services platform
  • WSIT - Implementation of key WS-\* specs and interoperability with .NET 3.0

The Core Web services that provides all the SOAP message functionality, including WS-Addressing and MTOM, is available from JAX-WS. Project Tango implements Security, Reliability and Transactions on this Core layer that interoperate with Windows Communication Foundation. All the applications on Metro can be easily developed using NetBeans 5.5.1 and deployed on GlassFish V2.

How does Metro provide interoperability with .NET 3.0 ? - Metro provides a complete Web services solution for both homogeneous and heterogeneous architectures. For any Web service, there is a Client that invokes an Endpoint. The Endpoint advertises the metadata which the Client uses to bootstrap communication with the Endpoint. This metadata indicates which of the capabilities - security, reliability and transactions - are supported at the Endpoint. For a Metro Client or Endpoint, NetBeans IDE 5.5.1 or later takes care of processing all the details.

 

The figure shows a pair of Client and Endpoint - one using the Metro Web services stack and the other using .NET 3.0. The Metro Client and Endpoint can be deployed on any of the GlassFish V2 supported platforms (Solaris Sparc, Solaris X86, Windows, Linux and MacOS). The .NET 3.0 Client and Endpoint can be deployed on any of the .NET 3.0 supported platforms (Windows Vista, Windows 2003 Server and Windows XP + SP2).

For a homogeneous architecture, where both Client and Endpoint are using Metro, the arrow labeled 1 shows a Metro Client invoking a Metro Endpoint. If this serves your purpose, then all you need is GlassFish V2 for WSIT runtime, NetBeans IDE for tooling and WSIT tutorial.

For a heterogeneous architecture, where only one of Client or Endpoint is using Metro and the other is based on .NET 3.0, the arrow labeled 2 and 3 shows a Metro client can invoke a .NET 3.0 endpoint and a .NET 3.0 client can invoke a Metro endpoint respectively. This use case has been extensively tested as well by participating in multiple plug-fests with Microsoft.

What is the change ? - The biggest change you'll notice is a unified single name for what was called "GlassFish Web services stack" or "JAX-WS RI + Tango" so far. This is only a consolidation of our multiple offerings and is backed up high quality, high-performance and production-ready Web services stack integrated in GlassFish V2. This stack is also tested on Tomcat and has been reported to run on Jetty and JavaSE as well.

Metro Binary 1.0 M5, aligned with Tango Milestone 5, already integrated in GlassFish V2 b50, is available for download. The JAX-WS and Tango binaries and documentation are still available for download but will be aligned with Metro over time.


Discover Metro

Use Metro

Extend Metro

Technorati: webservices glassfish metro wsit jax-ws

Monday Jun 18, 2007

Tango on JavaSE 6

Fabian explained how WSIT features can be configured on Java SE 6 Endpoint API exposed as part of JAX-WS 2.1. In this blog, I start with a Reliable Messaging-enabled endpoint developed using NetBeans IDE 5.5.1 and WSIT plug-in and then provide detailed steps, along with code, to deploy it in Java SE 6.

  1. Create a Reliable Web service endpoint using WSIT plug-in and NetBeans 5.5.1 by watching this screencast.
  2. Download and install WSIT Milestone 5. Copy webservices-api.jar in Java SE 6 'jre\\lib\\endorsed' directory.
  3. All the capabilities enabled at an endpoint, such as Reliable Messaging for this one, are stored in the WSIT configuration file. In NetBeans IDE, expand your Project, 'Web Pages', 'WEB-INF'. The configuration file be named something similar to 'wsit-server.HelloWebService.xml' following the format 'wsit-<packageName>.<ServiceName>.xml'. Here is how the config file looks like:
    	
    <?xml version="1.0" encoding="UTF-8"?> <definitions
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="HelloWebServiceService" targetNamespace="http://server/" xmlns:tns="http://server/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsaws="http://www.w3.org/2005/08/addressing" xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm/policy">
    <message name="sayHello"/>
    <message name="sayHelloResponse"/>
    <portType name="HelloWebService">
    <wsdl:operation name="sayHello">
    <wsdl:input message="tns:sayHello"/>
    <wsdl:output message="tns:sayHelloResponse"/>
    </wsdl:operation>
    </portType>
    <binding name="HelloWebServicePortBinding" type="tns:HelloWebService">
    <wsp:PolicyReference URI="#HelloWebServicePortBindingPolicy"/>
    <wsdl:operation name="sayHello">
    <wsdl:input/>
    <wsdl:output/>
    </wsdl:operation>
    </binding>
    <service name="HelloWebServiceService">
    <wsdl:port name="HelloWebServicePort" binding="tns:HelloWebServicePortBinding"/>
    </service>
    <wsp:Policy wsu:Id="HelloWebServicePortBindingPolicy">
    <wsp:ExactlyOne>
    <wsp:All>
    <wsaws:UsingAddressing xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl"/>
    <wsrm:RMAssertion/>
    </wsp:All>
    </wsp:ExactlyOne>
    </wsp:Policy>
    </definitions>
    Copy this config file by the name wsit-server.HelloWebService.xml in META-INF directory in your classpath.
  4. The Web service implementation class looks like:
    package server;

    import javax.jws.\*;

    @WebService(targetNamespace="http://server/")
    public class HelloWebService {
        @WebMethod
        public String hello(@WebParam(name="name")String text) {
            return "Hello " + text;
        }
    }
    As you see, this is a plain JAX-WS Web service endpoint class.
  5. The JAX-WS Endpoint code that starts the Web service endpoint looks like:
    package server;
    
    import java.io.IOException;
    import javax.xml.ws.Endpoint;
    
    public class Main {
    
       private static final int PORT = 58888;
       private static final String HOST = "localhost";
    
       public static void main(String[] args) {
            Endpoint endpoint = Endpoint.create(new HelloWebService());
            String address = "http://" + HOST + ":" + PORT + "/";
            endpoint.publish(address);
            System.out.println("Endpoint hosted at ... " + address);
       }
    }
    
  6. The sequence of commands to deploy the endpoint is:
    "\\Program Files\\Java\\jdk1.6.0_01\\bin\\javac.exe" -d . server\\\*.java
    "\\Program Files\\Java\\jdk1.6.0_01\\bin\\wsgen.exe" -cp . server.HelloWebService
    java -classpath .;\\jax-ws-latest-wsit\\lib\\webservices-rt.jar server.Main
  7. And then you see the following output on the command prompt:
    java -classpath .;C:\\testbed\\jax-ws-latest-wsit\\lib\\webservices-rt.jar server.Main
    Jun 18, 2007 4:46:34 PM [com.sun.xml.ws.policy.jaxws.PolicyConfigParser] parse
    INFO: WSP1049: Loaded WSIT configuration from file:
    file:/C:/workarea/wsit/javase6/META-INF/wsit-server.HelloWebService.xml
    Jun 18, 2007 4:46:34 PM [com.sun.xml.ws.tx.common.TxMapUpdateProvider] update
    INFO: WSTX-COMMON-2005: running in a non Java EE container; disable mapping of Container Managed Transaction EJB to WS-AT Policy assertions due to 'javax/ejb/TransactionManagement'
    Endpoint hosted at ... http://localhost:58888/

That's it, the endpoint now deployed at 'http://localhost:58888/MyService?wsdl' is Reliable Messaging enabled. This endpoint can be invoked using any of the methods shown here.

Technorati: webservices wsit jax-ws glassfish javase6

Thursday Jun 14, 2007

Sun to showcase WS-I Sample App at Burton Catalyst Conference

At the upcoming Burton Group's Catalyst Conference, WS-I is hosting an interoperability demo. Sun Microsystems will be showcasing the WS-I Sample Application that supports the Basic Security Profile 1.0 (BSP1.0) on the evening of June 28, 2007 at the Hilton San Francisco. This version of Sample Application is built using WSIT integrated in GlassFish V2.

The BSP1.0 defines clarifications to a set of non-proprietary specifications to promote interoperability of secure Web services. In addition to BSP1.0, the Web services stack in GlassFish V2 is fully compliant with Basic Profile 1.0 (BP1.0), Basic Profile 1.0 Errata, Basic Profile 1.1 (BP1.1), Simple SOAP Binding Profile 1.0 (SSBP1.0), Attachments Profile 1.0 (AP1.0), and Basic Security Profile 1.0.

The Sample Application is a sample Supply Chain Management scenario that consists of a 8 Web service endpoints - Retailer, 3 Warehouses (A, B, C), 3 Manufacturers (A, B, C) and a LoggingFacility. This application demonstrates both B2C and B2B scenarios. Each Web service endpoint can be hosted using a different vendor's implementation. For example Retailer endpoint can be deployed using WSIT integrated in GlassFish V2, Warehouse endpoint on Novell's stack and LoggingFacility endpoint on SAP's stack. And because the business flow between different endpoints and stock levels at each of the Warehouse and Manufacturer is clearly defined, this application has the potential of showing multiple vendors interoperating with each other.

I was member of the first Sample Application team that delivered Use Cases, Architecture and Usage Scenarios. It was a lot of fun getting the basic interoperability working (and of course attending plenaries at exotic locations ;-)

Technorati: burtongroup burtoncatalyst ws-i conf wsit glassfish webservices

About

profile image
Arun Gupta is a technology enthusiast, a passionate runner, author, and a community guy who works for Oracle Corp.


Java EE 7 Samples

Stay Connected

Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today