Hi Nandana,

sorry for the late answer. Here is attached the wsdl I used.
And the code to create the AxisService is here [1]

[1]
http://github.com/matthieu/apache-ode/blob/085025ab3639c7aa0255bbb9b905210ff6caf295/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java#L80

Thanks a lot for your help.

Alexis


2009/2/16 Nandana Mihindukulasooriya <[email protected]>

> Hi Alexis,
>       can you post the WSDL you used  ?
>
> thanks,
> nandana
>
>
> On Mon, Feb 16, 2009 at 9:06 AM, Alexis Midon <[email protected]> wrote:
>
>> I can't wait for your feedback, and may be a working sample ;)
>>
>> Thanks a lot Nandana!
>>
>> Alexis
>>
>>
>>
>> On Sun, Feb 15, 2009 at 3:49 PM, Nandana Mihindukulasooriya <
>> [email protected]> wrote:
>>
>>> Hi Alexis,
>>>        Sorry I just saw the mail. I will have a look at your
>>> WSDL11ToAxisServiceBuilder and see why the policy is not being attached
>>> correctly.
>>>
>>> thanks,
>>> nandana
>>>
>>>
>>>
>>> On Thu, Feb 12, 2009 at 10:21 AM, Alexis Midon <[email protected]>wrote:
>>>
>>>> (forwarding to the rampart folks)
>>>>
>>>> Alexis
>>>>
>>>>
>>>>
>>>> ---------- Forwarded message ----------
>>>> From: Alexis Midon <[email protected]>
>>>> Date: Tue, Feb 10, 2009 at 5:50 PM
>>>> Subject: Applying policies at binding hierarchy in Apache Axis2
>>>> 1.4.1/Rampart 1.4
>>>> To: [email protected]
>>>>
>>>>
>>>>
>>>> Hi everyone,
>>>>
>>>> based on this article: http://wso2.org/library/3786, I wrote my own
>>>> (simple) wsdl with a policy attached to the soap binding.
>>>> I load that wsdl with a WSDL11ToAxisServiceBuilder [1]. My issue is that
>>>> when I invoke the service the following AxisFault is thrown:
>>>>
>>>> org.apache.axis2.AxisFault: Must Understand check failed for header
>>>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:
>>>>  Security
>>>>     at
>>>> org.apache.axis2.engine.AxisEngine.checkMustUnderstand(AxisEngine.java:102)
>>>>     at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:166)
>>>>     at
>>>> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
>>>>
>>>>
>>>> After a debugging session, it appears that the policy map of the
>>>> AxisService holds a policy reference, but the policy include and subject do
>>>> not. And the policy is never accessed by the RampartReceiver.
>>>>
>>>> Could you tell what I'm missing and/or point me to a working sample of
>>>> embedded policy (I did not find any in Rampart repo)?
>>>>
>>>> Thanks in advance,
>>>>
>>>> Alexis
>>>>
>>>> [1]
>>>> http://github.com/matthieu/apache-ode/blob/085025ab3639c7aa0255bbb9b905210ff6caf295/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java#L80
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Nandana Mihindukulasooriya
>>> WSO2 inc.
>>>
>>> http://nandana83.blogspot.com/
>>> http://www.wso2.org
>>>
>>
>>
<?xml version="1.0" encoding="utf-8" ?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License.  You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->

<wsdl:definitions 
    targetNamespace="http://ode/bpel/unit-test.wsdl";
    xmlns="http://schemas.xmlsoap.org/wsdl/";
    xmlns:tns="http://ode/bpel/unit-test.wsdl";
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema";
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype";
    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy";>

<wsp:Policy wsu:Id="SigEncr" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";>
    <wsp:ExactlyOne>
        <wsp:All>
            <sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
                <wsp:Policy>
                    <sp:InitiatorToken>
                        <wsp:Policy>
                            <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient";>
                                <wsp:Policy>
                                    <sp:WssX509V3Token10/>
                                </wsp:Policy>
                            </sp:X509Token>
                        </wsp:Policy>
                    </sp:InitiatorToken>
                    <sp:RecipientToken>
                        <wsp:Policy>
                            <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never";>
                                <wsp:Policy>
                                    <sp:WssX509V3Token10/>
                                </wsp:Policy>
                            </sp:X509Token>
                        </wsp:Policy>
                    </sp:RecipientToken>
                    <sp:AlgorithmSuite>
                        <wsp:Policy>
                            <sp:TripleDesRsa15/>
                        </wsp:Policy>
                    </sp:AlgorithmSuite>
                    <sp:Layout>
                        <wsp:Policy>
                            <sp:Strict/>
                        </wsp:Policy>
                    </sp:Layout>
                    <sp:IncludeTimestamp/>
                    <sp:OnlySignEntireHeadersAndBody/>
                </wsp:Policy>
            </sp:AsymmetricBinding>
            <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
                <wsp:Policy>
                    <sp:MustSupportRefKeyIdentifier/>
                    <sp:MustSupportRefIssuerSerial/>
                </wsp:Policy>
            </sp:Wss10>
            <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
                <sp:Body/>
            </sp:SignedParts>
            <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
                <sp:Body/>
            </sp:EncryptedParts>

            <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy";> 
                <ramp:user>service</ramp:user>
                <ramp:encryptionUser>client</ramp:encryptionUser>
                <ramp:passwordCallbackClass>org.apache.rampart.samples.policy.sample03.PWCBHandler</ramp:passwordCallbackClass>
                
                <ramp:signatureCrypto>
                    <ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
                        <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
                        <ramp:property name="org.apache.ws.security.crypto.merlin.file">service.jks</ramp:property>
                        <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">apache</ramp:property>
                    </ramp:crypto>
                </ramp:signatureCrypto>
                <ramp:encryptionCypto>
                    <ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
                        <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
                        <ramp:property name="org.apache.ws.security.crypto.merlin.file">service.jks</ramp:property>
                        <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">apache</ramp:property>
                    </ramp:crypto>
                </ramp:encryptionCypto>
            </ramp:RampartConfig>

        </wsp:All>
    </wsp:ExactlyOne>
</wsp:Policy>


    <wsdl:message name="HelloMessage">
        <wsdl:part name="TestPart" type="xsd:string"/>
    </wsdl:message>
    
    <wsdl:portType name="HelloPortType">
        <wsdl:operation name="hello">
            <wsdl:input message="tns:HelloMessage" name="TestIn"/>
            <wsdl:output message="tns:HelloMessage" name="TestOut"/>
        </wsdl:operation>    
    </wsdl:portType>
    
     <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
	<wsp:PolicyReference URI="#SigEncr"/>
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="hello">
            <soap:operation soapAction="" style="rpc"/>
            <wsdl:input>
                <soap:body
                    namespace="http://ode/bpel/unit-test.wsdl";
                    use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body
                    namespace="http://ode/bpel/unit-test.wsdl"; 
                    use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="HelloService">
        <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
            <soap:address location="http://localhost:8080/ode/processes/helloWorld"/>
        </wsdl:port>
    </wsdl:service>
    
   <plnk:partnerLinkType name="HelloPartnerLinkType">
       <plnk:role name="me" portType="tns:HelloPortType"/>
   </plnk:partnerLinkType>
</wsdl:definitions>

Reply via email to