ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry <redmi...@list.ru>
Subject [WODEN-65] refloated
Date Tue, 15 May 2012 18:18:02 GMT
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: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org


Mime
View raw message