<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>redstream &#187; Oracle WSM</title>
	<atom:link href="http://www.redstream.nl/tag/oracle-wsm/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.redstream.nl</link>
	<description>Pragmatic Integrators</description>
	<lastBuildDate>Fri, 27 Jan 2012 19:31:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Review Oracle WSM: Securing Your Web Services</title>
		<link>http://www.redstream.nl/2009/01/24/review-oracle-wsm-securing-your-web-services/</link>
		<comments>http://www.redstream.nl/2009/01/24/review-oracle-wsm-securing-your-web-services/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 13:51:25 +0000</pubDate>
		<dc:creator>Pascal Alma</dc:creator>
				<category><![CDATA[Web Service]]></category>
		<category><![CDATA[Oracle iAS]]></category>
		<category><![CDATA[Oracle WSM]]></category>
		<category><![CDATA[SOA/Web Services]]></category>

		<guid isPermaLink="false">http://www.pascalalma.net/?p=415</guid>
		<description><![CDATA[As you might have noticed by my last posts I am currently investigating the posiblities of Oracle&#8217;s Web Service Manager. I do this investigation by reading the Packtpub book &#8216;Oracle Web Services Manager &#8211; Securing Your Web Services&#8216;, written by &#8230; <a href="http://www.redstream.nl/2009/01/24/review-oracle-wsm-securing-your-web-services/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.redstream.nl%2F2009%2F01%2F24%2Freview-oracle-wsm-securing-your-web-services%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.redstream.nl%2F2009%2F01%2F24%2Freview-oracle-wsm-securing-your-web-services%2F&amp;source=redstreamlive&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>As you might have noticed by <a href="http://www.redstream.nl/category/soaweb-services/soap-ui/">my last posts</a> I am currently investigating the posiblities of Oracle&#8217;s Web Service Manager. I do this investigation by reading the <a href="http://www.packtpub.com">Packtpub</a> book &#8216;<a href="http://www.packtpub.com/oracle-web-services-manager/book">Oracle Web Services Manager &#8211; Securing Your Web Services</a>&#8216;, written by Sitaraman Lakshminarayanan. As the back-cover says this book mainly targets developers and architects with expertise in developing and deploying web services. And I want to add that it is most interesting if you are going to use or are currently using Oracle WSM, of course.<span id="more-415"></span><br />
 One thing I do not really understand is that the author describes how to use .Net clients to test the setup (besides the test facility in OWSM itself). Hasn&#8217;t Oracle been busy for almost 10 years now to become a important player in the J2EE market. So why not some examples how to test the setup with Java clients? But well, I have <a href="http://www.redstream.nl/tag/soap-ui/">described how to test the examples with SoapUI</a>, so I will consider this issue as solved ;-)<br />
Besides this .Net thing there are some other (small) issues in the example descriptions:</p>
<ul>
<li>In chapter 4 you will start with using Oracle WSM by registering your first service in it. But you can only do that after you have registered the gateway first (I would suggest to start with the <a href="http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b32126.pdf">Oracle WSM Starters guide</a> of Oracle first).</li>
<li>The description of testing the setup in chapter 6 is not correct. The test as described sends an unsigned request and checks if the response is signed. But in the configuration of the web service in this chapter the incoming request must be signed, so the test will always fail. The quick workaround is of course to disable the checking of incoming request. But a nicer solution would be to send in a signed request. To do this I used SoapUI as described <a href="http://www.redstream.nl/2009/01/20/testing-oracle-wsms-web-service-signing-and-verifying-with-soapui/">here</a>.
</li>
</ul>
<p>One thing I miss in the book is (high level) information about keystores and how to create these, but this might be caused by the fact that I am not using .Net so I don&#8217;t have the default keystore they use in the book. But with this addition you make the examples better accessible for others like me who don&#8217;t have .Net available.<br />
Overall it is a nice books with lots of screenshots showing you how to deal with Oracle WSM and it gives you a good insight in how you can secure your web services.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.redstream.nl/2009/01/24/review-oracle-wsm-securing-your-web-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing Oracle WSM&#039;s web service signing and verifying with SoapUI</title>
		<link>http://www.redstream.nl/2009/01/20/testing-oracle-wsms-web-service-signing-and-verifying-with-soapui/</link>
		<comments>http://www.redstream.nl/2009/01/20/testing-oracle-wsms-web-service-signing-and-verifying-with-soapui/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 11:03:07 +0000</pubDate>
		<dc:creator>Pascal Alma</dc:creator>
				<category><![CDATA[SoapUI]]></category>
		<category><![CDATA[Web Service]]></category>
		<category><![CDATA[Oracle WSM]]></category>
		<category><![CDATA[SOA/Web Services]]></category>

		<guid isPermaLink="false">http://www.pascalalma.net/?p=395</guid>
		<description><![CDATA[This will be the last &#8216;hands-on&#8217; article about testing Oracle WSM setup with SoapUI. I have posted about two other examples here and here. In this example Oracle WSM is configured to verify the signature of the incoming SOAP message &#8230; <a href="http://www.redstream.nl/2009/01/20/testing-oracle-wsms-web-service-signing-and-verifying-with-soapui/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.redstream.nl%2F2009%2F01%2F20%2Ftesting-oracle-wsms-web-service-signing-and-verifying-with-soapui%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.redstream.nl%2F2009%2F01%2F20%2Ftesting-oracle-wsms-web-service-signing-and-verifying-with-soapui%2F&amp;source=redstreamlive&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>This will be the last &#8216;hands-on&#8217;  article about testing Oracle WSM setup with SoapUI. I have posted about two other examples <a href="http://www.redstream.nl/2009/01/15/testing-ws-security-authentication-with-soapui/">here</a> and <a href="http://www.redstream.nl/2009/01/16/testing-soap-encrypting-and-decrypting-with-soapui/">here</a>. In this example <a href="http://www.oracle.com/technology/products/webservices_manager/index.html">Oracle WSM</a> is configured to verify the signature of the incoming SOAP message (request) and to add a digital signature to the outgoing message (response). How to arrange this in Oracle WSM is described in <a href="http://www.packtpub.com/oracle-web-services-manager/book">the book</a> so I won&#8217;t describe that here. What I will show is how to setup SoapUI to test the OWSM setup.<span id="more-395"></span><br />
The WSDL for which I created a new project in SoapUI is:</p>

<div class="wp_codebox"><table><tr id="p3954"><td class="line_numbers"><pre>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
</pre></td><td class="code" id="p395code4"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;definitions</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;TimeService&quot;</span> <span style="color: #000066;">targetNamespace</span>=<span style="color: #ff0000;">&quot;urn:Test:TimeService&quot;</span> <span style="color: #000066;">xmlns:tns</span>=<span style="color: #ff0000;">&quot;urn:Test:TimeService&quot;</span> <span style="color: #000066;">xmlns:soap</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;</span> <span style="color: #000066;">xmlns:http</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/wsdl/http/&quot;</span> <span style="color: #000066;">xmlns:xsd</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">xmlns:wsdl</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/wsdl/&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/wsdl/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;message</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime0SoapIn&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;format&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/message<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;message</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime0SoapOut&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Result&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/message<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portType</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;TimeServiceSoap&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;operation</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime&quot;</span> <span style="color: #000066;">parameterOrder</span>=<span style="color: #ff0000;">&quot;format&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime0SoapIn&quot;</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;tns:getTime0SoapIn&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;output</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime0SoapOut&quot;</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;tns:getTime0SoapOut&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/operation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;binding</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;TimeServiceSoap&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;tns:TimeServiceSoap&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:binding</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;rpc&quot;</span> <span style="color: #000066;">transport</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/http&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;operation</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:operation</span> <span style="color: #000066;">soapAction</span>=<span style="color: #ff0000;">&quot;getTime&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;rpc&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime0SoapIn&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:body</span> <span style="color: #000066;">use</span>=<span style="color: #ff0000;">&quot;encoded&quot;</span> <span style="color: #000066;">namespace</span>=<span style="color: #ff0000;">&quot;urn:Test:GetTime&quot;</span> <span style="color: #000066;">encodingStyle</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/input<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;output</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime0SoapOut&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:body</span> <span style="color: #000066;">use</span>=<span style="color: #ff0000;">&quot;encoded&quot;</span> <span style="color: #000066;">namespace</span>=<span style="color: #ff0000;">&quot;urn:Test:GetTime&quot;</span> <span style="color: #000066;">encodingStyle</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/output<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/operation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/binding<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;TimeService&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;port</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;TimeServiceSoap&quot;</span> <span style="color: #000066;">binding</span>=<span style="color: #ff0000;">&quot;tns:TimeServiceSoap&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:address</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;http://localhost:3115/gateway/services/SID0003004&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/port<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/definitions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>The configuration for the verification of the SOAP request is configured in Oracle WSM like this:<br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/01/picture-22.jpg"  width="600" /></p>
<p>To have SoapUI adding a signature to the outgoing request I took the following steps:</p>
<ul>
<li><strong>added my keystore to the project:</strong><br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/01/picture-15.jpg" width="600"  /></p>
</li>
<li><strong>added a configuration step called &#8216;SignRequest&#8217; to the project as Outgoing WS-Security Configuration:</strong><br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/01/picture-32.jpg" width="600" />
</li>
<li><strong>added a configuration step called &#8216;verifySignature&#8217; to the project as Incoming WS-Security Configuration:</strong><br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/01/picture-52.jpg" width="600" />
</li>
<li><strong>configured the SOAP request with which the OWSM is tested:</strong><br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/01/picture-61.jpg" width="600" />
</li>
</ul>
<p>Now with all this in place I sent the request and received the following response:</p>

<div class="wp_codebox"><table><tr id="p3955"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p395code5"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap-ENV:Envelope</span> <span style="color: #000066;">xmlns:SOAP-ENV</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap-ENV:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap-ENV:Fault<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;faultcode</span> <span style="color: #000066;">xmlns:p</span>=<span style="color: #ff0000;">&quot;http://schemas.oblix.com/ws/2003/08/Faults&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>p:Client.GenericFault<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/faultcode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;faultstring<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>WS-Security process failure:null<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/faultstring<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;detail</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap-ENV:Fault<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap-ENV:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap-ENV:Envelope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>It took some time before I realized the error was not my configuration of SoapUI. In the log file of OWSM I found this stacktrace:</p>
<blockquote><p>2009-01-17 20:23:03,452 WARNING [HTTPThreadGroup-8] wssecurity.SecurityBaseStep &#8211; Failure while applying XML Security<br />
java.lang.NullPointerException<br />
	at oracle.security.xmlsec.util.XMLNode.removeChild(Unknown Source)<br />
	at com.cfluent.policysteps.security.wssecurity.OSDTWSSecurity.decryptVerify(OSDTWSSecurity.java:538)<br />
	at com.cfluent.policysteps.security.wssecurity.VerifyStep.performXmlSecurity(VerifyStep.java:147)<br />
	at com.cfluent.policysteps.security.wssecurity.SecurityBaseStep.execute(SecurityBaseStep.java:238)<br />
	at com.cfluent.pipelineengine.container.DefaultPipeline.executeStep(DefaultPipeline.java:124)<br />
	at com.cfluent.pipelineengine.container.DefaultPipeline.execute(DefaultPipeline.java:97)<br />
	at com.cfluent.pipelineengine.container.DefaultPolicy$DeferredPipeline.execute(DefaultPolicy.java:63)<br />
	at com.cfluent.pipelineengine.container.DefaultPolicy$DeferredPipeline.access$300(DefaultPolicy.java:18)<br />
	at com.cfluent.pipelineengine.container.DefaultPolicy.execute(DefaultPolicy.java:126)<br />
	at com.cfluent.pipelineengine.container.PipelineContainer.execute(PipelineContainer.java:114)<br />
	at com.cfluent.agent.Agent.intercept(Agent.java:123)<br />
	at com.cfluent.agent.AgentRuntime.intercept(AgentRuntime.java:200)<br />
	at com.cfluent.pipelineengine.util.PolicyInvoker.execute(PolicyInvoker.java:30)<br />
	at com.cfluent.pipelineengine.util.InvokerChain.execute(InvokerChain.java:30)<br />
	at com.cfluent.gateway.Invoker.execute(Invoker.java:118)<br />
	at com.cfluent.gateway.listener.ProtocolListener$ListenerTask.run(ProtocolListener.java:272)<br />
	at com.cfluent.gateway.listener.ProtocolListener.invoke(ProtocolListener.java:110)<br />
	at com.cfluent.gateway.listener.GatewayRuntime.invoke(GatewayRuntime.java:32)<br />
	at com.cfluent.gateway.listener.http.HttpListener.invoke(HttpListener.java:30)<br />
	at com.cfluent.gateway.listener.http.ServicesServlet.handlePost(ServicesServlet.java:34)<br />
	at com.cfluent.common.servlet.BaseServlet.doPost(BaseServlet.java:264)<br />
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)<br />
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)<br />
	at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)<br />
	at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)<br />
	at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)<br />
	at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)<br />
	at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)<br />
	at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)<br />
	at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)<br />
	at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)<br />
	at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)<br />
	at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)<br />
	at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)<br />
	at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)<br />
	at java.lang.Thread.run(Thread.java:595)
