
Expected duration: 90 minutes
Before you begin, you need to install the software mentioned in the class website on your computer. You also need download and unzip the hands-on lab zip file below (if you have not done so yet).
0. Start NetBeans IDE if you have not
done so yet.
1. Open HelloWebService
NetBeans project.




Trouble-shooting: If
you experience a problem in running
wsmonitor, please the JAVA_HOME environment variable as following and
then run wsmonitor.








Trouble-shooting: If you experience the following problem,
undeploy all the Web applications first (Select service tab, expand
Servers->GlassFish 2.1->Applications->Web Applications and
select all apps and right click and select Undeploy) and then try it
again.


| <?xml version="1.0"
encoding="UTF-8"?> <!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.2-hudson-182-RC1. --> <!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.2-hudson-182-RC1. --> <definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://mypackage/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://mypackage/" name="HelloService"> <wsp:UsingPolicy></wsp:UsingPolicy> <wsp:Policy wsu:Id="HelloPortBindingPolicy"> <wsp:ExactlyOne> <wsp:All> <ns1:RMAssertion xmlns:ns1="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"></ns1:RMAssertion> <ns2:Ordered xmlns:ns2="http://sun.com/2006/03/rm"></ns2:Ordered> <ns3:UsingAddressing xmlns:ns3="http://www.w3.org/2006/05/addressing/wsdl"></ns3:UsingAddressing> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> <types> <xsd:schema> <xsd:import namespace="http://mypackage/" schemaLocation="http://localhost:8080/HelloWebService/HelloService?xsd=1"></xsd:import> </xsd:schema> </types> <message name="sayHello"> <part name="parameters" element="tns:sayHello"></part> </message> <message name="sayHelloResponse"> <part name="parameters" element="tns:sayHelloResponse"></part> </message> <portType name="Hello"> <operation name="sayHello"> <input message="tns:sayHello"></input> <output message="tns:sayHelloResponse"></output> </operation> </portType> <binding name="HelloPortBinding" type="tns:Hello"> <wsp:PolicyReference URI="#HelloPortBindingPolicy"></wsp:PolicyReference> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding> <operation name="sayHello"> <soap:operation soapAction=""></soap:operation> <input> <soap:body use="literal"></soap:body> </input> <output> <soap:body use="literal"></soap:body> </output> </operation> </binding> <service name="HelloService"> <port name="HelloPort" binding="tns:HelloPortBinding"> <soap:address location="http://localhost:8080/HelloWebService/HelloService"></soap:address> </port> </service> </definitions> |






| <?xml version="1.0"
encoding="UTF-8"?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Header> <To xmlns="http://www.w3.org/2005/08/addressing">http://localhost:4040/HelloWebService/HelloService</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:037a53b5-72c2-40ab-aa20-7f31344f4847</MessageID> </S:Header> <S:Body> <ns2:CreateSequence xmlns:ns2="http://schemas.xmlsoap.org/ws/2005/02/rm" xmlns:ns3="http://schemas.microsoft.com/ws/2006/05/rm" xmlns:ns4="http://www.w3.org/2005/08/addressing" xmlns:ns5="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:ns6="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <ns2:AcksTo> <ns4:Address>http://www.w3.org/2005/08/addressing/anonymous</ns4:Address> </ns2:AcksTo> <ns2:Offer> <ns2:Identifier>uuid:3324939e-5798-4d30-9c9b-a90013fe7aff</ns2:Identifier> </ns2:Offer> </ns2:CreateSequence> </S:Body> </S:Envelope> |
| <?xml version="1.0"
encoding="UTF-8"?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Header> <To xmlns="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/anonymous</To> <Action xmlns="http://www.w3.org/2005/08/addressing">http://schemas.xmlsoap.org/ws/...</Action> <MessageID xmlns="http://www.w3.org/2005/08/addressing">uuid:...</MessageID> <RelatesTo xmlns="http://www.w3.org/2005/08/addressing">uuid:...</RelatesTo> </S:Header> <S:Body> <ns2:CreateSequenceResponse xmlns:ns2="http://schemas.xmlsoap.org/ws/2005/02/rm" xmlns:ns3="http://schemas.microsoft.com/ws/2006/05/rm" xmlns:ns4="http://www.w3.org/2005/08/addressing" xmlns:ns5="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:ns6="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <ns2:Identifier>uuid:176a6212-5c0d-480c-b31d-d026034a68b1</ns2:Identifier> <ns2:Accept> <ns2:AcksTo> <ns4:Address>http://localhost:4040/HelloWebService/HelloService</ns4:Address> </ns2:AcksTo> </ns2:Accept> </ns2:CreateSequenceResponse> </S:Body> </S:Envelope> |

