StringWriter writer = new StringWriter();
schema.write(writer);
writer.flush();
Document doc = domBuilder.parse(new ByteArrayInputStream(writer.toString().getBytes()));
Element documentElement = doc.getDocumentElement();
WSDLDescription womDescription;
WSDLComponentFactory wsdlComponentFactory = new WSDLDescriptionImpl();
womDescription = wsdlComponentFactory.createDescription();
HashMap namspaceMap = new HashMap();
namspaceMap.put("soap", "http://schemas.xmlsoap.org/wsdl/soap/");
namspaceMap.put(targetNamespecheprefix, targentNamespece);
namspaceMap.put("ns1", "http://org.apache.axis2/xsd");
namspaceMap.put("xs", "http://www.w3.org/2001/XMLSchema");
womDescription.setNamespaces(namspaceMap);
womDescription.setTargetNameSpace(targentNamespece);
//generating port type
WSDLInterface portType = generatePortType(womDescription, wsdlComponentFactory, documentElement);
womDescription.addInterface(portType);
QName bindingName = new QName(targentNamespece, serviceName + "Binding"
, targetNamespecheprefix);
//generating binding
WSDLBinding binding = generateBinding(wsdlComponentFactory,
portType,
bindingName,
"document", "literal", "http://schemas.xmlsoap.org/soap/http",
"http://www.org.apache.axis2");
womDescription.addBinding(binding);
//generating service
WSDLService service = generateService(wsdlComponentFactory, womDescription, binding, serviceName);
womDescription.addService(service);
return womDescription;
}