Hi Nandana,

Yes, I understand that the Transport assertion is not contributing anything useful in this case. AFAIK it's still valid, though, and needs to be supported.

Is the error fixed in the current (and 1.5 branch) codebase? If not, should I create a Jira?

Thanks,

 - Dennis


Nandana Mihindukulasooriya wrote:
Hi Dennis,
I think the problem is with the serialization of Transport binding assertion without a transport token. What are your security requirements ? If you only need to have the username token , you can remove the Transport binding assertion completely and have only the SupportingTokens assertion in the policy. If you also need to enforce https transport, you can add a HttpsToken as a transport token.

thanks,
Nandana

On Mon, Mar 16, 2009 at 4:12 AM, Dennis Sosnoski <[email protected] <mailto:[email protected]>> wrote:

    Hi Nandana,

    I've attached one of several variations I've tried which results
    in this error. I did find that if I take out the TransportBinding
    part I don't get the error.

    Thanks for taking a look!

     - Dennis


    Nandana Mihindukulasooriya wrote:

        Hi Dennis,
               Can you post the WSDL you are code generating against ?

        thanks,
        nandana

        On Fri, Mar 13, 2009 at 3:09 AM, Dennis Sosnoski
        <[email protected] <mailto:[email protected]>
        <mailto:[email protected] <mailto:[email protected]>>> wrote:

           I've been trying to use the client-side code generation
        support for
           WS-SecurityPolicy in WSDL, with Axis2 1.4.1 and Rampart
        1.4. I've
           tried
           several variations of where I place the policy in the WSDL,
        including
           using reference and embedding it directly in the
        <wsdl:binding>, but
           each time I get:

              [java] Exception in thread "main"
           org.apache.axis2.wsdl.codegen.CodeGenerationException:
           org.apache.axis2.wsdl.codegen.CodeGenerationException:
           java.lang.RuntimeException: can't serialize the policy
           ..
              [java]     at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:271)


              [java]     at
           org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
              [java]     at
           org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
              [java] Caused by:
           org.apache.axis2.wsdl.codegen.CodeGenerationException:
           java.lang.RuntimeException: can't serialize the policy
           ..
              [java]     at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.emitStub(AxisServiceBasedMultiLanguageEmitter.java:534)


              [java]     at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:260)


              [java]     ... 2
           more
              [java] Caused by: java.lang.RuntimeException: can't
        serialize the
           policy ..
              [java]     at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.getInputElement(AxisServiceBasedMultiLanguageEmitter.java:2732)


              [java]     at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.generateMethodElement(AxisServiceBasedMultiLanguageEmitter.java:2261)



              [java]     at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.loadOperations(AxisServiceBasedMultiLanguageEmitter.java:2151)


              [java]     at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.createDOMDocumentForInterface(AxisServiceBasedMultiLanguageEmitter.java:1207)


              [java]     at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.writeInterface(AxisServiceBasedMultiLanguageEmitter.java:1163)


              [java]     at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.emitStub(AxisServiceBasedMultiLanguageEmitter.java:492)


              [java]     ... 3
           more
              [java] Java Result: 1

           Has anyone been able to get the client-side generation for
           WS-SecurityPolicy in WSDL to work? If so, can you supply an
           example WSDL?

           Thanks,

            - Dennis

           --    Dennis M. Sosnoski
           SOA and Web Services in Java
           Axis2 Training and Consulting
           http://www.sosnoski.com - http://www.sosnoski.co.nz
           Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Reply via email to