| <?xml version="1.0"
encoding="UTF-8"?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Header> <To xmlns="http://www.w3.org/2005/08/addressing">http://localhost:4040/HelloWebService/HelloService</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:037a53b5-72c2-40ab-aa20-7f31344f4847</MessageID> </S:Header> <S:Body> <ns2:CreateSequence xmlns:ns2="http://schemas.xmlsoap.org/ws/2005/02/rm" xmlns:ns3="http://schemas.microsoft.com/ws/2006/05/rm" xmlns:ns4="http://www.w3.org/2005/08/addressing" xmlns:ns5="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:ns6="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <ns2:AcksTo> <ns4:Address>http://www.w3.org/2005/08/addressing/anonymous</ns4:Address> </ns2:AcksTo> <ns2:Offer> <ns2:Identifier>uuid:3324939e-5798-4d30-9c9b-a90013fe7aff</ns2:Identifier> </ns2:Offer> </ns2:CreateSequence> </S:Body> </S:Envelope> |
| <?xml version="1.0"
encoding="UTF-8"?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Header> <To xmlns="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/anonymous</To> <Action xmlns="http://www.w3.org/2005/08/addressing">http://schemas.xmlsoap.org/...</Action> <MessageID xmlns="http://www.w3.org/2005/08/addressing">uuid:c5255b96-fbeb-4937-92ad-debfa4735390</MessageID> <RelatesTo xmlns="http://www.w3.org/2005/08/addressing">uuid:037a53b5-72c2-40ab-aa20-7f31344f4847</RelatesTo> </S:Header> <S:Body> <ns2:CreateSequenceResponse xmlns:ns2="http://schemas.xmlsoap.org/ws/2005/02/rm" xmlns:ns3="http://schemas.microsoft.com/ws/2006/05/rm" xmlns:ns4="http://www.w3.org/2005/08/addressing" xmlns:ns5="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:ns6="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <ns2:Identifier>uuid:176a6212-5c0d-480c-b31d-d026034a68b1</ns2:Identifier> <ns2:Accept> <ns2:AcksTo> <ns4:Address>http://localhost:4040/HelloWebService/HelloService</ns4:Address> </ns2:AcksTo> </ns2:Accept> </ns2:CreateSequenceResponse> </S:Body> </S:Envelope> |
Trouble-shooting: If you see the
following symptom, it is because the client project was not configured
with METRO library as described above.
hyIn this exercise, you have built
and deployed a simple wsit Web service using Reliable messaging.




1. Open
Edit Web Service Attributes editor window.
For this mechanism, the client does not possess any certificate/key of his own, but instead sends its username/password for authentication. The client shares a secret key with the server. The shared, symmetric key is generated at runtime and encrypted using the service's certificate. The client must specify the alias in the truststore by identifying the server's certificate alias. The other security mechanisms are explained later in this tutorial.






Trubleshooting: If things do not work, please make sure the following:
Trouble-shooting: If you
experience "Invalid Username Password Pair" as shown in Figure-2.22
below, it is because the default username "wsitUser" and password
"changeit" pair was not set to the file security realm of the
GlassFish. (It should be set automatically as part of the
NetBeans/GlassFish installation.) Add "wsitUser"/"changeit"
username/password pair as described here.

