1.0 Introduction
2.0 Software Requirements
3.0 Directory Structure
4.0 Configuration
5.0 Run Sample
This sample implements a real-world interoperability scenario between Metro and .NET 3.0 using a subset of Health Care System. The sample shows how an Excel 2007 spreadsheet can invoke a Secure and Reliable Metro endpoint. A complete description of the scenario is available here.
The source code for this sample is available in "wsit/wsit/samples/excelclient
"
directory. It can be checked out using the command:
cvs -d :pserver:yourid@cvs.dev.java.net:/cvs co wsit/wsit/samples/excelclient
This sample is tested on Windows Vista and Windows XP + SP2 by installing the Metro endpoint and Excel 2007 client on the same machine. However the Metro endpoint can be installed on any of the GlassFish supported platforms (Solaris Sparc, Solaris X86, Windows, Linux and Mac OS). The .NET service reference needs to be regenerated in that case and the instructions for the same are given below.
Install the software in the exact order listed below.
ant
" in the expanded "copyv3
"
directory.Server
" in the "Runtime
"
tab.File
" menu, "Open Project
"
and in the "Open Project Dialog
" navigate to the "wsit/wsit/samples/excelclient
"
directory, select the "service
" folder and clickOpen Project Folder
" button.Properties
".Run
" node and ensure that the recently added
GlassFish is chosen as the Server.WSITEndpoint
"
node, select "Edit Web Service Attributes
".
keystore.jks
" file in your
GlassFish installation directory. Click on "OK
" button.truststore.jks
" file in your
GlassFish installation directory. Click on "OK
" button.Runtime
tab, select GlassFish
server instance, right-click and then selecting "Start
". It's
important to start GlassFish this way otherwise database instance needs to
be explicitly started using AS_HOME/bin/asadmin start-database
.AS_HOME/bin/asadmin create-file-user wsit
(use "wsit" as
a password)
Java DB (Network)
" for "Name
" and "jdbc:derby://localhost:1527/WsitDemoDB
"
for "Database URL
".ExcelAddIn
directory.app.config
" and "localhost.map
"
files from the "ExcelAddIn1
" solution in the "Solution
Explorer
".ExcelAddIn1
" and choose "Add Service
Reference...
".Service URI
" and take the
default value of "Service reference name
".OK
".app.config
at //configuration/system.serviceModel/client/endpoint
:<identity>
<dns value="xwssecurityserver"/>
</identity>
The updated fragment will look like:
<client>
<endpoint address="http://localhost:8080/service/WSITEndpointService"
binding="customBinding" bindingConfiguration="WSITEndpointPortBinding"
contract="localhost.WSITEndpoint" name="WSITEndpointPort" >
<identity>
<dns value="xwssecurityserver"/>
</identity>
</endpoint>
</client>
cd %AS_HOME%\domains\domain1\config
keytool -export -alias wssip -file wssip.cer -keystore cacerts.jks
changeit
" on the password prompt.
If you get an error "Alias <wssip> does not exist
"
then you probably did not do step #3 in section 4.1.mmc.exe
" from a command shell with
administrator privileges.. This will open Microsoft Management Console.File
", "Add/Remove Snap-in...
".Certificates
" snap-in and click "Add
>
"
button.Computer Account
", "Local Computer
".
Click "Finish
" and then "OK
".Certificates (Local Computer)
"
and select "Trusted Root Certification Authorities
" node. Right-click and select "All Tasks
", "Import
...
".Next
", "Browse
", and import the
certificates mentioned below (all certificates are in "wsit\wsit\samples\excelclient\etc\certs
"
directory). You may have to change the filter in bottom right corner to
"Personal Information Exchange (*.pfx, *.p12)
" to view
.pfx
certificates.ca.pfx (
password is "password
")root.pfx (
password is "password
")xwss-server.cer
wssip.cer
exported from GlassFishcaspol -u -ag All_Code -url C:\<FolderName>\* FullTrust -n "<Name>" -d
"<Description>"
<FolderName>
is complete path to ExcelAddIn
folder,<Name>
is "WSITEndpoint
",<Description>
is "JavaOne 2007 WSIT Demo
".C:\Program Files\Microsoft SDKs\Windows\v6.0>caspol -u -ag All_Code -url
"C:\workspaces\wsit\wsit\samples\ExcelAddIn\*"
FullTrust -n "WSITEndpoint" -d "JavaOne 2007 WSIT Demo"
Microsoft (R) .NET Framework CasPol 2.0.50727.312
Copyright (c) Microsoft Corporation. All rights reserved.
The operation you are performing will alter security policy.
Are you sure you want to perform this operation? (yes/no)
y
Added union code group with "-url" membership condition to the User level.
Success
wsit
/wsit
is the correct username/password. Enter an incorrect username/password
and then another window will pop up showing the error message. Click "Retry"
and then enter correct username/password.
Last Updated: August 30, 2007 04:06 PM