cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Post XML via HTTP dont work

Hello!

I seem to have a problem when I compose HTTP request with content that is in XML I get error:

 

 

 

 

<?xml version="1.0" encoding="utf-8" ?><nodes><status>-1</status><response></response><errormessage>Error 1872: The document has no document element. Line: -1;</errormessage></nodes>

 

 

 

Method is POST

Content is:

 

 

        <?xml version="1.0" encoding="UTF-8"?>
    <task>
       <!-- when udpating existing tasks: either externalId (task external id) or id (task id) property must be defined to select the task for update -->   
       <!-- task id is SeeMe system internal id and always auto generated when adding new tasks -->
       <!-- task external id can be set by third party when importing tasks (or left empty) -->      
      <externalId>xxxxxxx</externalId>
      <name>Väljasõidu akt- xxxxx Korter </name> <!-- Töö nimetus -->
      <timestamp>2020-05-20 14:42</timestamp> <!-- planeeritud kohalejõudmise aeg -->

      <type></type> <!-- töö tüüp-->
      <servicetime>15</servicetime> <!-- töö kestvus min -->

   <description>testing api task add and edit &#xA;  Nimi:  ['Nimi']} &#xA; Intsident: ['Intsident']} &#xA; Tüüp: ['Tüüp']} &#xA; Tsoon: ['Tsoon']}&#xA; Tsoonitekst: ['Tsoonitekst']}&#xA; Objektinr: ['Objektinr']}&#xA; Tänav: 'Tänav']} &#xA; Tänavanr: ['Tänavanr']}&#xA; Linn/vald: ['Linn/vald']}&#xA; Lepingunr: ['Lepingunr']}&#xA; Teenus: ['Teenus']}&#xA; ObjektiID: ['SiSite'] &#xA; </description> <!-- töö kirjeldus, vaba tekst, võib jätta tühjaks -->

      <driver></driver> <!-- Tööd teostava kasutaja kasutajanimi-->

      <customerId>xxxxx</customerId> <!-- Customer mooduli seose external id, kui on soovi seda kasutada-->

	<location>
	   <address>Tartu mnt 1, Tallinn</address> <!-- there is no point in sending location, if customer already has a location set -->
	</location>


      <forms>
        <form key="VSakt">
          <fields>
            <field key="Miratag">http://minu.xxx.xxx/#tasks_view?id=xxxxx</field>     
          </fields>
        </form>
      </forms>
</task>

 

 

 

 

 

With other system that we test with, it works, testing is done with:

 

 

 

 

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
  <label for="requestUrl">Request url: </label>
  <select id="requestUrl" name="requestUrl">
    <option value="https://app.ecofleet.com/seeme/Api/Tasks/addXml">https://app.ecofleet.com/seeme/Api/Tasks/addXml</option>
    <option value="https://app.ecofleet.com/seeme/Api/Tasks/updateAsXml">https://app.ecofleet.com/seeme/Api/Tasks/updateAsXml</option>
  </select>
  <p>
  <form id="requestData" name="requestData" method="POST" onsubmit="onSubmit()">
    key: <input type="text" value="" name="key"/>
    <p>
    API version: <input type="text" name="version" value="2"/>
    <p>
      XML:
    <p>
    <textarea rows="40" name="xml" style="width: 100%;">
    </textarea>
    <p>
    <input type="submit" value="Submit" />
  </form>
  <script type="text/javascript">
    function onSubmit() {
      document.requestData.action = document.getElementById('requestUrl').value;
      document.requestData.submit();
    }
  </script>
</body>

 

 

 

 

 
 
1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @Anonymous,

 

Currently, Flow only support parse XML by using Xpath() function:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#xpath

If you want Post XML via the HTTP action of Flow, this feature is not supported yet.

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-litu-msft
Community Support
Community Support

Hi @Anonymous,

 

Currently, Flow only support parse XML by using Xpath() function:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#xpath

If you want Post XML via the HTTP action of Flow, this feature is not supported yet.

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (3,062)