| ?xml version="1.0"
encoding="UTF-8"?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:exc14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"> <S:Header> <To wsu:Id="5006" xmlns="http://www.w3.org/2005/08/addressing">http://localhost:4040/HelloWebService/HelloService</To> <Action wsu:Id="5005" xmlns="http://www.w3.org/2005/08/addressing">http://mypackage/Hello/sayHelloRequest</Action> <ReplyTo wsu:Id="5004" xmlns="http://www.w3.org/2005/08/addressing"> <Address>http://www.w3.org/2005/08/addressing/anonymous</Address> </ReplyTo> <MessageID wsu:Id="5003" xmlns="http://www.w3.org/2005/08/addressing">uuid:1cfbf8f9-5a57-4f60-b937-4f949add9d78</MessageID> <wsse:Security S:mustUnderstand="1"> <wsu:Timestamp wsu:Id="3" xmlns:ns10="http://www.w3.org/2003/05/soap-envelope"> <wsu:Created>2008-01-14T19:24:35Z</wsu:Created> <wsu:Expires>2008-01-14T19:29:35Z</wsu:Expires> </wsu:Timestamp> <xenc:EncryptedKey Id="5002" xmlns:ns10="http://www.w3.org/2003/05/soap-envelope"> <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/> <ds:KeyInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="keyInfo"> <wsse:SecurityTokenReference> <wsse:KeyIdentifier EncodingType="..." ValueType="http://docs.oasis-open.org/wss/2004/01/..."> dVE29ysyFW/iD1la3ddePzM6IWo=</wsse:KeyIdentifier> </wsse:SecurityTokenReference> </ds:KeyInfo> <xenc:CipherData> <xenc:CipherValue>...</xenc:CipherValue> </xenc:CipherData> </xenc:EncryptedKey> <xenc:ReferenceList xmlns="" xmlns:ns16="http://www.w3.org/2003/05/soap-envelope"> <xenc:DataReference URI="#5008"/> <xenc:DataReference URI="#5009"/> </xenc:ReferenceList> <xenc:EncryptedData Id="5009" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:ns10="http://www.w3.org/2003/05/soap-envelope"> <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/> <ds:KeyInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="keyInfo"> <wsse:SecurityTokenReference> <wsse:Reference URI="#5002" ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey"/> </wsse:SecurityTokenReference> </ds:KeyInfo> <xenc:CipherData> <xenc:CipherValue>92tRb3m...kX6IXYV0uunF1VWFjDCBi/gmqjHU</xenc:CipherValue> </xenc:CipherData> </xenc:EncryptedData> <ds:Signature Id="1" xmlns:ns10="http://www.w3.org/2003/05/soap-envelope"> <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <exc14n:InclusiveNamespaces PrefixList="wsse S"/> </ds:CanonicalizationMethod> <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/> <ds:Reference URI="#5003"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <exc14n:InclusiveNamespaces PrefixList="S"/> </ds:Transform> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>cdMf9xf0QMxZxzBzuM2qqJIlj7c=</ds:DigestValue> </ds:Reference> <ds:Reference URI="#5004"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <exc14n:InclusiveNamespaces PrefixList="S"/> </ds:Transform> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>WdIQVaynkwqFa/LTJNuUmAHYF+k=</ds:DigestValue> </ds:Reference> <ds:Reference URI="#5005"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <exc14n:InclusiveNamespaces PrefixList="S"/> </ds:Transform> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>14EHWkiaAKzC7TuUCYpgzOds9cw=</ds:DigestValue> </ds:Reference> <ds:Reference URI="#5006"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <exc14n:InclusiveNamespaces PrefixList="S"/> </ds:Transform> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>ElipJn3BfXZo+fejFI+obkD9xkE=</ds:DigestValue> </ds:Reference> <ds:Reference URI="#5007"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <exc14n:InclusiveNamespaces PrefixList="S"/> </ds:Transform> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>W1J188g6XCl3OHHq1pBdGqD6nOY=</ds:DigestValue> </ds:Reference> <ds:Reference URI="#3"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <exc14n:InclusiveNamespaces PrefixList="wsu wsse S"/> </ds:Transform> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>jltiYqBfUgDl/eDqh22fllmy2eE=</ds:DigestValue> </ds:Reference> <ds:Reference URI="#94c6e56a-3c95-4ac2-971e-89931d1171e8"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <exc14n:InclusiveNamespaces PrefixList="wsu wsse S"/> </ds:Transform> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>yfj35ZC1YqvePymWo2cMQZ6HpD0=</ds:DigestValue> </ds:Reference> </ds:SignedInfo> <ds:SignatureValue>XJ6OBH7KLw0T9iKdSP5SAMVskl8=</ds:SignatureValue> <ds:KeyInfo> <wsse:SecurityTokenReference wsu:Id="1d90c38c-a044-4a6e-a640-9bc653fda6b1"> <wsse:Reference URI="#5002" ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey"/> </wsse:SecurityTokenReference> </ds:KeyInfo> </ds:Signature> </wsse:Security> </S:Header> <S:Body wsu:Id="5007"> <xenc:EncryptedData Id="5008" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns:ns10="http://www.w3.org/2003/05/soap-envelope"> <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/> <ds:KeyInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="keyInfo"> <wsse:SecurityTokenReference> <wsse:Reference URI="#5002" ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey"/> </wsse:SecurityTokenReference> </ds:KeyInfo> <xenc:CipherData> Z0YD4syi/L3hdtAhPQ==</xenc:CipherValue> </xenc:CipherData> </xenc:EncryptedData> </S:Body> </S:Envelope> |
| <?xml version="1.0"
encoding="UTF-8"?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:exc14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"> <S:Header> <To wsu:Id="5005" xmlns="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/anonymous</To> <Action wsu:Id="5003" xmlns="http://www.w3.org/2005/08/addressing">http://mypackage/Hello/sayHelloResponse</Action> <MessageID wsu:Id="5002" xmlns="http://www.w3.org/2005/08/addressing">uuid:...</MessageID> <RelatesTo wsu:Id="5004" xmlns="http://www.w3.org/2005/08/addressing">uuid:1cfbf8f9-5a57-4f60-b937-4f949add9d78</RelatesTo> <wsse:Security S:mustUnderstand="1"> <wsu:Timestamp wsu:Id="3" xmlns:ns10="http://www.w3.org/2003/05/soap-envelope"> <wsu:Created>2008-01-14T19:24:36Z</wsu:Created> <wsu:Expires>2008-01-14T19:29:36Z</wsu:Expires> </wsu:Timestamp> <xenc:ReferenceList xmlns="" xmlns:ns16="http://www.w3.org/2003/05/soap-envelope"> <xenc:DataReference URI="#5007"/> </xenc:ReferenceList> <ds:Signature Id="1" xmlns:ns10="http://www.w3.org/2003/05/soap-envelope"> <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <exc14n:InclusiveNamespaces PrefixList="wsse S"/> </ds:CanonicalizationMethod> <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/> <ds:Reference URI="#5002"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <exc14n:InclusiveNamespaces PrefixList="S"/> </ds:Transform> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>MZWFrz8j3X5elzP90TylQkV7Alo=</ds:DigestValue> </ds:Reference> <ds:Reference URI="#5003"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <exc14n:InclusiveNamespaces PrefixList="S"/> </ds:Transform> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>8JNcDdllDGDx3XmI1P73S89zJ9A=</ds:DigestValue> </ds:Reference> <ds:Reference URI="#5004"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <exc14n:InclusiveNamespaces PrefixList="S"/> </ds:Transform> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>trH8Fv6EnNLIsjrBwJCRT50aL0A=</ds:DigestValue> </ds:Reference> <ds:Reference URI="#5005"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <exc14n:InclusiveNamespaces PrefixList="S"/> </ds:Transform> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>26KDy9ndyfdX/w8zv2re2dt1wsc=</ds:DigestValue> </ds:Reference> <ds:Reference URI="#5006"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <exc14n:InclusiveNamespaces PrefixList="S"/> </ds:Transform> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>eh5lyt+tkQtH+MHf0u9wlSuTWB4=</ds:DigestValue> </ds:Reference> <ds:Reference URI="#3"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <exc14n:InclusiveNamespaces PrefixList="wsu wsse S"/> </ds:Transform> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>WmjD41MZGoxol71lue8b15k6uWI=</ds:DigestValue> </ds:Reference> </ds:SignedInfo> <ds:SignatureValue>yJZ7Jd8xr8LK6NRQN2yIKhfraaA=</ds:SignatureValue> <ds:KeyInfo> <wsse:SecurityTokenReference> <wsse:KeyIdentifier EncodingType="..." ValueType="...">r..=</wsse:KeyIdentifier> </wsse:SecurityTokenReference> </ds:KeyInfo> </ds:Signature> </wsse:Security> </S:Header> <S:Body wsu:Id="5006"> <xenc:EncryptedData Id="5007" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns:ns10="http://www.w3.org/2003/05/soap-envelope"> <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/> <ds:KeyInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="keyInfo"> <wsse:SecurityTokenReference> <wsse:KeyIdentifier EncodingType="..." ValueType="...">rTsBk...HU=</wsse:KeyIdentifier> </wsse:SecurityTokenReference> </ds:KeyInfo> <xenc:CipherData> <xenc:CipherValue>G55e...MSojc=</xenc:CipherValue> </xenc:CipherData> </xenc:EncryptedData> </S:Body> </S:Envelope> |
| <?xml version="1.0"
encoding="UTF-8"?><!-- Published by JAX-WS RI at
http://jax-ws.dev.java.net. RI's version is JAX-WS RI
2.1.2-hudson-182-RC1. --><!-- Generated by JAX-WS RI at
http://jax-ws.dev.java.net. RI's version is JAX-WS RI
2.1.2-hudson-182-RC1. --><definitions
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://mypackage/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://mypackage/" name="HelloService"> <wsp:UsingPolicy></wsp:UsingPolicy> <wsp:Policy wsu:Id="HelloPortBindingPolicy"> <wsp:ExactlyOne> <wsp:All> <ns3:SignedSupportingTokens xmlns:ns3="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <wsp:Policy> <wsp:ExactlyOne> <wsp:All> <ns3:UsernameToken ns3:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient"> <wsp:Policy> <wsp:ExactlyOne> <wsp:All> <ns3:WssUsernameToken10></ns3:WssUsernameToken10> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> </ns3:UsernameToken> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> </ns3:SignedSupportingTokens> <ns4:SymmetricBinding xmlns:ns4="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <wsp:Policy> <wsp:ExactlyOne> <wsp:All> <ns4:AlgorithmSuite> <wsp:Policy> <wsp:ExactlyOne> <wsp:All> <ns4:Basic128></ns4:Basic128> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> </ns4:AlgorithmSuite> <ns4:IncludeTimestamp></ns4:IncludeTimestamp> <ns4:Layout> <wsp:Policy> <wsp:ExactlyOne> <wsp:All> <ns4:Strict></ns4:Strict> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> </ns4:Layout> <ns4:OnlySignEntireHeadersAndBody></ns4:OnlySignEntireHeadersAndBody> <ns4:ProtectionToken> <wsp:Policy> <wsp:ExactlyOne> <wsp:All> <ns4:X509Token ns4:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never"> <wsp:Policy> <wsp:ExactlyOne> <wsp:All> <ns4:WssX509V3Token10></ns4:WssX509V3Token10> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> </ns4:X509Token> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> </ns4:ProtectionToken> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> </ns4:SymmetricBinding> <ns5:Wss11 xmlns:ns5="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <wsp:Policy> <wsp:ExactlyOne> <wsp:All> <ns5:MustSupportRefEncryptedKey></ns5:MustSupportRefEncryptedKey> <ns5:MustSupportRefIssuerSerial></ns5:MustSupportRefIssuerSerial> <ns5:MustSupportRefKeyIdentifier></ns5:MustSupportRefKeyIdentifier> <ns5:MustSupportRefThumbprint></ns5:MustSupportRefThumbprint> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> </ns5:Wss11> <ns6:UsingAddressing xmlns:ns6="http://www.w3.org/2006/05/addressing/wsdl"></ns6:UsingAddressing> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> <wsp:Policy wsu:Id="HelloPortBinding_sayHello_Policy"> <wsp:ExactlyOne> <wsp:All> <ns7:ATAlwaysCapability xmlns:ns7="http://schemas.xmlsoap.org/ws/2004/10/wsat"></ns7:ATAlwaysCapability> <ns8:ATAssertion xmlns:ns8="http://schemas.xmlsoap.org/ws/2004/10/wsat" wsp:Optional="true"></ns8:ATAssertion> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> <wsp:Policy wsu:Id="HelloPortBinding_sayHello_Input_Policy"> <wsp:ExactlyOne> <wsp:All> <ns9:EncryptedParts xmlns:ns9="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <ns9:Body></ns9:Body> </ns9:EncryptedParts> <ns10:SignedParts xmlns:ns10="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <ns10:Body></ns10:Body> <ns10:Header Namespace="http://www.w3.org/2005/08/addressing" Name="ReplyTo"></ns10:Header> <ns10:Header Namespace="http://www.w3.org/2005/08/addressing" Name="To"></ns10:Header> <ns10:Header Namespace="http://www.w3.org/2005/08/addressing" Name="From"></ns10:Header> <ns10:Header Namespace="http://www.w3.org/2005/08/addressing" Name="MessageID"></ns10:Header> <ns10:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"></ns10:Header> <ns10:Header Namespace="http://www.w3.org/2005/08/addressing" Name="Action"></ns10:Header> <ns10:Header Namespace="http://www.w3.org/2005/08/addressing" Name="RelatesTo"></ns10:Header> <ns10:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm" Name="AckRequested"></ns10:Header> <ns10:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm" Name="Sequence"></ns10:Header> <ns10:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm" Name="SequenceAcknowledgement"></ns10:Header> </ns10:SignedParts> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> <wsp:Policy wsu:Id="HelloPortBinding_sayHello_Output_Policy"> <wsp:ExactlyOne> <wsp:All> <ns11:EncryptedParts xmlns:ns11="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <ns11:Body></ns11:Body> </ns11:EncryptedParts> <ns12:SignedParts xmlns:ns12="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <ns12:Body></ns12:Body> <ns12:Header Namespace="http://www.w3.org/2005/08/addressing" Name="ReplyTo"></ns12:Header> <ns12:Header Namespace="http://www.w3.org/2005/08/addressing" Name="To"></ns12:Header> <ns12:Header Namespace="http://www.w3.org/2005/08/addressing" Name="From"></ns12:Header> <ns12:Header Namespace="http://www.w3.org/2005/08/addressing" Name="MessageID"></ns12:Header> <ns12:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing"></ns12:Header> <ns12:Header Namespace="http://www.w3.org/2005/08/addressing" Name="Action"></ns12:Header> <ns12:Header Namespace="http://www.w3.org/2005/08/addressing" Name="RelatesTo"></ns12:Header> <ns12:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm" Name="AckRequested"></ns12:Header> <ns12:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm" Name="Sequence"></ns12:Header> <ns12:Header Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm" Name="SequenceAcknowledgement"></ns12:Header> </ns12:SignedParts> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> <types> <xsd:schema> <xsd:import namespace="http://mypackage/" schemaLocation="http://localhost:8080/HelloWebService/HelloService?xsd=1"></xsd:import> </xsd:schema> </types> <message name="sayHello"> <part name="parameters" element="tns:sayHello"></part> </message> <message name="sayHelloResponse"> <part name="parameters" element="tns:sayHelloResponse"></part> </message> <portType name="Hello"> <operation name="sayHello"> <input message="tns:sayHello"></input> <output message="tns:sayHelloResponse"></output> </operation> </portType> <binding name="HelloPortBinding" type="tns:Hello"> <wsp:PolicyReference URI="#HelloPortBindingPolicy"></wsp:PolicyReference> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding> <operation name="sayHello"> <wsp:PolicyReference URI="#HelloPortBinding_sayHello_Policy"></wsp:PolicyReference> <soap:operation soapAction=""></soap:operation> <input> <wsp:PolicyReference URI="#HelloPortBinding_sayHello_Input_Policy"></wsp:PolicyReference> <soap:body use="literal"></soap:body> </input> <output> <wsp:PolicyReference URI="#HelloPortBinding_sayHello_Output_Policy"></wsp:PolicyReference> <soap:body use="literal"></soap:body> </output> </operation> </binding> <service name="HelloService"> <port name="HelloPort" binding="tns:HelloPortBinding"> <soap:address location="http://localhost:8080/HelloWebService/HelloService"></soap:address> </port> </service> </definitions> |
1. Open
Edit Web Service Attributes editor window.

