[MSO-8] Update the maven dependency
[so.git] / bpmn / MSOCommonBPMN / src / main / groovy / org / openecomp / mso / bpmn / common / scripts / VidUtils.groovy
1 /*-
2  * ============LICENSE_START=======================================================
3  * OPENECOMP - MSO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.mso.bpmn.common.scripts
22
23 import groovy.json.JsonBuilder
24 import groovy.json.JsonSlurper
25
26 import org.json.JSONObject
27 import org.json.XML
28 import org.openecomp.mso.bpmn.core.xml.XmlTool
29
30 class VidUtils {
31         
32         public MsoUtils utils = new MsoUtils()
33         private AbstractServiceTaskProcessor taskProcessor
34
35         public VidUtils(AbstractServiceTaskProcessor taskProcessor) {
36                 this.taskProcessor = taskProcessor
37         }
38         
39         /**
40          * Create a volume-request XML using a JSON string
41          * @param jsonReq - JSON request from VID
42          * @param action
43          * @return
44          */
45         public String createXmlVolumeRequest(String jsonReq, String action, String serviceInstanceId) {
46                 def jsonSlurper = new JsonSlurper()
47                 try{
48                         Map reqMap = jsonSlurper.parseText(jsonReq)
49                         return createXmlVolumeRequest(reqMap, action, serviceInstanceId)
50                 }
51                 catch(Exception e) {
52                         throw e
53                 }
54         }
55
56         /**
57          * Create a volume-request XML using a map
58          * @param requestMap - map created from VID JSON
59          * @param action
60          * @param serviceInstanceId
61          * @return
62          */
63         public String createXmlVolumeRequest(Map requestMap, String action, String serviceInstanceId) {
64                 createXmlVolumeRequest(requestMap, action, serviceInstanceId, '')
65         }
66         
67
68         /**
69          * Create a volume-request XML using a map
70          * @param requestMap
71          * @param action
72          * @param serviceInstanceId
73          * @param volumeGroupId
74          * @return
75          */
76         public String createXmlVolumeRequest(Map requestMap, String action, String serviceInstanceId, String volumeGroupId) {
77                 def vnfType = ''
78                 def serviceName = ''
79                 def modelCustomizationName = ''
80                 def asdcServiceModelVersion = ''
81                 
82                 def suppressRollback = requestMap.requestDetails.requestInfo.suppressRollback
83                 
84                 def backoutOnFailure = ""
85                 if(suppressRollback != null){
86                         if ( suppressRollback == true) {
87                                 backoutOnFailure = "false"
88                         } else if ( suppressRollback == false) {
89                                 backoutOnFailure = "true"
90                         }
91                 }
92                 
93                 def volGrpName = requestMap.requestDetails.requestInfo?.instanceName ?: ''
94                 def serviceId = requestMap.requestDetails.requestParameters?.serviceId ?: ''
95                 def relatedInstanceList = requestMap.requestDetails.relatedInstanceList
96                 relatedInstanceList.each {
97                         if (it.relatedInstance.modelInfo?.modelType == 'service') {
98                                 serviceName = it.relatedInstance.modelInfo?.modelName
99                                 asdcServiceModelVersion = it.relatedInstance.modelInfo?.modelVersion
100                         }
101                         if (it.relatedInstance.modelInfo?.modelType == 'vnf') {
102                                 modelCustomizationName = it.relatedInstance.modelInfo?.modelCustomizationName
103                         }
104                 }
105                 
106                 vnfType = serviceName + '/' + modelCustomizationName
107                 
108                 def userParams = requestMap.requestDetails?.requestParameters?.userParams
109                 def userParamsNode = ''
110                 if(userParams != null) {
111                         userParamsNode = buildUserParams(userParams)
112                 }
113                 def modelCustomizationId = requestMap.requestDetails?.modelInfo?.modelCustomizationId ?: ''
114                 
115                 def xmlReq = """
116                 <volume-request xmlns="http://www.w3.org/2001/XMLSchema">
117                         <request-info>
118                                 <action>${action}</action>
119                                 <source>${requestMap.requestDetails.requestInfo.source}</source>
120                                 <service-instance-id>${serviceInstanceId}</service-instance-id>
121                         </request-info>
122                         <volume-inputs>
123                                 <volume-group-id>${volumeGroupId}</volume-group-id>
124                                 <volume-group-name>${volGrpName}</volume-group-name>
125                                 <vnf-type>${vnfType}</vnf-type>
126                                 <vf-module-model-name>${requestMap.requestDetails.modelInfo.modelName}</vf-module-model-name>
127                                 <asdc-service-model-version>${asdcServiceModelVersion}</asdc-service-model-version>
128                                 <aic-cloud-region>${requestMap.requestDetails.cloudConfiguration.lcpCloudRegionId}</aic-cloud-region>
129                                 <tenant-id>${requestMap.requestDetails.cloudConfiguration.tenantId}</tenant-id>
130                                 <service-id>${serviceId}</service-id>
131                                 <backout-on-failure>${backoutOnFailure}</backout-on-failure>
132                                 <model-customization-id>${modelCustomizationId}</model-customization-id>
133                         </volume-inputs>
134                         <volume-params>
135                                 $userParamsNode
136                         </volume-params>
137                 </volume-request>
138                 """
139                 // return a pretty-print of the volume-request xml without the preamble
140                 return groovy.xml.XmlUtil.serialize(xmlReq.normalize().replaceAll("\t", "").replaceAll("\n", "")).replaceAll("(<\\?[^<]*\\?>\\s*[\\r\\n]*)?", "") 
141         }
142         
143         /**
144          * A common method that can be used to build volume-params node from a map. 
145          * @param Map userParams
146          * @return
147          */
148         public String buildUserParams(userParams) {
149                 if (userParams == null) return ""
150                 def xml = ""
151                 def key = ""
152                 def value = ""
153                 userParams.each {it ->
154                         key = it.name.replaceAll(/\B[A-Z]/) { '_' + it }.toLowerCase()
155                         value = it.value
156                         xml += "<param name=\"${key}\">${value}</param>"
157                 }
158
159                 return xml
160         }
161
162         /**
163          * A common method that can be used to extract 'requestDetails' 
164          * @param String json
165          * @return String json requestDetails  
166          */
167         @Deprecated
168         public getJsonRequestDetails(String jsonInput) {
169                 String rtn = ""
170                 if (jsonInput.isEmpty() || jsonInput == null) {
171                         return rtn
172                 } else {
173                         def jsonMapObject = new JsonSlurper().parseText(jsonInput)
174                         if (jsonMapObject instanceof Map) {
175                                 String jsonString = new JsonBuilder(jsonMapObject.requestDetails)
176                                 rtn = '{'+"requestDetails"+":"+jsonString+'}'
177                                 return rtn
178                         } else {
179                             return rtn
180                         }       
181                 }
182         }
183         
184         /**
185          * A common method that can be used to extract 'requestDetails' in Xml
186          * @param String json
187          * @return String xml requestDetails
188          */
189         @Deprecated
190         public getJsonRequestDetailstoXml(String jsonInput) {
191                 String rtn = null
192                 def jsonString = getJsonRequestDetails(jsonInput)
193                 if (jsonString == null) {
194                         return rtn
195                 } else {
196                     JSONObject jsonObj = new JSONObject(jsonString)
197                         return XmlTool.normalize(XML.toString(jsonObj))
198                 }
199         }
200         
201         /**
202          * Create a network-request XML using a map
203          * @param execution 
204          * @param xmlRequestDetails - requestDetails in xml 
205          * @return
206          * Note: See latest version: createXmlNetworkRequestInstance()
207          */
208         public String createXmlNetworkRequestInfra(execution, def networkJsonIncoming) {
209         
210                 def requestId = execution.getVariable("requestId")
211                 def serviceInstanceId = execution.getVariable("serviceInstanceId")
212                 def requestAction = execution.getVariable("requestAction")
213                 def networkId = (execution.getVariable("networkId")) != null ? execution.getVariable("networkId") : ""
214                 
215                 def jsonSlurper = new JsonSlurper()
216                 try {
217                         Map reqMap = jsonSlurper.parseText(networkJsonIncoming)
218                         def instanceName =  reqMap.requestDetails.requestInfo.instanceName
219                         def modelName = reqMap.requestDetails.modelInfo.modelName
220                         def lcpCloudRegionId = reqMap.requestDetails.cloudConfiguration.lcpCloudRegionId
221                         def tenantId = reqMap.requestDetails.cloudConfiguration.tenantId
222                         def serviceId = reqMap.requestDetails.requestInfo.productFamilyId 
223                         def suppressRollback = reqMap.requestDetails.requestInfo.suppressRollback.toString()
224                         def backoutOnFailure = ""
225                         if(suppressRollback != null){
226                                 if (suppressRollback == true || suppressRollback == "true") {
227                                         backoutOnFailure = "false"
228                                 } else if (suppressRollback == false || suppressRollback == "false") {
229                                         backoutOnFailure = "true"
230                                 }
231                         }
232                 
233                         //def userParams = reqMap.requestDetails.requestParameters.userParams
234                         //def userParamsNode = buildUserParams(userParams)
235                         def userParams = reqMap.requestDetails?.requestParameters?.userParams
236                         def userParamsNode = ''
237                         if(userParams != null) {
238                                 userParamsNode = buildUserParams(userParams)
239                         }
240                         
241                         //'sdncVersion' = current, '1610' (non-RPC SDNC) or '1702' (RPC SDNC)
242                         def sdncVersion =  execution.getVariable("sdncVersion")
243                         
244                         def xmlReq = """
245                         <network-request xmlns="http://www.w3.org/2001/XMLSchema"> 
246                          <request-info> 
247                     <request-id>${requestId}</request-id>
248                                 <action>${requestAction}</action> 
249                                 <source>VID</source> 
250                                 <service-instance-id>${serviceInstanceId}</service-instance-id>
251                          </request-info> 
252                          <network-inputs> 
253                                 <network-id>${networkId}</network-id> 
254                                 <network-name>${instanceName}</network-name> 
255                                 <network-type>${modelName}</network-type>
256                                 <aic-cloud-region>${lcpCloudRegionId}</aic-cloud-region> 
257                                 <tenant-id>${tenantId}</tenant-id>
258                                 <service-id>${serviceId}</service-id> 
259                                 <backout-on-failure>${backoutOnFailure}</backout-on-failure>
260                 <sdncVersion>${sdncVersion}</sdncVersion>
261                          </network-inputs> 
262                          <network-params>
263                                 ${userParamsNode}
264                          </network-params> 
265                         </network-request>
266                         """
267                         // return a pretty-print of the volume-request xml without the preamble
268                         return groovy.xml.XmlUtil.serialize(xmlReq.normalize().replaceAll("\t", "").replaceAll("\n", "")).replaceAll("(<\\?[^<]*\\?>\\s*[\\r\\n]*)?", "")
269                         
270                 } catch(Exception e) {
271                         throw e
272                 }
273         }
274         
275         /**
276          * Create a network-request XML using a map, 
277          * @param execution 
278          * @return
279          */
280         public String createXmlNetworkRequestInstance(execution) {
281
282                 def networkModelVersionId = ""
283                 def networkModelName = ""
284                 def networkModelType = ""
285                 def networkModelVersion = ""
286                 def networkModelCustomizationId = ""
287                 def networkModelInvariantId = ""
288                 
289                 // verify the DB Catalog response JSON structure
290                 def networkModelInfo = execution.getVariable("networkModelInfo")
291                 def jsonSlurper = new JsonSlurper()
292                 if (networkModelInfo != null) {
293                         try {
294                                 Map modelMap = jsonSlurper.parseText(networkModelInfo)
295                                 if (modelMap != null) {
296                                         if (networkModelInfo.contains("modelVersionId")) {
297                                                 networkModelVersionId = modelMap.modelVersionId !=null ? modelMap.modelVersionId : ""
298                                         }
299                                         if (networkModelInfo.contains("modelName")) {
300                                                 networkModelName = modelMap.modelName !=null ? modelMap.modelName : ""
301                                         }
302                                         if (networkModelInfo.contains("modelType")) {
303                                                 networkModelType = modelMap.modelType !=null ? modelMap.modelType : ""
304                                         }
305                                         if (networkModelInfo.contains("modelVersion")) {
306                                                 networkModelVersion = modelMap.modelVersion !=null ? modelMap.modelVersion : ""
307                                         }
308                                         if (networkModelInfo.contains("modelCustomizationId")) {
309                                             networkModelCustomizationId = modelMap.modelCustomizationId !=null ? modelMap.modelCustomizationId : ""
310                                         }
311                                         if (networkModelInfo.contains("modelInvariantId")) {
312                                                 networkModelInvariantId = modelMap.modelInvariantId !=null ? modelMap.modelInvariantId : ""
313                                         }
314                                 }
315                         } catch (Exception ex) {
316                         throw ex
317                         }
318                 }               
319                 
320                 def serviceModelVersionId = ""
321                 def serviceModelName = ""
322                 def serviceModelType = ""
323                 def serviceModelVersion = ""
324                 def serviceModelCustomizationId = ""
325                 def serviceModelInvariantId = ""
326                 
327                 // verify the DB Catalog response JSON structure
328                 def serviceModelInfo = execution.getVariable("serviceModelInfo")
329                 def jsonServiceSlurper = new JsonSlurper()
330                 if (serviceModelInfo != null) {
331                         try {
332                                 Map modelMap = jsonServiceSlurper.parseText(serviceModelInfo)
333                                 if (modelMap != null) {
334                                         if (serviceModelInfo.contains("modelVersionId")) {
335                                                 serviceModelVersionId = modelMap.modelVersionId !=null ? modelMap.modelVersionId : ""
336                                         }
337                                         if (serviceModelInfo.contains("modelName")) {
338                                                 serviceModelName = modelMap.modelName !=null ? modelMap.modelName : ""
339                                         }
340                                         if (serviceModelInfo.contains("modelType")) {
341                                                 serviceModelType = modelMap.modelType !=null ? modelMap.modelType : ""
342                                         }
343                                         if (serviceModelInfo.contains("modelVersion")) {
344                                                 serviceModelVersion = modelMap.modelVersion !=null ? modelMap.modelVersion : ""
345                                         }
346                                         if (serviceModelInfo.contains("modelCustomizationId")) {
347                                                 serviceModelCustomizationId = modelMap.modelCustomizationId !=null ? modelMap.modelCustomizationId : ""
348                                         }
349                                         if (serviceModelInfo.contains("modelInvariantId")) {
350                                                 serviceModelInvariantId = modelMap.modelInvariantId !=null ? modelMap.modelInvariantId : ""
351                                         }
352                                 }
353                         } catch (Exception ex) {
354                                 throw ex
355                         }
356                 }
357                 
358                 
359                 def subscriptionServiceType = execution.getVariable("subscriptionServiceType") != null ? execution.getVariable("subscriptionServiceType") : ""
360                 def globalSubscriberId = execution.getVariable("globalSubscriberId") != null ? execution.getVariable("globalSubscriberId") : ""
361                 def requestId = execution.getVariable("msoRequestId")
362                 def serviceInstanceId = execution.getVariable("serviceInstanceId") != null ? execution.getVariable("serviceInstanceId") : ""
363                 def networkId = (execution.getVariable("networkId")) != null ? execution.getVariable("networkId") : "" // optional
364                 def networkName =  execution.getVariable("networkName") != null ? execution.getVariable("networkName") : "" // optional
365                 def aicCloudReqion = execution.getVariable("lcpCloudRegionId") != null ? execution.getVariable("lcpCloudRegionId") : ""
366                 def tenantId = execution.getVariable("tenantId") != null ? execution.getVariable("tenantId") : ""
367                 def serviceId = execution.getVariable("productFamilyId") != null ? execution.getVariable("productFamilyId") : ""
368                 def failIfExist = execution.getVariable("failIfExists") != null ? execution.getVariable("failIfExists") : ""
369                 def suppressRollback = execution.getVariable("disableRollback")   
370                 def backoutOnFailure = ""
371                 if(suppressRollback != null){
372                         if (suppressRollback == true || suppressRollback == "true") {
373                                 backoutOnFailure = "false"
374                         } else if (suppressRollback == false || suppressRollback == "'false") {
375                                 backoutOnFailure = "true"
376                         }
377                 }
378                 
379                 //'sdncVersion' = current, '1610' (non-RPC SDNC) or '1702' (RPC SDNC)
380                 def sdncVersion =  execution.getVariable("sdncVersion")
381                 
382                 def source = "VID"
383                 def action = execution.getVariable("action")
384                                 
385                 def userParamsNode = ""
386                 def userParams = execution.getVariable("networkInputParams")
387                 if(userParams != null) {
388                    userParamsNode = buildUserParams(userParams)
389                 }
390                 
391                 def xmlReq = """
392                 <network-request xmlns="http://www.w3.org/2001/XMLSchema"> 
393                  <request-info> 
394             <request-id>${requestId}</request-id>
395                         <action>${action}</action> 
396                         <source>${source}</source> 
397                         <service-instance-id>${serviceInstanceId}</service-instance-id>
398                  </request-info> 
399                  <network-inputs> 
400                         <network-id>${networkId}</network-id> 
401                         <network-name>${networkName}</network-name> 
402                         <network-type>${networkModelType}</network-type>
403                         <subscription-service-type>${subscriptionServiceType}</subscription-service-type>
404             <global-customer-id>${globalSubscriberId}</global-customer-id>
405                         <aic-cloud-region>${aicCloudReqion}</aic-cloud-region> 
406                         <tenant-id>${tenantId}</tenant-id>
407                         <service-id>${serviceId}</service-id> 
408                         <backout-on-failure>${backoutOnFailure}</backout-on-failure>
409                         <failIfExist>${failIfExist}</failIfExist>
410             <networkModelInfo>
411               <modelName>${networkModelName}</modelName>
412               <modelUuid>${networkModelVersionId}</modelUuid>
413               <modelInvariantUuid>${networkModelInvariantId}</modelInvariantUuid>            
414               <modelVersion>${networkModelVersion}</modelVersion>
415               <modelCustomizationUuid>${networkModelCustomizationId}</modelCustomizationUuid>
416               <modelType>${networkModelType}</modelType>              
417                     </networkModelInfo>
418             <serviceModelInfo>
419               <modelName>${serviceModelName}</modelName>
420               <modelUuid>${serviceModelVersionId}</modelUuid>
421               <modelInvariantUuid>${serviceModelInvariantId}</modelInvariantUuid>            
422               <modelVersion>${serviceModelVersion}</modelVersion>
423               <modelCustomizationUuid>${serviceModelCustomizationId}</modelCustomizationUuid>
424               <modelType>${serviceModelType}</modelType>              
425                     </serviceModelInfo>                                                                                                 
426             <sdncVersion>${sdncVersion}</sdncVersion>                    
427                  </network-inputs>
428                  <network-params>
429                         ${userParamsNode}
430                  </network-params> 
431                 </network-request>
432                 """
433                 // return a pretty-print of the volume-request xml without the preamble
434                 return groovy.xml.XmlUtil.serialize(xmlReq.normalize().replaceAll("\t", "").replaceAll("\n", "")).replaceAll("(<\\?[^<]*\\?>\\s*[\\r\\n]*)?", "")
435                         
436         }
437         
438         /**
439          * Create a vnf-request XML using a map
440          * @param requestMap - map created from VID JSON 
441          * @param action
442          * @return
443          */
444         public String createXmlVfModuleRequest(execution, Map requestMap, String action, String serviceInstanceId) {
445                                 
446                 //def relatedInstanceList = requestMap.requestDetails.relatedInstanceList
447                 
448                 //relatedInstanceList.each {
449                 //      if (it.relatedInstance.modelInfo.modelType == 'vnf') {
450                 //              vnfType = it.relatedInstance.modelInfo.modelName
451                 //              vnfId = it.relatedInstance.modelInfo.modelInvariantId
452                 //      }
453                 //}
454                 
455                 def vnfName = ''
456                 def asdcServiceModelInfo = ''
457                                 
458                 def relatedInstanceList = requestMap.requestDetails?.relatedInstanceList
459                 
460                 
461                 if (relatedInstanceList != null) {
462                         relatedInstanceList.each {
463                                 if (it.relatedInstance.modelInfo?.modelType == 'service') {
464                                         asdcServiceModelInfo = it.relatedInstance.modelInfo?.modelVersion
465                                 }
466                                 if (it.relatedInstance.modelInfo.modelType == 'vnf') {
467                                         vnfName = it.relatedInstance.instanceName ?: ''
468                                 }
469                         }
470                 }
471                 
472                 def vnfType = execution.getVariable('vnfType')
473                 def vnfId = execution.getVariable('vnfId')
474
475                 def vfModuleId = execution.getVariable('vfModuleId')
476                 def volumeGroupId = execution.getVariable('volumeGroupId')
477                 def userParams = requestMap.requestDetails?.requestParameters?.userParams
478                 
479                 
480                 def userParamsNode = ''
481                 if(userParams != null) {
482                         userParamsNode = buildUserParams(userParams)
483                 }
484                 
485                 def isBaseVfModule = "false"
486                 if (execution.getVariable('isBaseVfModule') == true) {
487                         isBaseVfModule = "true"         
488                 }
489                 
490                 def requestId = execution.getVariable("mso-request-id")         
491                 def vfModuleName = requestMap.requestDetails?.requestInfo?.instanceName ?: ''
492                 def vfModuleModelName = requestMap.requestDetails?.modelInfo?.modelName ?: ''
493                 def suppressRollback = requestMap.requestDetails?.requestInfo?.suppressRollback
494                 
495                 def backoutOnFailure = ""
496                 if(suppressRollback != null){
497                         if ( suppressRollback == true) {
498                                 backoutOnFailure = "false"
499                         } else if ( suppressRollback == false) {
500                                 backoutOnFailure = "true"
501                         }
502                 }
503                 
504                 def serviceId = requestMap.requestDetails?.requestParameters?.serviceId ?: ''
505                 def aicCloudRegion = requestMap.requestDetails?.cloudConfiguration?.lcpCloudRegionId ?: ''
506                 def tenantId = requestMap.requestDetails?.cloudConfiguration?.tenantId ?: ''
507                 def personaModelId = requestMap.requestDetails?.modelInfo?.modelInvariantId ?: ''
508                 def personaModelVersion = requestMap.requestDetails?.modelInfo?.modelVersion ?: ''
509                 def modelCustomizationId = requestMap.requestDetails?.modelInfo?.modelCustomizationId ?: ''
510                 
511                 def xmlReq = """
512                 <vnf-request>
513                         <request-info>
514                                 <request-id>${requestId}</request-id>
515                                 <action>${action}</action>
516                                 <source>VID</source>
517                                 <!-- new 1610 field -->
518                                 <service-instance-id>${serviceInstanceId}</service-instance-id>
519                         </request-info>
520                         <vnf-inputs>
521                                 <!-- not in use in 1610 -->
522                                 <vnf-name>${vnfName}</vnf-name>                                 
523                                 <vnf-type>${vnfType}</vnf-type>
524                                 <vnf-id>${vnfId}</vnf-id>
525                                 <volume-group-id>${volumeGroupId}</volume-group-id>
526                                 <vf-module-id>${vfModuleId}</vf-module-id>
527                                 <vf-module-name>${vfModuleName}</vf-module-name>                                
528                                 <vf-module-model-name>${vfModuleModelName}</vf-module-model-name>
529                                 <model-customization-id>${modelCustomizationId}</model-customization-id>
530                                 <is-base-vf-module>${isBaseVfModule}</is-base-vf-module>
531                                 <asdc-service-model-version>${asdcServiceModelInfo}</asdc-service-model-version>
532                                 <aic-cloud-region>${aicCloudRegion}</aic-cloud-region>                          
533                                 <tenant-id>${tenantId}</tenant-id>
534                                 <service-id>${serviceId}</service-id>
535                                 <backout-on-failure>${backoutOnFailure}</backout-on-failure>
536                                 <persona-model-id>${personaModelId}</persona-model-id>
537                                 <persona-model-version>${personaModelVersion}</persona-model-version>
538                         </vnf-inputs>
539                         <vnf-params>
540                                 $userParamsNode
541                         </vnf-params>
542                 </vnf-request>
543                 """
544         
545                 // return a pretty-print of the volume-request xml without the preamble
546                 return groovy.xml.XmlUtil.serialize(xmlReq.normalize().replaceAll("\t", "").replaceAll("\n", "")).replaceAll("(<\\?[^<]*\\?>\\s*[\\r\\n]*)?", "") 
547         }
548         
549
550 }