Add parameter "name" inside "Content-Type" header when we send a MTOM attachment using a SOAP request
Hello,
first of all thanks for your time reading this question, and thanks for your time:
We are expected to send a file as an attachment in a SOAP request using MTOM protocol.
It is expected to include a "name" parameter inside the "Content-Type" header, as we show below:
Currently, we have developed a SOAP Operation which sends the files using MTOM protocol, however it is not including the parameter "name" inside "Content-Type" header, as you would observe:
How could we adapt it to send the parameter "name"?
Could you provide us some example or documentation?
We have read:
https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...
https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...
https://docs.intersystems.com/irisforhealthlatest/csp/docbook/DocBook.UI...
What steps would you follow to develop this feature?
What is the documentation or examples we could read to achieve this?
➡️ Thanks for your time, and thanks for answering this question
EDIT: Currently our Web Client is as follows:
Class WSCLIENTE.HistoriaClinica.FicheroVacuServiceSOAP Extends %SOAP.WebClient [ ProcedureBlock ]
{
/// This is the namespace used by the Service
Parameter NAMESPACE = "http://[namespace]";
/// 20/09/21 Cambiamos a 0, con el objetivo de quitar el xsi:type
Parameter OUTPUTTYPEATTRIBUTE = 0;
/// Determines handling of Security header.
Parameter SECURITYIN = "ALLOW";
/// This is the name of the Service
Parameter SERVICENAME = "FicheroVacuService";
Parameter SOAPVERSION = 1.1;
/// This is the SOAP version supported by the service.
Parameter MTOMREQUIRED = 1;
Method cargarFichero(fichero As %GlobalBinaryStream, ccaaId As EsquemasDatos.HistoriaClinica.tns.CCAAIdType(REQUIRED=1), tipoFichero As EsquemasDatos.HistoriaClinica.tns.TipoFicheroType(REQUIRED=1)) As EsquemasDatos.HistoriaClinica.tns.InfoFicheroType(XMLNAME="responseFichero") [ Final, ProcedureBlock = 1, SoapBindingStyle = document, SoapBodyUse = literal, WebMethod ]
{
//Header - Addresing
set addressing = ..crearAddressing()
set addressing.Action = "cargarFichero"
set ..AddressingOut = addressing
set ..AddressingOut.mustUnderstand = "1"
set ..MTOMRequired=1
Quit ..WebMethod("cargarFichero","CargarFicheroVacuRequest").Invoke($this,"[endpoint]/cargarFichero",.fichero,.ccaaId,.tipoFichero)
}
Method crearAddressing() As %SOAP.Addressing.Properties
{
set IPRedSanitaria = ##class(Util.TablasMaestras).getValorMaestra("PARAMETROS","IPRedSanitaria")
set puertoRespuestas = ##class(Util.TablasMaestras).getValorMaestra("PARAMETROS","PuertoRespuestasSSL")
set ReplyTo = ##class(%SOAP.Addressing.EndpointReference).%New()
set ReplyTo.Address = "http://www.w3.org/2005/08/addressing/anonymous"
//set ReplyTo.Address = "https://"_IPRedSanitaria_":"_puertoRespuestas_"/csp/SNS/Servicios.ProgramasAsistenciales.SIFCOv02r00.cls"
set MessageId = ##class(Util.FuncionesComunes).getUID()
set addressing = ##class(%SOAP.Addressing.Properties).%New()
set addressing.MessageId = MessageId
set addressing.Destination = ..Location
set addressing.ReplyEndpoint = ReplyTo
Quit addressing
}
}