| <?xml version="1.0"
encoding="UTF-8"?><!-- Published by JAX-WS RI at
http://jax-ws.dev.java.net. RI's version is JAX-WS RI
2.1.3.3-hudson-757-SNAPSHOT. --><!-- Generated by JAX-WS RI at
http://jax-ws.dev.java.net. RI's version is JAX-WS RI
2.1.3.3-hudson-757-SNAPSHOT. --> <definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://mypackage/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://mypackage/" name="HelloService"> <ns1:Policy xmlns:ns1="http://schemas.xmlsoap.org/ws/2004/09/policy" wsu:Id="HelloPortBindingPolicy"> <ns1:ExactlyOne> <ns1:All> <ns2:OptimizedMimeSerialization xmlns:ns2="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"></ns2:OptimizedMimeSerialization> </ns1:All> </ns1:ExactlyOne> </ns1:Policy> <types> <xsd:schema> <xsd:import namespace="http://mypackage/" schemaLocation="http://localhost:8080/HelloWebService/HelloService?xsd=1"></xsd:import> </xsd:schema> </types> <message name="sayHello"> <part name="parameters" element="tns:sayHello"></part> </message> <message name="sayHelloResponse"> <part name="parameters" element="tns:sayHelloResponse"></part> </message> <portType name="Hello"> <operation name="sayHello"> <input message="tns:sayHello"></input> <output message="tns:sayHelloResponse"></output> </operation> </portType> <binding name="HelloPortBinding" type="tns:Hello"> <ns3:PolicyReference xmlns:ns3="http://schemas.xmlsoap.org/ws/2004/09/policy" URI="#HelloPortBindingPolicy"></ns3:PolicyReference> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding> <operation name="sayHello"> <soap:operation soapAction=""></soap:operation> <input> <soap:body use="literal"></soap:body> </input> <output> <soap:body use="literal"></soap:body> </output> </operation> </binding> <service name="HelloService"> <port name="HelloPort" binding="tns:HelloPortBinding"> <soap:address location="http://localhost:8080/HelloWebService/HelloService"></soap:address> </port> </service> </definitions> |


