Hello Sagara,

The problem is that I must know prefixes and put them manually, while normal DOM may work in repair mode. note that for elementDeclaration I have to provide a prefix ("ns0") and then manually put it in the Description... It it possible to do this automatically?

Kind regards,

Dmitry

Here is an example:
***********************
public class WodenTest {

    @Test
    public void test() throws WSDLException {
WSDLFactory factory = WSDLFactory.newInstance(DOMWSDLFactory.class.getCanonicalName());

        DescriptionElement description = factory.newDescription();

        URI targetNamespace = URI.create("http://mynamespace";);

        description.setTargetNamespace(targetNamespace);
        description.addNamespace("tns", targetNamespace);
description.addNamespace("ns0", URI.create("http://must_know_this";));

InterfaceElement interfaceElement = description.addInterfaceElement();
        interfaceElement.setName(new NCName("myinterface"));

QName interfaceFaultName = new QName("http://mynamespace";, "myfault", "tns");

InterfaceFaultElement interfaceFaultElement = interfaceElement.addInterfaceFaultElement(); interfaceFaultElement.setName(new NCName(interfaceFaultName.getLocalPart()));

QName elementDeclaration = new QName("http://mytypes";, "myelement", "ns0"); interfaceFaultElement.setElement(new QNameTokenUnion(elementDeclaration));

InterfaceOperationElement interfaceOperationElement = interfaceElement.addInterfaceOperationElement();
        interfaceOperationElement.setName(new NCName("myoperation"));

InterfaceFaultReferenceElement interfaceFaultReferenceElement = interfaceOperationElement.addInterfaceFaultReferenceElement();
        interfaceFaultReferenceElement.setMessageLabel(new NCName("In"));

        interfaceFaultReferenceElement.setRef(interfaceFaultName);

        WSDLWriter writer = factory.newWSDLWriter();
        writer.writeWSDL(description, System.out);
    }
}
*************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to