User bio
404 bio not found
Member since Nov 10, 2023
Replies:

We have tried to solve this issue ourselves as follows:

We have changed the method's output parameter, from an Ens.Response to an %XML.String(MAXLEN=""):

Before:

Method ProcesarPeticion(MSH As hl7.MSH.CONTENT, NTE As hl7.NTE.CONTENT, ORMO01PATIENT As hl7.ORMO01.PATIENT.CONTENT(XMLNAME="ORM_O01.PATIENT"), ORMO01ORDER As hl7.ORMO01.ORDER.CONTENT(XMLNAME="ORM_O01.ORDER"), SFT As hl7.SFT.CONTENT, MSA As hl7.MSA.CONTENT, ERR As hl7.ERR.CONTENT) As Mensajes.Response.Peticiones.Derivaciones.EnvioPeticiones.operacionResponse [ Final, ProcedureBlock = 1, SoapAction = "http://FUERTEVENTURA.Servicios/Asentimientos/ProcesarACK", SoapBindingStyle = document, SoapBodyUse = literal, SoapMessageName = ACK, SoapRequestMessage = ORM_O01, WebMethod ]

After:

Method ProcesarPeticion(MSH As hl7.MSH.CONTENT, NTE As hl7.NTE.CONTENT, ORMO01PATIENT As hl7.ORMO01.PATIENT.CONTENT(XMLNAME="ORM_O01.PATIENT"), ORMO01ORDER As hl7.ORMO01.ORDER.CONTENT(XMLNAME="ORM_O01.ORDER"), SFT As hl7.SFT.CONTENT, MSA As hl7.MSA.CONTENT, ERR As hl7.ERR.CONTENT) As %XML.String(MAXLEN="") [ Final, ProcedureBlock = 1, SoapAction = "http://FUERTEVENTURA.Servicios/Asentimientos/ProcesarACK", SoapBindingStyle = document, SoapBodyUse = literal, SoapMessageName = ACK, SoapRequestMessage = ORM_O01, WebMethod ]

In addition we have converted the Ens.Response Message to XML with the following code:

;30/01/2024 convertir a XML para quitar las etiquetas SOAP sobrantes:
set writer=##class(%XML.Writer).%New()
set status=writer.OutputToString()
If $$$ISERR(status) Do $system.OBJ.DisplayError(status)
set status=writer.RootObject(response)
If $$$ISERR(status) Do $system.OBJ.DisplayError(status) set pResponse = writer.GetXMLString()
$$$LOGALERT("pResponse: "_pResponse) ;set inicioCabeceras = "<?xml version=""1.0"" encoding=""UTF-8""?><ACK xmlns=""urn:hl7-org:v2xml"">"
;$$$LOGINFO("inicioCabeceras: "_inicioCabeceras)
set sinInicio = $PIECE(pResponse,"<operacionResponse>",2)
$$$LOGINFO("sinInicio: "_sinInicio)
set sinInicioFinal = $PIECE(sinInicio,"</operacionResponse>",1)
$$$LOGINFO("sinInicioFinal: "_sinInicioFinal)
set finalCabeceras = "</ACK>"
$$$LOGINFO("finalCabeceras: "_finalCabeceras)
;set mensajeACKcompleto = inicioCabeceras_sinInicioFinal_finalCabeceras
set mensajeACKcompleto = sinInicioFinal
$$$LOGINFO("mensajeACKcompleto: "_mensajeACKcompleto) ;quit response
quit mensajeACKcompleto
 

Being the Service's full code as we show:

Class Servicios.Peticiones.Derivaciones.Gestionv01r00 Extends EnsLib.SOAP.Service [ ClassType = "", Inheritance = right, ProcedureBlock ]
{

Parameter ADAPTER = "EnsLib.SOAP.InboundAdapter";

/// Nombre del WebService.
Parameter SERVICENAME = "Gestion";

/// Namespace SOAP para el Servicio Web
Parameter NAMESPACE = "urn:hl7-org:v2xml";

/// Se utilizarán namespaces de clases referenciadas en WSDL.
Parameter USECLASSNAMESPACES = 1;

Method ProcesarPeticion(MSH As hl7.MSH.CONTENT, NTE As hl7.NTE.CONTENT, ORMO01PATIENT As hl7.ORMO01.PATIENT.CONTENT(XMLNAME="ORM_O01.PATIENT"), ORMO01ORDER As hl7.ORMO01.ORDER.CONTENT(XMLNAME="ORM_O01.ORDER"), SFT As hl7.SFT.CONTENT, MSA As hl7.MSA.CONTENT, ERR As hl7.ERR.CONTENT) As %XML.String(MAXLEN="") [ Final, ProcedureBlock = 1, SoapAction = "http://FUERTEVENTURA.Servicios/Asentimientos/ProcesarACK", SoapBindingStyle = document, SoapBodyUse = literal, SoapMessageName = ACK, SoapRequestMessage = ORM_O01, WebMethod ]
{
	set request = ##class(Mensajes.Request.Peticiones.Derivaciones.EnvioPeticiones.operacionRequest).%New()
	set request.MSH = MSH
	do request.NTE.Insert(NTE)
	set request.ORMO01PATIENT = ORMO01PATIENT
	do request.ORMO01ORDER.Insert(ORMO01ORDER)
	
	set tSC = ..SendRequestSync("EnrutadorGestionDerivaciones",request,.response)
	
	;30/01/2024 convertir a XML para quitar las etiquetas SOAP sobrantes:
	set writer=##class(%XML.Writer).%New()
	set status=writer.OutputToString()
	If $$$ISERR(status)

	Do $system.OBJ.DisplayError(status)
	set status=writer.RootObject(response)
	If $$$ISERR(status) Do $system.OBJ.DisplayError(status)

	set pResponse = writer.GetXMLString()
	$$$LOGALERT("pResponse: "_pResponse)
	
	;set inicioCabeceras = "<?xml version=""1.0"" encoding=""UTF-8""?><ACK xmlns=""urn:hl7-org:v2xml"">"
	;$$$LOGINFO("inicioCabeceras: "_inicioCabeceras)
	set sinInicio = $PIECE(pResponse,"<operacionResponse>",2)
	$$$LOGINFO("sinInicio: "_sinInicio)
	set sinInicioFinal = $PIECE(sinInicio,"</operacionResponse>",1)
	$$$LOGINFO("sinInicioFinal: "_sinInicioFinal)
	set finalCabeceras = "</ACK>"
	$$$LOGINFO("finalCabeceras: "_finalCabeceras)
	;set mensajeACKcompleto = inicioCabeceras_sinInicioFinal_finalCabeceras
	set mensajeACKcompleto = sinInicioFinal
	$$$LOGINFO("mensajeACKcompleto: "_mensajeACKcompleto)
	
	;quit response
	quit mensajeACKcompleto
}

Method OnProcessInput(pInput As EnsLib.HL7.Message) As %Status
{
   Quit ..SendRequestAsync("EnrutadorGestionDerivaciones",pInput)
}

}

