Written by

Integration Analyst at BPlus Tecnologia
Question Guilherme Koerber · Jul 19, 2023

Request content does not appear in the message viewer.

Hello community,

I am developing a call that contains some properties in an Ens.Request class like this:

Class Linx.Omni.Operation.Apigee.Fidelidade.Msg.ProcessaVendaReq Extends Ens.Request
{

Property Bandeira As%String(MAXLEN = "");Property CodigoLoja As%String(MAXLEN = "");Property CpfCliente As%String(MAXLEN = "");Property ListaItens As list Of Linx.Omni.VO.Origem.Fidelidade.ProcessaVendaFidelidadeNew;
Storage Default
{
...

I am creating a new request and calling it as follows (I removed some code snippets for better visualization):

Method ChamaProcessaVendaFidelidadeNew(pRequest As Linx.Omni.Process.Msg.ComponenteRegraReq, Output pStream) As%Status [ Private ]
{
	Set tStatus = $System.Status.OK()
	
	Try
	{		
            ...
			else
			{	
				Set tRequest = ##Class(Linx.Omni.Operation.Apigee.Fidelidade.Msg.ProcessaVendaReq).%New()				
				Set tRequest.Bandeira              = tParamBandeira.Valor
				Set tRequest.CodigoLoja            = tObjOrigem.CodigoLoja
				Set tRequest.CpfCliente            = tObjOrigem.CpfCliente
				
				Forx=1:1:tObjOrigem.ListaItens.Count()
				{
					Set tObjItem = ##Class(Linx.Omni.VO.Origem.Fidelidade.ProcessaVendaFidelidadeNew).%New()
					
					Set tObjItem.Codigo     = tObjOrigem.ListaItens.GetAt(x).Codigo
					Set tObjItem.Quantidade = tObjOrigem.ListaItens.GetAt(x).Quantidade
					Set tObjItem.Valor      = tObjOrigem.ListaItens.GetAt(x).Valor
					
					Set tStatus = tRequest.ListaItens.Insert(tObjItem)
				}
												
				If$System.Status.IsError(tStatus)
				{
					Throw
				}
				
				Set tStatus = ..SendRequestSync("Venda Fidelidade WS", tRequest, .tResponse)
				
                ...
			}
		}
		Set pStream = tObjProxy
	}
	Catch tException
	{
		#Dim tException As %
		If '$System.Status.IsError(tStatus)
		{ 
			Set tStatus = tException.AsStatus()
		}
	}

	Quit tStatus
}

 

The result in the administration portal is an empty content.

Here's an example of how it should be:

I have reviewed the code several times and couldn't identify what I might be doing wrong. On other occasions, I followed the same procedure and it worked. Can someone help me?

Product version: Ensemble 2018.1

Comments

Michael Davidovich · Jul 19, 2023

The only think I can think of is are you sure tParamBandeira.Valor, tObjOrigem.CodigoLoja, and tObjOrigem.CpfCliente have values?  Maybe set one to like $g(tObjOrigem.CpfCliente,"UNDEFINED") to test that theory?

EDIT: I forget you can't use $G on objects like that. 

s:tObjOrigem.CpfCliente="" tObjOrigem.CpfCliente="UNDEFINED"

0
Guilherme Koerber  Jul 20, 2023 to Michael Davidovich

Thank you for the comment, Michael! Even though all the properties are filled, I did it the way you mentioned, but it still didn't work. I also tried adding an initial expression, but the content still appears empty. The solution was to set the extended request class as %XML.Adaptor, but either way, I appreciate your help.

0
Neil Thaiss · Jul 20, 2023

Hi Guilherme,
You could try extending  %XML.Adaptor in your request class.
So:  Class Linx.Omni.Operation.Apigee.Fidelidade.Msg.ProcessaVendaReq Extends  (Ens.Request, %XML.Adaptor).
This has worked for me in the past.
If possible, I would extend %XML.Adaptor in Linx.Omni.VO.Origem.Fidelidade.ProcessaVendaFidelidadeNew, as well.
Neil

0
Guilherme Koerber  Jul 20, 2023 to Neil Thaiss

Great news!
I thought this extension was only for cases where the call was with XML/SOAP, but in my case, it's JSON/REST. However, using it this way, the properties appear as I wanted them to. Thank you very much for your help!

0
Eduard Lebedyuk · Jul 20, 2023

All object properties in a request or response object must extend %XML.Adaptor.

Lists and arrays of streams are skipped.

Private properties are skipped.

MultiDimensional properties are skipped. 

XMLIO = "IN" properties are skipped.

XMLPROJECTION = "NONE" properties are skipped.

0
Michael Davidovich  Jul 20, 2023 to Eduard Lebedyuk

I would like to know a little more about this.

I was just working on something where my business process put together a custom object based on a file from the record mapper.  The object is simply saved to the database so just to put a bow on it we send a request to a "FinishedOperation" business operation which doesn't do anything.  The request is sent async and the request object is the instance of the custom object was created/updated.  

This request object has a few properties that are object properties and one is XML enabled the other is not.  They both show up in the body of the message trace there's nothing in the content tab of the message trace.

How come they show up when they aren't XML enabled? What am I not understanding in terms of the difference between the body and the contents?

Thanks!

0
Eduard Lebedyuk  Jul 22, 2023 to Michael Davidovich

Body tab is unrelated to XML export, Contents tab is essentially XML export.

0