We are using Axis 1.1, and we use the "Java2WSDL" tool to create WSDL
describing our already-existing services. We now want to include in the
generated WSDL a description of the Soap headers we support. I know
of no way for Axis's "Java2WSDL" to do this, so I am currently looking at
using the WSDL4J API to programmatically add the soap:header elements
to the WSDL.
Does anyone have example code showing how to do this? I'm using the
example code from the JSR110 (JWSDL) document to do the basic WSDL
traversal stuff, but I can't figure out how to create a SOAPHeader
ExtensibilityElement that I can add to the BindingInput. It's the
createExtension() method that I'm having problems with.
A snippet of the code I have so far:
ExtensionRegistry extReg = new ExtensionRegistry();
Service svc = def.getService(new QName(targetNamespace, "MyService"));
Port port = svc.getPort("MyServicePort");
Binding binding = port.getBinding();
List ops = binding.getBindingOperations();
Iterator iter = ops.iterator();
while (iter.hasNext()) {
BindingOperation bo = (BindingOperation)iter.next();
BindingInput bi = bo.getBindingInput();
SOAPHeader sh
= (SOAPHeader)extReg.createExtension(BindingInput.class,
new QName("soap", "header"));
}
Any WSDL4J experts out there that can help me?
Regards.
Steve Pannier