title: soap UI to generate a mock service and test client
body: <p>i am trying to do a soap with ws security.
  How do I use soap UI to generate  a mock service and then test client. How much control can I have on the security headers. Do I need to manually add security details or does it automatically do it from the wsdl.. Any links or tutotials will be very helpful</p>
  
  <p>This is just to generate a soap xml</p>
  
  <pre><code>    soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mhs="http://org/emedny/mhs/" xmlns:urn="urn:hl7-org:v3"&gt;
  &lt;soapenv:Header&gt;
  &lt;wsse:Security soap:mustUnderstand="1" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;
  &lt;wsse:BinarySecurityToken ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-e00c8062-83d2-4f04-88fc-996218e7bb3d"&gt;MIICeDCC....(eMedNY signed user MLS cert).......&lt;/wsse:BinarySecurityToken&gt;
  &lt;wsse:BinarySecurityToken ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-c0cc2cd4-cb77-4fa5-abfa-bd485afd1685"&gt;MIIDFj.....( eMedNY MLS web-service end-point public cert)........&lt;/wsse:BinarySecurityToken&gt;
  &lt;wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-970e9a80-00cc-4c86-8ec4-3ba16e029a5b"&gt;
  &lt;wsse:Username&gt;....your_username.....&lt;/wsse:Username&gt;
  &lt;wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"&gt;.....your_plaintext_password....&lt;/wsse:Password&gt;
  &lt;wsse:Nonce&gt;KNyu6MsXCkTg4DDyvwvEiw==&lt;/wsse:Nonce&gt;
  &lt;wsu:Created&gt;2010-09-15T18:00:30Z&lt;/wsu:Created&gt;
  &lt;/wsse:UsernameToken&gt;
  &lt;xenc:EncryptedKey xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"&gt;
  &lt;xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/&gt;
  &lt;KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"&gt;
  &lt;wsse:SecurityTokenReference&gt;
  &lt;wsse:Reference URI="#SecurityToken-c0cc2cd4-cb77-4fa5-abfa-bd485afd1685" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/&gt;
  &lt;/wsse:SecurityTokenReference&gt;
  &lt;/KeyInfo&gt;
  &lt;xenc:CipherData&gt;
  &lt;xenc:CipherValue&gt;gpBAWt91pdwhKva............&lt;/xenc:CipherValue&gt;
  &lt;/xenc:CipherData&gt;
  &lt;xenc:ReferenceList&gt;
  &lt;xenc:DataReference URI="#Enc-0641b860-b16d-4941-91c0-d60bece67794"/&gt;
  &lt;/xenc:ReferenceList&gt;
  &lt;/xenc:EncryptedKey&gt;
  &lt;Signature xmlns="http://www.w3.org/2000/09/xmldsig#"&gt;
  &lt;SignedInfo&gt;
  SAMP L E R EQUE ST W I T H WS S E CURI T Y
  eMedNY Meds History Service User Guide Page 13 of 48 February 16, 2012
  Version 1.1
  &lt;ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/&gt;
  &lt;SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/&gt;
  &lt;Reference URI="#Id-f10674fd-b999-47c9-9568-c11fa5e5405b"&gt;
  &lt;Transforms&gt;
  &lt;Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/&gt;
  &lt;/Transforms&gt;
  &lt;DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/&gt;
  &lt;DigestValue&gt;wRUq.........&lt;/DigestValue&gt;
  &lt;/Reference&gt;
  &lt;/SignedInfo&gt;
  &lt;SignatureValue&gt;tBSsaZi........&lt;/SignatureValue&gt;
  &lt;KeyInfo&gt;
  &lt;wsse:SecurityTokenReference&gt;
  &lt;wsse:Reference URI="#SecurityToken-e00c8062-83d2-4f04-88fc-996218e7bb3d" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/&gt;
  &lt;/wsse:SecurityTokenReference&gt;
  &lt;/KeyInfo&gt;
  &lt;/Signature&gt;
  &lt;/wsse:Security&gt;
  &lt;/soapenv:Header&gt;
  </code></pre>
  
  <p>Thank you</p>