Correcting: I'm using Axis2 1.3.

2008/4/1, Diego Pacheco <[EMAIL PROTECTED]>:
>
> Hi everyone,
>
> I'm running the sample04 from Rampart 1.3 samples, using Axis1.3 and
> Tomcat 6.0.14 but when I tried to call the service I got the following
> exception on client (no change was made in the sample):
>
>      [java] Exception in thread "main" org.apache.axis2.AxisFault: Missing
> wsse:
> Security header in request
>      [java]     at org.apache.rampart.handler.RampartReceiver.invoke
> (RampartRece
> iver.java:92)
>      [java]     at org.apache.axis2.engine.Phase.invoke(Phase.java:292)
>      [java]     at org.apache.axis2.engine.AxisEngine.invoke(
> AxisEngine.java:212
> )
>      [java]     at org.apache.axis2.engine.AxisEngine.receive(
> AxisEngine.java:13
> 2)
>      [java]     at
> org.apache.axis2.description.OutInAxisOperationClient.handleR
> esponse(OutInAxisOperation.java:336)
>      [java]     at
> org.apache.axis2.description.OutInAxisOperationClient.send(Ou
> tInAxisOperation.java:389)
>      [java]     at
> org.apache.axis2.description.OutInAxisOperationClient.execute
> Impl(OutInAxisOperation.java:211)
>      [java]     at org.apache.axis2.client.OperationClient.execute
> (OperationClie
> nt.java:163)
>      [java]     at org.apache.axis2.client.ServiceClient.sendReceive
> (ServiceClie
> nt.java:528)
>      [java]     at org.apache.axis2.client.ServiceClient.sendReceive
> (ServiceClie
> nt.java:508)
>      [java]     at org.apache.rampart.samples.policy.sample04.Client.main
> (Unknow
> n Source)
>      [java] Caused by: org.apache.rampart.RampartException: Missing
> wsse:Securit
> y header in request
>      [java]     at org.apache.rampart.RampartEngine.process(
> RampartEngine.java:1
> 06)
>      [java]     at org.apache.rampart.handler.RampartReceiver.invoke
> (RampartRece
> iver.java:85)
>      [java]     ... 10 more
>      [java] Java Result: 1
>
> BUILD SUCCESSFUL
> Total time: 7 seconds
> C:\rampart-1.3\samples\policy>
>
> However the SOAP request message contains the wsse:Security header:
>
> <?xml version='1.0' encoding='utf-8'?>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:wsa="http://www.w3.org/2005/08/addressing";>
>   <soapenv:Header>
>     <wsse:Security xmlns:wsse="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
> soapenv:mustUnderstand="1">
>       <wsu:Timestamp xmlns:wsu="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
> wsu:Id="Timestamp-20910958">
>         <wsu:Created>2008-04-02T00:28:00.312Z</wsu:Created>
>         <wsu:Expires>2008-04-02T00:33:00.312Z</wsu:Expires>
>       </wsu:Timestamp>
>       <wsc:SecurityContextToken xmlns:wsc="
> http://schemas.xmlsoap.org/ws/2005/02/sc"; xmlns:wsu="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
> wsu:Id="sctId-15351007">
>
> <wsc:Identifier>urn:uuid:B691A0608A95E9218F12070960833281</wsc:Identifier>
>       </wsc:SecurityContextToken>
>       <wsc:DerivedKeyToken xmlns:wsc="
> http://schemas.xmlsoap.org/ws/2005/02/sc"; xmlns:wsu="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
> wsu:Id="derivedKeyId-12626425">
>         <wsse:SecurityTokenReference>
>           <wsse:Reference URI="#sctId-15351007" ValueType="
> http://schemas.xmlsoap.org/ws/2005/02/sc/sct"; />
>         </wsse:SecurityTokenReference>
>         <wsc:Length>16</wsc:Length>
>         <wsc:Nonce>gARRJ4qrsrJPwQwvLg9niw==</wsc:Nonce>
>         <wsc:Offset>0</wsc:Offset>
>       </wsc:DerivedKeyToken>
>       <xenc:ReferenceList xmlns:xenc="http://www.w3.org/2001/04/xmlenc#";>
>         <xenc:DataReference URI="#EncDataId-3885854" />
>         <xenc:DataReference URI="#EncDataId-14098944" />
>       </xenc:ReferenceList>
>       <wsc:DerivedKeyToken xmlns:wsc="
> http://schemas.xmlsoap.org/ws/2005/02/sc"; xmlns:wsu="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
> wsu:Id="derivedKeyId-17365216">
>         <wsse:SecurityTokenReference>
>           <wsse:Reference URI="#sctId-15351007" ValueType="
> http://schemas.xmlsoap.org/ws/2005/02/sc/sct"; />
>         </wsse:SecurityTokenReference>
>         <wsc:Length>16</wsc:Length>
>         <wsc:Nonce>1O597Wd5okArK/ISxTmNQA==</wsc:Nonce>
>         <wsc:Offset>0</wsc:Offset>
>       </wsc:DerivedKeyToken>
>       <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#";
> Id="Signature-10656878">
>         <ds:SignedInfo>
>           <ds:CanonicalizationMethod Algorithm="
> http://www.w3.org/2001/10/xml-exc-c14n#"; />
>           <ds:SignatureMethod Algorithm="
> http://www.w3.org/2000/09/xmldsig#hmac-sha1"; />
>           <ds:Reference URI="#Timestamp-20910958">
>             <ds:Transforms>
>               <ds:Transform Algorithm="
> http://www.w3.org/2001/10/xml-exc-c14n#"; />
>             </ds:Transforms>
>             <ds:DigestMethod Algorithm="
> http://www.w3.org/2000/09/xmldsig#sha1"; />
>             <ds:DigestValue>UbUnR4E3T6vnkpYF3SYLBZ0UekI=</ds:DigestValue>
>           </ds:Reference>
>         </ds:SignedInfo>
>
> <ds:SignatureValue>NUvdwZyCAca7dP1AMuO7Ie9nU+k=</ds:SignatureValue>
>         <ds:KeyInfo Id="KeyId-30149247">
>           <wsse:SecurityTokenReference xmlns:wsu="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
> wsu:Id="STRId-12919296">
>             <wsse:Reference URI="#derivedKeyId-17365216" />
>           </wsse:SecurityTokenReference>
>         </ds:KeyInfo>
>       </ds:Signature>
>     </wsse:Security>
>     <wsa:To>http://localhost:8080/axis2/services/sample04</wsa:To>
>
> <wsa:MessageID>urn:uuid:0259C4A41F41ACABCF1207096080131</wsa:MessageID>
>     <wsa:Action>urn:echo</wsa:Action>
>   </soapenv:Header>
>   <soapenv:Body xmlns:wsu="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
> wsu:Id="Id-3885854">
>     <ns1:echo xmlns:ns1="http://sample04.policy.samples.rampart.apache.org
> ">
>       <param0>Hello world1</param0>
>     </ns1:echo>
>   </soapenv:Body>
> </soapenv:Envelope>
>
> Using the SimpleHTTPServer option the exception don't occurs.
>
> I need to do some change on the policy.xml or service.xml? I used the same
> files from the sample without making any changes.
>
> Regards,
>
> Diego
>
>

Reply via email to