Return-Path: Delivered-To: apmail-incubator-cxf-dev-archive@locus.apache.org Received: (qmail 7025 invoked from network); 20 Apr 2007 21:44:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Apr 2007 21:44:55 -0000 Received: (qmail 55453 invoked by uid 500); 20 Apr 2007 21:45:01 -0000 Delivered-To: apmail-incubator-cxf-dev-archive@incubator.apache.org Received: (qmail 55408 invoked by uid 500); 20 Apr 2007 21:45:01 -0000 Mailing-List: contact cxf-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-dev@incubator.apache.org Received: (qmail 55398 invoked by uid 99); 20 Apr 2007 21:45:01 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Apr 2007 14:45:01 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [209.85.134.185] (HELO mu-out-0910.google.com) (209.85.134.185) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Apr 2007 14:44:53 -0700 Received: by mu-out-0910.google.com with SMTP id w1so1222306mue for ; Fri, 20 Apr 2007 14:44:31 -0700 (PDT) Received: by 10.82.152.16 with SMTP id z16mr5489566bud.1177105471187; Fri, 20 Apr 2007 14:44:31 -0700 (PDT) Received: by 10.82.100.10 with HTTP; Fri, 20 Apr 2007 14:44:31 -0700 (PDT) Message-ID: <7b774c950704201444i629bda68r1fb2318a5ae85f9@mail.gmail.com> Date: Fri, 20 Apr 2007 16:44:31 -0500 From: "Dan Diephouse" To: cxf-dev@incubator.apache.org Subject: Re: Questions While Implementing MTOM Policy In-Reply-To: <7b774c950704201442tac83548k16359e120c8750b5@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_76839_20750557.1177105471124" References: <7b774c950704201442tac83548k16359e120c8750b5@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_76839_20750557.1177105471124 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Actually, I think I see the issue: In JaxbAssertionBuilder.getOptionality it has this line: boolean optional = false; String value = element.getAttributeNS( Constants.Q_ELEM_OPTIONAL_ATTR.getNamespaceURI(), Constants.Q_ELEM_OPTIONAL_ATTR.getLocalPart()); if (Boolean.valueOf(value)) { optional = true; } return optional; The issue is that the attribute is NOT qualified. So I think it should just be: String value = element.getAttribute( Constants.Q_ELEM_OPTIONAL_ATTR.getLocalPart()); Does that fix things? - Dan On 4/20/07, Dan Diephouse wrote: > > Hi Christopher, > > It sounds like a possible bug. The normalization logic looks right (for my > inexperienced eyes). It only adds a second All if optional is false. Do you > know where optional gets set to false? Only place I see that called is > JaxbAssertionBuilder:104... > > I'm not sure if you're doing this in your own build or within in the CXF > build, but you could possibly send a patch along and I'll try to take a > peek. Or, you can take a gander at fixing normalization yourself. I'll be > honest, I'm not that familiar with how normalization works yet in CXF, but > I'll see if I can help. > > - Dan > > On 4/20/07, Christopher Moesel wrote: > > > > I fit in a little more work... It's almost their, except that even > > though I set my policy assertion to wsp:Optional="true", by the time it > > makes it to the interceptor, the optional attribute is false. > > > > If I debug, I can see that when the PrimitiveAssertion is built, it > > correctly sets the "optional" attribute to true. But somewhere down the > > line, the assertion is "normalized" and the optional flag gets reset to > > false. This appears to be happening in the PrimitiveAssertion.normalize > > method. The PolicyComponent returned is an ExactlyOne that contains two > > Alls. The first All has a PrimitiveAssertion with optional set to > > false. The second All is empty. > > > > Is this the intended behavior? Is this a translation of optional=true > > to an ExactlyOne with one required Assertion and one empty Assertion? > > If so, how can I tell the difference between that and optional=false > > from within an interceptor? > > > > Or does that question not even make sense? ;) > > > > -Chris > > > > -----Original Message----- > > From: Christopher Moesel [mailto:Christopher_Moesel@avid.com ] > > Sent: Friday, April 20, 2007 4:16 PM > > To: cxf-dev@incubator.apache.org > > Subject: RE: Questions While Implementing MTOM Policy > > > > 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: dan@envoisolutions.com] > > Sent: Friday, April 20, 2007 3:15 PM > > To: cxf-dev@incubator.apache.org > > 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 / configuration. > > > > Here's a small example of how to load an external policy file: > > > > > > > > > > > value="org/apache/cxf/systest/ws/policy/addr-external.xml"/> > > > > > > And then the external file: > > > > > xmlns:wsa=" > > http://www.w3.org/2005/08/addressing"> > > > > > > > > > > http://localhost:9020/SoapContext/GreeterPort > > > > > > > > > > > > > > > > > > > > > > > > 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 < Christopher_Moesel@avid.com> 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:Christopher_Moesel@avid.com] > > > Sent: Friday, April 20, 2007 2:40 PM > > > To: cxf-dev@incubator.apache.org > > > 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 > > > > > > -- > Dan Diephouse > Envoi Solutions > http://envoisolutions.com | http://netzooid.com/blog > -- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog ------=_Part_76839_20750557.1177105471124--