Send XML from bubble to API not possible?

Hi all bubblers!

I’m learning a lot here but are facing troubles to create an XML to send it out to an API.
Support told me that it is not possible, so I’m looking for someone that can help me with a solution for it ( maybe outside bubble?)

Documentation: Eurofins Labconnector

This is what I have in the API Connector:


This is the XML I need to send out:

> <?xml version="1.0"?>
> <EuroFins.Common.Schema.Order._16.OrderData>
>   <customerOrder>
>     <customerOrderCode>string</customerOrderCode>
>     <customerOrderName>string</customerOrderName>
>     <senderCode>string</senderCode>
>     <isAutoValidated>true</isAutoValidated>
>     <customerCode>string</customerCode>
>     <contractId>string</contractId>
>     <quotationCode>string</quotationCode>
>     <locale>string</locale>
>     <dateFormat>string</dateFormat>
>     <serviceId>string</serviceId>
>     <laboratoryCode>string</laboratoryCode>
>     <project>
>       <projectCode>string</projectCode>
>       <projectName>string</projectName>
>     </project>
>     <customerOrderBarcode>string</customerOrderBarcode>
>     <isWithShipment>true</isWithShipment>
>     <customerOrderComment>string</customerOrderComment>
>     <additionalElements>
>       <name>string</name>
>       <typeCode>string</typeCode>
>       <stringValue>string</stringValue>
>       <nativeValue>string</nativeValue>
>     </additionalElements>
>     <samples>
>       <sampleCode>string</sampleCode>
>       <sampleDescription>string</sampleDescription>
>       <sampleReference>string</sampleReference>
>       <sampleClassification>
>         <classificationSystem>string</classificationSystem>
>         <classificationCode>string</classificationCode>
>         <priorityLevel>1.1</priorityLevel>
>         <treeOfProductCode>string</treeOfProductCode>
>       </sampleClassification>
>       <priorityLevelCode>string</priorityLevelCode>
>       <quotationCode>string</quotationCode>
>       <sampleComment>string</sampleComment>
>       <analyses>
>         <quotationCode>string</quotationCode>
>         <package>
>           <isCustomer>true</isCustomer>
>           <isCustomerSpecified>true</isCustomerSpecified>
>           <packageCode>string</packageCode>
>           <subgroupCode>string</subgroupCode>
>           <testsDetails>string</testsDetails>
>         </package>
>         <test>
>           <testCode>string</testCode>
>           <subgroupCode>string</subgroupCode>
>           <quotationLineKey>string</quotationLineKey>
>         </test>
>         <fractionCode>string</fractionCode>
>         <customizedFractionName>string</customizedFractionName>
>         <parameters>
>           <parameterCode>string</parameterCode>
>           <testCode>string</testCode>
>           <estimatedValue>string</estimatedValue>
>           <estimatedUnit>string</estimatedUnit>
>         </parameters>
>       </analyses>
>       <deferredStartDate>1970-01-01T00:00:00.001Z</deferredStartDate>
>       <deferredStartDateSpecified>true</deferredStartDateSpecified>
>       <additionalElements>
>         <name>string</name>
>         <typeCode>string</typeCode>
>         <stringValue>string</stringValue>
>         <nativeValue>string</nativeValue>
>       </additionalElements>
>       <internalElements>
>         <importationCode>string</importationCode>
>         <internalSampleCode>string</internalSampleCode>
>         <limits>
>           <limitSqlId>1</limitSqlId>
>           <limitIncId>1</limitIncId>
>         </limits>
>         <samplePartnerCategorySqlId>1</samplePartnerCategorySqlId>
>         <samplePartnerCategoryIncId>1</samplePartnerCategoryIncId>
>         <numberOfContainers>1</numberOfContainers>
>         <organismSqlId>1</organismSqlId>
>         <organismIncId>1</organismIncId>
>         <analyticalServiceKey>string</analyticalServiceKey>
>         <purchasedSamplePriceWithoutTax>1.1</purchasedSamplePriceWithoutTax>
>         <customisedParameters>
>           <testCode>string</testCode>
>           <parameterCode>string</parameterCode>
>           <parameterName>string</parameterName>
>         </customisedParameters>
>         <customisedFractions>
>           <fractionCode>string</fractionCode>
>           <productEurodat5Code>string</productEurodat5Code>
>         </customisedFractions>
>       </internalElements>
>       <flasks>
>         <flaskBarcode>string</flaskBarcode>
>       </flasks>
>     </samples>
>   </customerOrder>
> </EuroFins.Common.Schema.Order._16.OrderData>

This is what I get after inizialize:

Is this possible one way or an other way??
Or do I stupid things…?:cry:

Thanks a lot for your advise!

1 Like

anyone??

Having the same issue. any help would be much appreciated.

it looks lik bubble can’t send out a full XML
The Json part (dynamic values) are not “translated” to XML as the laboratory informed me

Looking to do the same thing. Have you worked it out in the end?

@edtyli9

this is the reaction of Malcom Black (bubble)

Hello Marco,

Thanks for following up. When setting up the call, selecting XML as the “Data Type” tells Bubble that the external server will respond with XML. Bubble then attempts to convert the XML to JSON. Also, a raw XML body cannot be prepared for sending. Bubble has the capability to send JSON and form data.

From the Bubble manual: “Some APIs returns their response as XML. Often, this can be converted into a JSON object. If you are dealing with such an API, you can use XML and get data as a JSON object, and go through the flow described above. Note that not all XML responses can be converted as JSON”

If there is someone that can do the trick it would be nice…

I am with the same problema … need to creat a xml to use as a post on API !!!

Has anyone figured out a way to do this? I need to respond to an external server that calls a workflow end point with a bit of XML.

What if you create the xml, save into the database and send over via API?

I will try that.

Can you post it here if you found a way to send POST request in xml?

I guess it should be possible. The first screenshot of the topic have an important issue because the content type set in header is not for xml but for form url.
I’ve tested to a requestbin and everything worked fine.
The only thing is that you need to be sure that API will also respond using XML

3 Likes

Hi @Jici

Thanks a lot for your investigation!! much appreciated!

Sorry for the late reaction, I did not have the best time of my life the last 5 month…

I do not have “From URL” in the selection dropdown of Data Type


Can you please show me a screenshot what you mean?

Many Thanks

Check your Content-type Header. If you are sending an xml payload, you need to have the correct Content-type header. Check API Doc. It could be something like text/xml or application/xml

Hello everyone. The “Data type” at the beginning of the call is to specify what the response should be like. To specify that you are sending XML, you must specify the Content-type header as “text/xml”, and probably other parameters depending on the API. Most importantly in the body type, you must specify it as “raw”. Then just type the xml in the body.

1 Like