How to generate an XML with envelope tags?

I have to generate an XML as below: <?xml version="1.0" encoding="UTF-16"?> <env:Envelope xmlns:env=""> <env:Body> <dis:Login xmlns:dis=""> <DatabaseName>1531</DatabaseName> <CompanyUsername>Username</CompanyUsername> <CompanyPassword>Password</CompanyPassword> </dis:Login> </env:Body> </env:Envelope> But I am not sure how to construct my .xsd file in order to generate all the proper tags? Is it even possible to generate an XML that looks like this? Edit: I need to send a string to a URL endpoint (REST). I guess it would be possible to just create string variables in a microflow and then build the string like that? Create Var1: <?xml version="1.0" encoding="UTF-16"?><env:Envelope xmlns:env=""><env:Body><dis:Login xmlns:dis=""><DatabaseName> Create var2: $Var1 + $DatabseName/Name Etc.? Seems like a workaround that should be doable, but i'm not sure if there are any other ways around it (provided that I have 0 java experience/knowledge which makes it hard to implement a Java action that would do the above for me)
1 answers

Hi Niels,

Here is a snippet to call soap from Java. Just a starting point... Watch the result processing, needs to be adapted to your situation.

            SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
            SOAPConnection soapConnection = soapConnectionFactory.createConnection();

            // Send SOAP Message to SOAP Server
            InputStream is = null;
            if (cacheType == CacheType.MEMORY) {
                is = new ByteArrayInputStream(this.request.getBytes());
            if (cacheType == CacheType.FILE) {
      "read from file");
                is = new FileInputStream(this.fileName);
            // copy original message into this.
            SOAPMessage soapMessage = MessageFactory.newInstance().createMessage(null, is);                 
            String url = YOURURL;
            splogger.trace("invoke url " + url);
            SOAPMessage soapResponse =, url);
            SOAPBody soapBody = soapResponse.getSOAPBody();
            NodeList faultList = soapBody.getElementsByTagName("faultcode");
            NodeList resultList = soapBody.getElementsByTagName("Result");
            // Result processing;
            Boolean resultValue = true;
            if (resultList.getLength() > 0) {
                Element value = (Element) resultList.item(0);
                if ((value.getTextContent() != null) && (value.getTextContent().equals("false"))) {
                    resultValue = false;