Hello,

we have immense problems dealing with SOAP header parameters.

We use Axis 1.4 and generate WSDL from Java.
The soap header of each operation of a service should contain a single element 
"systemContext"
of custom type SystemContextTO, to be defined like:

   <complexType name="SystemContextTO">
    <sequence>
    ...
    </sequence>
   </complexType>

...


Since we don't want to declare whole operations in deploy.wsdd including soap 
header parameters, we
would try to use the generateWSDL handler hook to add appropriate parameter 
definitions.

As I said, our deploy.wsdd only contains BeanMappings, one for the soap header 
element:

deploy.wsdd:
...

    <service name="Offer" provider="java:RPC" style="wrapped" use="literal">
        <namespace>http://www.soapinterop.org/Offer</namespace>
...
        <beanMapping qname="offer:systemContext" 
languageSpecificType="java:com.bmwfs.offer.transfer.SystemContextTO"/>
        <beanMapping qname="offer:SystemContextTO" 
languageSpecificType="java:com.bmwfs.offer.transfer.SystemContextTO"/>
...


But the problem ist we don't know how to add the SOAP header parameter to the 
existing operations.
Since there is no documentation on that, it is a game of try and error.

Our approach with generateWSDL is as follows:

public void generateWSDL(MessageContext context) throws AxisFault {
...
        List operations = 
context.getService().getInitializedServiceDesc(context).getOperations();
        if (operations != null) {
        Iterator operIter = operations.iterator();
        OperationDesc opDesc;
        ParameterDesc paramDesc;
        Class clz;
        while (operIter.hasNext()) {
                opDesc = (OperationDesc)operIter.next();
                clz = SystemContextTO.class;
                paramDesc = new ParameterDesc(new 
QName("http://www.soapinterop.org/Offer";, "systemContext"),
                        ParameterDesc.IN,
                        ???,
                        clz,
                        true,
                        false);
                opDesc.addParameter(paramDesc);
        }
}
...

But I don't know how to get/handle the qnames and XML types?
Do I have to provide the bean mapping programmatically too?
I've noticed that when doing that or removing the systemContext bean mapping 
from deploy.wsdd the
service does not work anymore.

Any held is appreciated.

Regards,
Martin
______________________________________________________________________________
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!


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

Reply via email to