Hello,

how can I omit the ReplyTo header in outgoing one way messages? I use
submission version of WS-Addressing and a fire-and-forget client. I
inspected the addressing code a little bit and found a
INCLUDE_OPTIONAL_HEADERS option, but setting it to false was not successful.

Here is the call:

public static final void main(String[] s) {
try {
        String repository = s[0];
        ConfigurationContext confCtxt = ConfigurationContextFactory
                .createConfigurationContextFromFileSystem(repository,
                        (new File(repository + "/conf/axis2.xml"))
                                .getAbsolutePath());
        ListenerManager listenerManager = new ListenerManager();
        listenerManager.init(confCtxt);
        listenerManager.start();
        Options options = new Options();
        
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
        options.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,
                AddressingConstants.Submission.WSA_NAMESPACE);
        options.setAction("anyAction");
        
options.setProperty(AddressingConstants.INCLUDE_OPTIONAL_HEADERS,false);
        // transport settings...
        ServiceClient client = new ServiceClient(confCtxt, null);
        client.setOptions(options);
        OMFactory factory = OMAbstractFactory.getOMFactory();
        OMElement el = factory.createOMElement("Test", null);
        client.fireAndForget(el);
}
catch (Exception e) {
        e.printStackTrace();
}


This is what is sent:

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing";
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";>
    <soapenv:Header>
        <wsa:ReplyTo>
            <wsa:Address>
 
http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
            </wsa:Address>
        </wsa:ReplyTo>
        <wsa:MessageID>
            urn:uuid:01673833EEDE7612381182964039233
        </wsa:MessageID>
        <wsa:Action>
            anyAction
        </wsa:Action>
    </soapenv:Header>
    <soapenv:Body>
        <Test>
        </Test>
    </soapenv:Body>
</soapenv:Envelope>


ReplyTo is optional in Submission version. So why it is set? And how can I
omit it?
I think this was not the case in earlier versions.


Thanks,
Andreas Bobek.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to