| --uuid:0663772b-6294-4e1b-8d5f-243839435938 Content-Id: <rootpart*0663772b-6294-4e1b-8d5f-243839435938@example.jaxws.sun.com> Content-Type: application/xop+xml;charset=utf-8;type="text/xml" Content-Transfer-Encoding: binary <?xml version="1.0" ?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:sayHello xmlns:ns2="http://mypackage/"> <arg0>Sang Shin</arg0> </ns2:sayHello> </S:Body> </S:Envelope> --uuid:0663772b-6294-4e1b-8d5f-243839435938-- |
| --uuid:9ee30d23-5c34-4677-a609-f489afd9c487 Content-Id: <rootpart*9ee30d23-5c34-4677-a609-f489afd9c487@example.jaxws.sun.com> Content-Type: application/xop+xml;charset=utf-8;type="text/xml" Content-Transfer-Encoding: binary <?xml version="1.0" ?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:sayHelloResponse xmlns:ns2="http://mypackage/"> <return>Hello Sang Shin!</return> </ns2:sayHelloResponse> </S:Body> </S:Envelope> --uuid:9ee30d23-5c34-4677-a609-f489afd9c487-- |
I am waiving security part of the
homework since there seems to be some problem in doing the security
part of the hands-on lan exercise 2. Sang Shin, Sep. 14th,
2008. Just do the reliable messaging part of the homework.