1

I am trying to send a XML path in a httprequest. I try in different ways and none works. My last try was:

&Httpclient.Addheader("Content-Type", !"multipart/form-data")
&httpclient.AddVariable('idEmpresa', '123')
&httpclient.AddVariable('senha','abcdfg')
&HttpClient.AddFile('file','.\dadosConciliadora_27-01-2023_09h24m09s697ms.xml')
&HttpClient.Execute(httpmethod.Post, &url)

The message is always "Object reference not set to an instance of an object." Application is based in Java.

I trying send a XML file to a API.

  • AddFile method has FullPath and FileName parameters (https://wiki.genexus.com/commwiki/servlet/wiki?7046,AddFile+method). I think you have them reversed (name, path). Anyway you could include more information about the error: it's an error when specifying the object within the IDE (Genexus Log could be useful) or it's a runtime error (Java log could be useful) – Guscarr Feb 01 '23 at 12:32
  • I change de parameters and works, Thank you! – Lucas Fraga Feb 02 '23 at 15:00

1 Answers1

1

&HttpClient.AddFile('.\dadosConciliadora_27-01-2023_09h24m09s697ms.xml','file')

This resolve the problem.