public Object run() throws WSDLException { return WSDLUtil.newWSDLReaderWithPopulatedExtensionRegistry(); } });
public static void main(String[] args) throws Exception { WSDL2Code.main(args); } }
private String mapMessage(SOAPHeaderMessage msg, Map complexTypeMap) { QName qname = msg.getElement(); if (qname == null) { throw new RuntimeException("No element reference in header"); } return mapQName(qname, complexTypeMap); }
protected List getParameterElementListForSOAPModules(Document doc, List parameters) { List parameterElementList = new ArrayList(); if ((parameters != null) && !parameters.isEmpty()) { int count = parameters.size(); for (int i = 0; i < count; i++) { Element param = doc.createElement("param"); SOAPModuleMessage soapModuleMessage = (SOAPModuleMessage) parameters.get(i); // header name is to set the header value addAttribute(doc, "uri", soapModuleMessage.getUri(), param); addAttribute(doc, "location", "wsoap_module", param); parameterElementList.add(param); } } return parameterElementList; }
/** * This will be called to configure the WSDLReader instance. */ public void configureReaderInstance(WSDLReader reader) throws WSDLException { // prevent the WSDLReader instance from using the System.out // stream for messages and logging reader.setFeature(com.ibm.wsdl.Constants.FEATURE_VERBOSE, false); WSDLFactory factory = WSDLFactory.newInstance(); ExtensionRegistry extRegistry = reader.getExtensionRegistry(); if (extRegistry == null) { extRegistry = factory.newPopulatedExtensionRegistry(); } WSDLUtil.registerDefaultExtensionAttributeTypes(extRegistry); reader.setExtensionRegistry(extRegistry); }
/** * Adds a soap module element to a given OMElement * @param omFactory - An OMFactory * @param list - The arraylist of soapModuleMessages * @param wsoap - The WSDL 2.0 SOAP namespace * @param element - The element that the header should be added to */ public static void addSOAPModuleElements(OMFactory omFactory, ArrayList list, OMNamespace wsoap, OMElement element) { for (int i = 0; i < list.size(); i++) { SOAPModuleMessage soapModuleMessage = (SOAPModuleMessage) list.get(i); OMElement soapModuleElement = omFactory.createOMElement(WSDL2Constants.ATTRIBUTE_MODULE, wsoap); soapModuleElement.addAttribute(omFactory.createOMAttribute( WSDL2Constants.ATTRIBUTE_REF, null, soapModuleMessage.getUri())); element.addChild(soapModuleElement); } }
/** * Convert woden dependent SOAPHeaderBlock objects to SOAPHeaderMessage objects * * @param soapModules - An array of SOAPModule objects * @return List<SOAPModuleMessage> - An List of SOAPHeaderMessage objects */ private List<SOAPModuleMessage> createSoapModules(SOAPModule soapModules[]) { if (soapModules.length == 0) { return null; } List<SOAPModuleMessage> soapModuleMessages = new ArrayList<SOAPModuleMessage>(); for (int i = 0; i < soapModules.length; i++) { SOAPModule soapModule = soapModules[i]; SOAPModuleMessage soapModuleMessage = new SOAPModuleMessage(); soapModuleMessage.setUri(soapModule.getRef().toString()); soapModuleMessages.add(soapModuleMessage); } return soapModuleMessages; }
public Object run() throws WSDLException { return WSDLUtil.newWSDLReaderWithPopulatedExtensionRegistry(); } });
private String mapMessage(SOAPHeaderMessage msg, Map complexTypeMap) { QName qname = msg.getElement(); if (qname == null) { throw new RuntimeException("No element reference in header"); } return mapQName(qname, complexTypeMap); }
/** * This will be called to configure the WSDLReader instance. */ public void configureReaderInstance(WSDLReader reader) throws WSDLException { // prevent the WSDLReader instance from using the System.out // stream for messages and logging reader.setFeature(com.ibm.wsdl.Constants.FEATURE_VERBOSE, false); WSDLFactory factory = WSDLFactory.newInstance(); ExtensionRegistry extRegistry = reader.getExtensionRegistry(); if (extRegistry == null) { extRegistry = factory.newPopulatedExtensionRegistry(); } WSDLUtil.registerDefaultExtensionAttributeTypes(extRegistry); reader.setExtensionRegistry(extRegistry); }
/** * Adds a soap module element to a given OMElement * @param omFactory - An OMFactory * @param list - The arraylist of soapModuleMessages * @param wsoap - The WSDL 2.0 SOAP namespace * @param element - The element that the header should be added to */ public static void addSOAPModuleElements(OMFactory omFactory, ArrayList list, OMNamespace wsoap, OMElement element) { for (int i = 0; i < list.size(); i++) { SOAPModuleMessage soapModuleMessage = (SOAPModuleMessage) list.get(i); OMElement soapModuleElement = omFactory.createOMElement(WSDL2Constants.ATTRIBUTE_MODULE, wsoap); soapModuleElement.addAttribute(omFactory.createOMAttribute( WSDL2Constants.ATTRIBUTE_REF, null, soapModuleMessage.getUri())); element.addChild(soapModuleElement); } }
/** * Convert woden dependent SOAPHeaderBlock objects to SOAPHeaderMessage objects * * @param soapModules - An array of SOAPModule objects * @return List<SOAPModuleMessage> - An List of SOAPHeaderMessage objects */ private List<SOAPModuleMessage> createSoapModules(SOAPModule soapModules[]) { if (soapModules.length == 0) { return null; } List<SOAPModuleMessage> soapModuleMessages = new ArrayList<SOAPModuleMessage>(); for (int i = 0; i < soapModules.length; i++) { SOAPModule soapModule = soapModules[i]; SOAPModuleMessage soapModuleMessage = new SOAPModuleMessage(); soapModuleMessage.setUri(soapModule.getRef().toString()); soapModuleMessages.add(soapModuleMessage); } return soapModuleMessages; }
public static void main(String[] args) throws Exception { String[] cargs = new String[args.length + 2]; System.arraycopy(args, 0, cargs, 0, args.length); System.setProperty("org.apache.adb.properties", "/org/apache/axis2/schema/c-schema-compile.properties"); cargs[args.length] = "-l"; cargs[args.length + 1] = "c"; WSDL2Code.main(cargs); } }
public Object run() throws WSDLException { return WSDLUtil.newWSDLReaderWithPopulatedExtensionRegistry(); } });
/** * Creates a new WSDLReader and configures it with a {@link WSDLFactory#newPopulatedExtensionRegistry()} if it does not specify an extension registry. * The method will register default extension attribute types in WSDLReader's {@link WSDLReader#getExtensionRegistry() extensionRegistry}, * see {@link #registerDefaultExtensionAttributeTypes(ExtensionRegistry)}. * * @return The newly created WSDLReader instance. * @throws WSDLException */ public static WSDLReader newWSDLReaderWithPopulatedExtensionRegistry() throws WSDLException { WSDLFactory wsdlFactory = WSDLFactory.newInstance(); WSDLReader reader = wsdlFactory.newWSDLReader(); ExtensionRegistry extensionRegistry = reader.getExtensionRegistry(); if (extensionRegistry == null) { extensionRegistry = wsdlFactory.newPopulatedExtensionRegistry(); } WSDLUtil.registerDefaultExtensionAttributeTypes(extensionRegistry); reader.setExtensionRegistry(extensionRegistry); return reader; } }
public Object run() throws WSDLException { return WSDLUtil.newWSDLReaderWithPopulatedExtensionRegistry(); } });
/** * Creates a new WSDLReader and configures it with a {@link WSDLFactory#newPopulatedExtensionRegistry()} if it does not specify an extension registry. * The method will register default extension attribute types in WSDLReader's {@link WSDLReader#getExtensionRegistry() extensionRegistry}, * see {@link #registerDefaultExtensionAttributeTypes(ExtensionRegistry)}. * * @return The newly created WSDLReader instance. * @throws WSDLException */ public static WSDLReader newWSDLReaderWithPopulatedExtensionRegistry() throws WSDLException { WSDLFactory wsdlFactory = WSDLFactory.newInstance(); WSDLReader reader = wsdlFactory.newWSDLReader(); ExtensionRegistry extensionRegistry = reader.getExtensionRegistry(); if (extensionRegistry == null) { extensionRegistry = wsdlFactory.newPopulatedExtensionRegistry(); } WSDLUtil.registerDefaultExtensionAttributeTypes(extensionRegistry); reader.setExtensionRegistry(extensionRegistry); return reader; } }
/** * Read the WSDL file * * @param uri * @throws WSDLException */ private Definition readInTheWSDLFile(final String uri) throws WSDLException { WSDLReader reader = WSDLUtil.newWSDLReaderWithPopulatedExtensionRegistry(); reader.setFeature("javax.wsdl.importDocuments", true); return reader.readWSDL(uri); } }
private void checkWSDLFile(){ if (txtWSDL.getText().equals("") ) { try{ WSDLReader reader = WSDLUtil.newWSDLReaderWithPopulatedExtensionRegistry(); reader.readWSDL(txtWSDL.getText().trim()) ; }catch(WSDLException e1) { txtWSDL.setText(""); JOptionPane.showMessageDialog(btnBrowse , "The file selected is not a valid WSDLfile", "Axis2 ServiceArchieve creation", JOptionPane.ERROR_MESSAGE); } } } private void browseWSDLFile(){
public void readWSDL() throws WSDLException { WSDLReader reader = WSDLUtil.newWSDLReaderWithPopulatedExtensionRegistry(); wsdlDefinition = reader.readWSDL(WSDLFileName) ; if (wsdlDefinition != null) { wsdlDefinition.setDocumentBaseURI(WSDLFileName); } }