Thanks Dan-- that information has helped me get a bit further.  I'm
afraid I won't be able to do any more work on it until Monday though...
I'll let you know how things are going...

-Chris

-----Original Message-----
From: Dan Diephouse [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 20, 2007 3:15 PM
To: [email protected]
Subject: Re: Questions While Implementing MTOM Policy

Hi Christopher,

A zip of the module or a paste of the interceptor, mtom-policy.xml file,
and
interceptor provider would be extremely helpful.

Re question #2 - is your question how do I apply this mtom policy to my
service? I think the two mechanisms we have right now are WSDL Policy
Attachments and creating an external policy. I'm working on a third
where we
can embed it in an <endpoint>/<client> configuration.

Here's a small example of how to load an external policy file:

    <bean class="
org.apache.cxf.ws.policy.attachment.external.ExternalAttachmentProvider"
>
        <constructor-arg ref="cxf"/>
        <property name="location"
value="org/apache/cxf/systest/ws/policy/addr-external.xml"/>
    </bean>

And then the external file:

<attachments xmlns:wsp="http://www.w3.org/2006/07/ws-policy"; xmlns:wsa="
http://www.w3.org/2005/08/addressing";>
    <wsp:PolicyAttachment>
        <wsp:AppliesTo>
            <wsa:EndpointReference>
 
<wsa:Address>http://localhost:9020/SoapContext/GreeterPort
</wsa:Address>
            </wsa:EndpointReference>
        </wsp:AppliesTo>
        <wsp:Policy>
            <wsam:Addressing xmlns:wsam="
http://www.w3.org/2007/01/addressing/metadata";>
                <wsp:Policy/>
            </wsam:Addressing>
        </wsp:Policy>
    </wsp:PolicyAttachment>
</attachments>

This is part of the policy system tests.  How are you configuring your
service right now? Via the API? Via Spring?
- Dan

On 4/20/07, Christopher Moesel <[EMAIL PROTECTED]> wrote:
>
> A Quick Update:
>
> I moved the bean configurations from the
> META-INF/cxf/cxf-extension-mtom-policy.xml file to my service's own
> Spring configuration file.  Now I can see that my
MTOMAssertionBuilder,
> MTOMPolicyInterceptorProvider, and MTOMPolicyInterceptors are at least
> instantiated (which is further than I got before).
>
> But, the handleMessage method on my MTOMPolicyInterceptor is never
> called when I make a request to the service, so something still
doesn't
> seem to be registered right.
>
> So two questions now:
>
> 1)  Why wasn't my META-INF/cxf/cxf-extension-mtom-policy.xml file
never
> loaded by the framework?
>
> 2)  How do I get my service to actually build those assertions and
> intercept the messages?
>
> Thanks,
> Chris
>
> -----Original Message-----
> From: Christopher Moesel [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 20, 2007 2:40 PM
> To: [email protected]
> Subject: Questions While Implementing MTOM Policy
>
> Hello,
>
> I'm trying to implement a plugin for the MTOM Policy specification.
> This is essentially a policy that states whether or not MTOM should be
> used (or is optional).  I intend on contributing it back to CXF, so I
> figure I'm OK sending this to the dev list. ;)
>
> I've created a MTOMAssertionBuilder that uses PrimitiveAssertions, a
> MTOMPolicyInterceptor (that at this point just prints out if it is
> asserted), and a MTOMPolicyInterceptorProvider.
>
> I've registered the MTOMAssertionBuilder and
> MTOMPolicyInterceptorProvider in
> META-INF/cxf/cxf-extension-mtom-policy.xml and created a corresponding
> META-INF/cxf/cxf.extension file.  According to the documentation, this
> is all that is needed to register them in CXF.
>
> When I try my service (that has the ws-policy and ws-mtom-policy jars
in
> its classpath), none of my MTOM policy classes seem to be called.  Do
I
> need to do something else to register them with my service, or is
having
> the policy assertion in the port of my WSDL file enough?  It seems I
> must be missing something important.
>
> If it would be helpful, I can zip up the module and send it along.
>
> Thanks!
> Chris
>



-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

Reply via email to