</p></blockquote>
<p>Now this appears to be a bug (5897046) in OWSM as discussed <a href="http://forums.oracle.com/forums/thread.jspa?threadID=676596&#038;tstart=-1">here</a>. Unfortunately I do not have access to MetaLink at the moment, so I cannot check for solutions or patches. The workaround I did was to skip the deletion of the signature in the incoming request:<br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/01/picture-71.jpg" width="600" /></p>
<p>Now when I send the request I get the response as expected:</p>

<div class="wp_codebox"><table><tr id="p3956"><td class="line_numbers"><pre>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
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code" id="p395code6"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:Envelope</span> <span style="color: #000066;">soap:encodingStyle</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;</span> <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span> <span style="color: #000066;">xmlns:xsd</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">xmlns:soap</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;</span> <span style="color: #000066;">xmlns:soapenc</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;</span> <span style="color: #000066;">xmlns:oas</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:Header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsse:Security</span> <span style="color: #000066;">soap:mustUnderstand</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">xmlns:wsse</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsse:BinarySecurityToken</span> <span style="color: #000066;">ValueType</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3&quot;</span> <span style="color: #000066;">EncodingType</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary&quot;</span> <span style="color: #000066;">wsu:Id</span>=<span style="color: #ff0000;">&quot;_b5MY1ev1b2sj4s0nZL2VDg22&quot;</span> <span style="color: #000066;">xmlns:wsu</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>MIICBDCCAW0CBElt0WUwDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UEBhMCTkwxETAPBgNVBAoMCHBhbG1hLWl0MRIwEAYDVQQLDAlkZXZlbG9wZXIxEzARBgNVBAMMCnBhc2NhbGFsbWEwHhcNMDkwMTE0MTE0OTU3WhcNMDkwNzEzMTE0OTU3WjBJMQswCQYDVQQGEwJOTDERMA8GA1UECgwIcGFsbWEtaXQxEjAQBgNVBAsMCWRldmVsb3BlcjETMBEGA1UEAwwKcGFzY2FsYWxtYTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApSBk3VobSFPMBuzkWpHvVsQLxWcICzOXWuhescOPqgvkQRfBl6g99v/O+73l0eJjrS/ayUf9fNs/VpUWrgHJ2AMD2/tRKrjfOV9YpG9HcupGB74ygpJ4lDy9VY6KxDDnNF0G6q1oJEZWhHkfupTZIZh70DzRVXqrzf6WqXOzd7MCAwEAATANBgkqhkiG9w0BAQUFAAOBgQAGJAPB24oqfBSlUXXBg/krsKKKPKgpxKV5mpoSf+G9WVjIgK1lplURht2Wyecze91MKhQONMqecHqyIorzXmnO0DWa+ND7exDjcGw+tsagVrxIr1FG85QzJqic+l/uX2+8c5a5m85+o0qPLQeKAwc8DWuANJXIh7/Fy76H7CAMvg==<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/wsse:BinarySecurityToken<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:Signature</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2000/09/xmldsig#&quot;</span> <span style="color: #000066;">xmlns:dsig</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2000/09/xmldsig#&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:SignedInfo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:CanonicalizationMethod</span> <span style="color: #000066;">Algorithm</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:SignatureMethod</span> <span style="color: #000066;">Algorithm</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2000/09/xmldsig#rsa-sha1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:Reference</span> <span style="color: #000066;">URI</span>=<span style="color: #ff0000;">&quot;#519sSPHD1xaC8TcH23RKyA22&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:Transforms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:Transform</span> <span style="color: #000066;">Algorithm</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dsig:Transforms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:DigestMethod</span> <span style="color: #000066;">Algorithm</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:DigestValue<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>lzj1qOFAUqEnuIqM2VGOfLDJ1x8=<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dsig:DigestValue<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dsig:Reference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:Reference</span> <span style="color: #000066;">URI</span>=<span style="color: #ff0000;">&quot;#42uhaWCT0QoDrDGlwKsyZA22&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:Transforms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:Transform</span> <span style="color: #000066;">Algorithm</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dsig:Transforms<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:DigestMethod</span> <span style="color: #000066;">Algorithm</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:DigestValue<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>8qR3lN2UDPj2EknUuxaf5Xf+8Ic=<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dsig:DigestValue<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dsig:Reference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dsig:SignedInfo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:SignatureValue<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>g9S4GajLoXFtNkLJHRDponTv3ubZe432onBI0xfqHQ1zqtt2lalDwnyxbitBjbLaBcu94Fr0FeL7vst50e6KoujrAwt3lCT3sCsKBnvTFZKRKicKf6AdqAkq+d2PyIr0w2gpGJD5ejot8HaYUhJyXI/ogPiYxUmHqXkJVGcZzQ0=<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dsig:SignatureValue<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:KeyInfo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsse:SecurityTokenReference</span> <span style="color: #000066;">wsu:Id</span>=<span style="color: #ff0000;">&quot;_Gn6xvVFEyg5rUp3hrpAfYg22&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&quot;</span> <span style="color: #000066;">xmlns:wsu</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsse:Reference</span> <span style="color: #000066;">URI</span>=<span style="color: #ff0000;">&quot;#_b5MY1ev1b2sj4s0nZL2VDg22&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/wsse:SecurityTokenReference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dsig:KeyInfo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dsig:Signature<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsu:Timestamp</span> <span style="color: #000066;">wsu:Id</span>=<span style="color: #ff0000;">&quot;42uhaWCT0QoDrDGlwKsyZA22&quot;</span> <span style="color: #000066;">xmlns:wsu</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&quot;</span> <span style="color: #000066;">xmlns:oas1</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsu:Created<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2009-01-19T10:09:33Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/wsu:Created<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/wsu:Timestamp<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/wsse:Security<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap:Header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:Body</span> <span style="color: #000066;">wsu:Id</span>=<span style="color: #ff0000;">&quot;519sSPHD1xaC8TcH23RKyA22&quot;</span> <span style="color: #000066;">xmlns:wsu</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;n:getTimeResponse</span> <span style="color: #000066;">xmlns:n</span>=<span style="color: #ff0000;">&quot;urn:Test:GetTime&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;result</span> <span style="color: #000066;">xsi:type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>11:09 AM<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/result<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/n:getTimeResponse<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap:Envelope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.redstream.nl/2009/01/20/testing-oracle-wsms-web-service-signing-and-verifying-with-soapui/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Testing Oracle WSM&#039;s Encrypting and Decrypting with SoapUI</title>
		<link>http://www.redstream.nl/2009/01/16/testing-soap-encrypting-and-decrypting-with-soapui/</link>
		<comments>http://www.redstream.nl/2009/01/16/testing-soap-encrypting-and-decrypting-with-soapui/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 08:47:23 +0000</pubDate>
		<dc:creator>Pascal Alma</dc:creator>
				<category><![CDATA[SoapUI]]></category>
		<category><![CDATA[Web Service]]></category>
		<category><![CDATA[Oracle WSM]]></category>
		<category><![CDATA[SOA/Web Services]]></category>

		<guid isPermaLink="false">http://www.pascalalma.net/?p=367</guid>
		<description><![CDATA[As said before I am currently going through the book &#8216;Oracle Web Service Manager&#8216;. In chapter 5 of this book an example is given how to configure OWSM to encrypt outgoing and decrypt incoming soap messages for a web service. &#8230; <a href="http://www.redstream.nl/2009/01/16/testing-soap-encrypting-and-decrypting-with-soapui/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.redstream.nl%2F2009%2F01%2F16%2Ftesting-soap-encrypting-and-decrypting-with-soapui%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.redstream.nl%2F2009%2F01%2F16%2Ftesting-soap-encrypting-and-decrypting-with-soapui%2F&amp;source=redstreamlive&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>As said <a href="http://www.redstream.nl/2009/01/15/testing-ws-security-authentication-with-soapui/">before</a> I am currently going through the book &#8216;<a href="http://www.packtpub.com/oracle-web-services-manager/book">Oracle Web Service Manager</a>&#8216;. In chapter 5 of this book an example is given how to configure <a href="http://www.oracle.com/appserver/web-services-manager.html">OWSM</a> to encrypt outgoing and decrypt incoming soap messages for a web service. To test this setup a dotNet client is created. In this post I will show you how you can test the setup by using SoapUI instead.<span id="more-367"></span><br />
The first step (assuming that SoapUI is already installed) is to create a keystore on the client machine. This keystore must also be used in the OWSM configuration in the example. To create the keystore and necessary key-pair I use <a href="http://portecle.sourceforge.net/">Portecle</a>. I created a new keystore (PKCS based) and added a key for &#8216;pascalalma&#8217; to it. Here is the screenshot with all the necessary info:<br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/01/picture-13.jpg" alt="Portecle screenshot" title="Portecle screenshot" width="600" /></p>
<p>In SoapUI I have created a new project based on the WSDL in the example. At the project level I enter the WS-Security parameters and actions that must be performed. Since the gateway expects the soap message to be encoded I have to encode the outgoing message in SoapUI and decode the incoming response message.<br />
Here is the security configuration at project level. First select the keystore to be used by SoapUI:<br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/01/picture-14.jpg" width="600" /></p>
<p>Then define the outgoing encryption action:<br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/01/picture-21.jpg" width="600" /></p>
<p>And the last one, define the incoming decryption action:<br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/01/picture-31.jpg" width="600"  /></p>
<p>Now everything at project level is set. The next step is to tell the request it should use these settings. This is a step that took some time for me to discover. But when you click at the &#8216;Auth&#8217; tab at the request window you can define the actions that must be executed by SoapUI for the request (and response) of the SOAP call. Here you can find the tab:<br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/01/picture-41.jpg" width="600" /></p>
<p>And here are the parameters set for the security:<br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/01/picture-51.jpg"  width="600" /></p>
<p>Now, this should be it. Actually kind of straightforward&#8230;. But not in my case. I am using SoapUI2.5 and when I sended the request I go the following response back:</p>

<div class="wp_codebox"><table><tr id="p3679"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p367code9"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap-ENV:Envelope</span> <span style="color: #000066;">xmlns:SOAP-ENV</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap-ENV:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap-ENV:Fault<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;faultcode</span> <span style="color: #000066;">xmlns:p</span>=<span style="color: #ff0000;">&quot;http://schemas.oblix.com/ws/2003/08/Faults&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>p:Client.GenericFault<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/faultcode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;faultstring<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>WS-Security process failure:FAULT CODE: UnsupportedSecurityToken FAULT MESSAGE: An unsupported token was provided<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/faultstring<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;detail</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap-ENV:Fault<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap-ENV:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap-ENV:Envelope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>After an extensive search I found out it was a version problem in the SOAP header. OWSM gateway expects an element &#8216;wsse:Reference&#8217; with attribute<br />
<code>ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" </code><br />
but SoapUI was sending the request with <code>ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v1" </code><br />
When I knew what caused the error the solution was quickly found <a href="http://www.eviware.com/forums/index.php?topic=1086.0">here</a>. I downloaded the older version of the WSS4J library (wss4j-1.5.3.jar) and put that in the SoapUI/lib/ directory. I also modified the SoapUI/bin/soapui.bat file so the correct version is loaded by SoapUI. And this time the call worked like a charm. The response I got back now was (decrypted by SoapUI of course):</p>

<div class="wp_codebox"><table><tr id="p36710"><td class="line_numbers"><pre>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
</pre></td><td class="code" id="p367code10"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:Envelope</span> <span style="color: #000066;">soap:encodingStyle</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;</span> <span style="color: #000066;">xmlns:soap</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;</span> <span style="color: #000066;">xmlns:soapenc</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;</span> <span style="color: #000066;">xmlns:xsd</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:Header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsse:Security</span> <span style="color: #000066;">soap:mustUnderstand</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&quot;</span> <span style="color: #000066;">xmlns:wsse</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsse:BinarySecurityToken</span> <span style="color: #000066;">EncodingType</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary&quot;</span> <span style="color: #000066;">ValueType</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3&quot;</span> <span style="color: #000066;">wsu:Id</span>=<span style="color: #ff0000;">&quot;asKWwEekHdcXDlFgYL5yP3w22&quot;</span> <span style="color: #000066;">xmlns:wsu</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>MIICBDCCAW0CBElt0WUwDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UEBhMCTkwxETAPBgNVBAoMCHBhbG1hLWl0MRIwEAYDVQQLDAlkZXZlbG9wZXIxEzARBgNVBAMMCnBhc2NhbGFsbWEwHhcNMDkwMTE0MTE0OTU3WhcNMDkwNzEzMTE0OTU3WjBJMQswCQYDVQQGEwJOTDERMA8GA1UECgwIcGFsbWEtaXQxEjAQBgNVBAsMCWRldmVsb3BlcjETMBEGA1UEAwwKcGFzY2FsYWxtYTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApSBk3VobSFPMBuzkWpHvVsQLxWcICzOXWuhescOPqgvkQRfBl6g99v/O+73l0eJjrS/ayUf9fNs/VpUWrgHJ2AMD2/tRKrjfOV9YpG9HcupGB74ygpJ4lDy9VY6KxDDnNF0G6q1oJEZWhHkfupTZIZh70DzRVXqrzf6WqXOzd7MCAwEAATANBgkqhkiG9w0BAQUFAAOBgQAGJAPB24oqfBSlUXXBg/krsKKKPKgpxKV5mpoSf+G9WVjIgK1lplURht2Wyecze91MKhQONMqecHqyIorzXmnO0DWa+ND7exDjcGw+tsagVrxIr1FG85QzJqic+l/uX2+8c5a5m85+o0qPLQeKAwc8DWuANJXIh7/Fy76H7CAMvg==<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/wsse:BinarySecurityToken<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xenc:EncryptedKey</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/04/xmlenc#&quot;</span> <span style="color: #000066;">xmlns:xenc</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/04/xmlenc#&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xenc:EncryptionMethod</span> <span style="color: #000066;">Algorithm</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/04/xmlenc#rsa-1_5&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dsig:KeyInfo</span> <span style="color: #000066;">xmlns:dsig</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2000/09/xmldsig#&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsse:SecurityTokenReference</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsse:Reference</span> <span style="color: #000066;">URI</span>=<span style="color: #ff0000;">&quot;#asKWwEekHdcXDlFgYL5yP3w22&quot;</span> <span style="color: #000066;">ValueType</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/wsse:SecurityTokenReference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dsig:KeyInfo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xenc:CipherData<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xenc:CipherValue<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>aSM+UvvqfsS/2Damu9pgg2U1oea1O5CjYZ08pKOG0U8IKTJaRgWIDVfjXZI+Gq4Wmsbsz0oWc6wKYawH23clYedt/ScX1ZpEAAHhSEzV8e/+hl3/vZ8Iq7UfLz3DRAat0cn0B00qW8VI+2j94hdTMQJ1v+EjH+7eQpnq0i09UBg=<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xenc:CipherValue<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xenc:CipherData<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xenc:ReferenceList<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xenc:DataReference</span> <span style="color: #000066;">URI</span>=<span style="color: #ff0000;">&quot;#_o8iRaqZLI6bBw6wR009kLQ22&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xenc:ReferenceList<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xenc:EncryptedKey<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/wsse:Security<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap:Header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;n:getTimeResponse</span> <span style="color: #000066;">xmlns:n</span>=<span style="color: #ff0000;">&quot;urn:Test:GetTime&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;result</span> <span style="color: #000066;">xsi:type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>12:23 PM<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/result<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/n:getTimeResponse<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap:Envelope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.redstream.nl/2009/01/16/testing-soap-encrypting-and-decrypting-with-soapui/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Testing Oracle WSM&#039;s SOAP authentication with SoapUI</title>
		<link>http://www.redstream.nl/2009/01/15/testing-ws-security-authentication-with-soapui/</link>
		<comments>http://www.redstream.nl/2009/01/15/testing-ws-security-authentication-with-soapui/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 15:35:31 +0000</pubDate>
		<dc:creator>Pascal Alma</dc:creator>
				<category><![CDATA[SoapUI]]></category>
		<category><![CDATA[Web Service]]></category>
		<category><![CDATA[Oracle WSM]]></category>
		<category><![CDATA[SOA/Web Services]]></category>

		<guid isPermaLink="false">http://www.pascalalma.net/?p=358</guid>
		<description><![CDATA[Last week I started to have a look at the product &#8216;Oracle Web Server Manager&#8216;. I am reading a packtpub book about this product and am halfway now. I will post more about this book later but one thing I &#8230; <a href="http://www.redstream.nl/2009/01/15/testing-ws-security-authentication-with-soapui/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.redstream.nl%2F2009%2F01%2F15%2Ftesting-ws-security-authentication-with-soapui%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.redstream.nl%2F2009%2F01%2F15%2Ftesting-ws-security-authentication-with-soapui%2F&amp;source=redstreamlive&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Last week I started to have a look at the product &#8216;<a href="http://www.oracle.com/appserver/web-services-manager.html">Oracle Web Server Manager</a>&#8216;. I am reading <a href="http://www.packtpub.com/oracle-web-services-manager/book">a packtpub book</a> about this product and am halfway now. I will post more about this book later but one thing I one to mention already is that there are several examples described which are tested by creating a web service client with .Net. I am not familiar with .Net (and do not have the intention to change that) so I used my favorite tool <a href="www.soapui.org/">SoapUI</a> as client to test the Oracle gateway.<span id="more-358"></span><br />
The first example is created in chapter 4. In this example basic authentication is added to a web service. The book describes in detail how you do this with Oracle WSM. To test this setup I will use SoapUI. The first step is to create a project in SoapUI based on the web service&#8217;s WSDL. I accept the defaults so an example request is generated.<br />
The WSDL of the web service looks like this:</p>

<div class="wp_codebox"><table><tr id="p35815"><td class="line_numbers"><pre>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
</pre></td><td class="code" id="p358code15"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;definitions</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;TimeService&quot;</span> <span style="color: #000066;">targetNamespace</span>=<span style="color: #ff0000;">&quot;urn:Test:TimeService&quot;</span> <span style="color: #000066;">xmlns:tns</span>=<span style="color: #ff0000;">&quot;urn:Test:TimeService&quot;</span> <span style="color: #000066;">xmlns:soap</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;</span> <span style="color: #000066;">xmlns:http</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/wsdl/http/&quot;</span> <span style="color: #000066;">xmlns:xsd</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">xmlns:wsdl</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/wsdl/&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/wsdl/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;message</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime0SoapIn&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;format&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/message<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;message</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime0SoapOut&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Result&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/message<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portType</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;TimeServiceSoap&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;operation</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime&quot;</span> <span style="color: #000066;">parameterOrder</span>=<span style="color: #ff0000;">&quot;format&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime0SoapIn&quot;</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;tns:getTime0SoapIn&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;output</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime0SoapOut&quot;</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;tns:getTime0SoapOut&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/operation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;binding</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;TimeServiceSoap&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;tns:TimeServiceSoap&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:binding</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;rpc&quot;</span> <span style="color: #000066;">transport</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/http&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;operation</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:operation</span> <span style="color: #000066;">soapAction</span>=<span style="color: #ff0000;">&quot;getTime&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;rpc&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime0SoapIn&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:body</span> <span style="color: #000066;">use</span>=<span style="color: #ff0000;">&quot;encoded&quot;</span> <span style="color: #000066;">namespace</span>=<span style="color: #ff0000;">&quot;urn:Test:GetTime&quot;</span> <span style="color: #000066;">encodingStyle</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/input<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;output</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;getTime0SoapOut&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:body</span> <span style="color: #000066;">use</span>=<span style="color: #ff0000;">&quot;encoded&quot;</span> <span style="color: #000066;">namespace</span>=<span style="color: #ff0000;">&quot;urn:Test:GetTime&quot;</span> <span style="color: #000066;">encodingStyle</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/output<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/operation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/binding<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;TimeService&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;port</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;TimeServiceSoap&quot;</span> <span style="color: #000066;">binding</span>=<span style="color: #ff0000;">&quot;tns:TimeServiceSoap&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:address</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;http://localhost:3115/gateway/services/SID0003001&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/port<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/definitions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>If I don&#8217;t configure anything in SoapUI and just send the request I get the response:</p>

<div class="wp_codebox"><table><tr id="p35816"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p358code16"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap-ENV:Envelope</span> <span style="color: #000066;">xmlns:SOAP-ENV</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap-ENV:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap-ENV:Fault<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;faultcode</span> <span style="color: #000066;">xmlns:p</span>=<span style="color: #ff0000;">&quot;http://schemas.oblix.com/ws/2003/08/Faults&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>p:Client.AuthenticationFault<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/faultcode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;faultstring<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Invalid username or password<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/faultstring<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;detail</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap-ENV:Fault<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap-ENV:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap-ENV:Envelope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>which is logical, because I have to supply credentials. These credentials must be added to the SOAP call according to the WS-Security specs. Luckily this is done by SoapUI by default. Here is the configuration of the call in SoapUI:<br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/01/picture-12.jpg" width="600" /></p>
<p>The SOAP request that is send now looks like this (the raw xml):</p>

<div class="wp_codebox"><table><tr id="p35817"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code" id="p358code17"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soapenv:Envelope</span> <span style="color: #000066;">xmlns:soapenv</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;</span> <span style="color: #000066;">xmlns:urn</span>=<span style="color: #ff0000;">&quot;urn:Test:GetTime&quot;</span> <span style="color: #000066;">xmlns:xsd</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soapenv:Header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsse:Security</span> <span style="color: #000066;">soapenv:mustUnderstand</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">xmlns:wsse</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsse:UsernameToken</span> <span style="color: #000066;">wsu:Id</span>=<span style="color: #ff0000;">&quot;UsernameToken-32950583&quot;</span> <span style="color: #000066;">xmlns:wsu</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsse:Username<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>palma<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/wsse:Username<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsse:Password</span> <span style="color: #000066;">Type</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>alma23<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/wsse:Password<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsse:Nonce<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Ekgk+pK0FhRj8EnzWxFsKg==<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/wsse:Nonce<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;wsu:Created<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2009-01-15T08:37:08.005Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/wsu:Created<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/wsse:UsernameToken<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/wsse:Security<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soapenv:Header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soapenv:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;urn:getTime</span> <span style="color: #000066;">soapenv:encodingStyle</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;format</span> <span style="color: #000066;">xsi:type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>?<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/format<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/urn:getTime<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soapenv:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soapenv:Envelope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>As you might notice a SOAP header is now added with the credentials information. The result now is:</p>

<div class="wp_codebox"><table><tr id="p35818"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p358code18"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:Envelope</span> <span style="color: #000066;">soap:encodingStyle</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;</span> <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span> <span style="color: #000066;">xmlns:xsd</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">xmlns:soap</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;</span> <span style="color: #000066;">xmlns:soapenc</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;soap:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;n:getTimeResponse</span> <span style="color: #000066;">xmlns:n</span>=<span style="color: #ff0000;">&quot;urn:Test:GetTime&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;result</span> <span style="color: #000066;">xsi:type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>09:37 AM<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/result<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/n:getTimeResponse<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap:Body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/soap:Envelope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>So this works!</p>
<p>The next example in the book for which I use SoapUI is about encrypting and decrypting the message. This has some more configuration to setup so I will show this in a separate post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.redstream.nl/2009/01/15/testing-ws-security-authentication-with-soapui/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