When we execute it, the $$$LOGINFO("mensajeACKcompleto: "_mensajeACKcompleto) does outputs the desired output:

<MSH xmlns:s01="urn:hl7-org:v2xml">
	<s01:MSH.1>|</s01:MSH.1>
	<s01:MSH.2>
		<![CDATA[^~\&]]>
	</s01:MSH.2>
	<s01:MSH.3>
		<s01:HD.1>sistemaExterno</s01:HD.1>
	</s01:MSH.3>
	<s01:MSH.4>
		<s01:HD.1>scs</s01:HD.1>
		<s01:HD.2>350290</s01:HD.2>
	</s01:MSH.4>
	<s01:MSH.5>
		<s01:HD.1>HGF</s01:HD.1>
	</s01:MSH.5>
	<s01:MSH.6>
		<s01:HD.1>EXTHL7</s01:HD.1>
	</s01:MSH.6>
	<s01:MSH.7>
		<s01:TS.1>20240130110908</s01:TS.1>
	</s01:MSH.7>
	<s01:MSH.9>
		<s01:MSG.1>ACK</s01:MSG.1>
	</s01:MSH.9>
	<s01:MSH.10>70589905</s01:MSH.10>
	<s01:MSH.11>
		<s01:PT.1>P</s01:PT.1>
	</s01:MSH.11>
	<s01:MSH.12>
		<s01:VID.1>2.5</s01:VID.1>
	</s01:MSH.12>
	<s01:MSH.13>1</s01:MSH.13>
	<s01:MSH.15>AL</s01:MSH.15>
	<s01:MSH.16>AL</s01:MSH.16>
	<s01:MSH.18>ASCII</s01:MSH.18>
</MSH>
<MSA xmlns:s01="urn:hl7-org:v2xml">
	<s01:MSA.1>AA</s01:MSA.1>
</MSA>

However, when we see the response being replied by the SOAP Service to the SoapUI it shows the extra XML tag "<ProcesarPeticionResult>":

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://www.w3.org/2001/XMLSchema">
	<SOAP-ENV:Body>
		<ACK xmlns="urn:hl7-org:v2xml">
			<ProcesarPeticionResult>
				<MSH xmlns:s01="urn:hl7-org:v2xml">
					<s01:MSH.1>|</s01:MSH.1>
					<s01:MSH.2>^~\&amp;</s01:MSH.2>
					<s01:MSH.3>
						<s01:HD.1>sistemaExterno</s01:HD.1>
					</s01:MSH.3>
					<s01:MSH.4>
						<s01:HD.1>scs</s01:HD.1>
						<s01:HD.2>350290</s01:HD.2>
					</s01:MSH.4>
					<s01:MSH.5>
						<s01:HD.1>HGF</s01:HD.1>
					</s01:MSH.5>
					<s01:MSH.6>
						<s01:HD.1>EXTHL7</s01:HD.1>
					</s01:MSH.6>
					<s01:MSH.7>
						<s01:TS.1>20240130110908</s01:TS.1>
					</s01:MSH.7>
					<s01:MSH.9>
						<s01:MSG.1>ACK</s01:MSG.1>
					</s01:MSH.9>
					<s01:MSH.10>70589905</s01:MSH.10>
					<s01:MSH.11>
						<s01:PT.1>P</s01:PT.1>
					</s01:MSH.11>
					<s01:MSH.12>
						<s01:VID.1>2.5</s01:VID.1>
					</s01:MSH.12>
					<s01:MSH.13>1</s01:MSH.13>
					<s01:MSH.15>AL</s01:MSH.15>
					<s01:MSH.16>AL</s01:MSH.16>
					<s01:MSH.18>ASCII</s01:MSH.18>
				</MSH>
				<MSA xmlns:s01="urn:hl7-org:v2xml">
					<s01:MSA.1>AA</s01:MSA.1>
				</MSA>
			</ProcesarPeticionResult>
		</ACK>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

How could we achieve to remove the undesired "<ProcesarPeticionResult>" XML tag?

Thanks for your time.

Thanks for your help.

Thanks for your replies.

Could you please, help us? By pointing some documentation or linking to some example to address this need?

Thanks for your answers.

Certifications & Credly badges:
Yone Moreno has no Certifications & Credly badges yet.
Global Masters badges:
Yone Moreno has no Global Masters badges yet.
Followers:
Yone Moreno has no followers yet.
Following:
Yone Moreno has not followed anybody yet.