HTTP Request

Post Reply
jRitt
Newbie
Posts: 5
Joined: Mon Dec 04, 2023 8:16 pm

HTTP Request

Post by jRitt »

Hi,

I am working on a flow to use the XSLT Transform element to transform XML coming from a POD Order Site, and pass the order information to our MIS.

I believe I need to use HTTP Request to pass the transformed XML file to our MIS server. I'm not exactly sure how to set that up.

Can anyone shed some light on the settings I should use within the HTTP Request element to take the XML file that comes from the XSLT Transform element and send it to a server address?

thanks so much
Josh
User avatar
magnussandstrom
Advanced member
Posts: 447
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: HTTP Request

Post by magnussandstrom »

Hi Josh, I'm guessing that your MIS is communicating by SOAP (since you are mentioning XML)?

Do you have any documentation from your MIS vendor?

In the flow below I'm using Curl to POST a SOAP-call to fetch order data from our MIS (PrintVis).

I have done this by installing Curl on my Switch server and using the app Run Command.

The Command in Run Command App:

Code: Select all

"C:\ProgramData\chocolatey\lib\curl\tools\curl-8.5.0_1-win64-mingw\bin\curl.exe" --ntlm --negotiate --user NAVservice:password --location --request POST "[Job.PrivateData:Key="pv_server"]" --header "SOAPAction: urn:microsoft-dynamics-schemas/codeunit/IntegrationV1:GetPrintVisOrder" --header "Content-Type: application/xml" --data-raw "<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:int='urn:microsoft-dynamics-schemas/codeunit/IntegrationV1' xmlns:int1='urn:microsoft-dynamics-nav/xmlports/IntegrationV1'><soapenv:Header/><soapenv:Body><int:GetPrintVisOrderInfo><int:inOrderNoFilter>[Metadata.Text:Path="/field-list/field[tag='Ordernummer']/value",Dataset="Submit",Model="XML"]</int:inOrderNoFilter><int:outOrders></int:outOrders></int:GetPrintVisOrderInfo></soapenv:Body></soapenv:Envelope>" --verbose
I guess that you could also do this with the HTTP request app, but when I built this flow I had som issues with the HTTP request app and found this work-a-round.
Last edited by magnussandstrom on Thu Dec 07, 2023 10:33 pm, edited 6 times in total.
jRitt
Newbie
Posts: 5
Joined: Mon Dec 04, 2023 8:16 pm

Re: HTTP Request

Post by jRitt »

Documentation is limited from our MIS. All I really have is a sample XML file that shows me how to name elements in the XML in order to properly flow in the corresponding fields in our MIS. Of course, the XML coming out of our Web2Print order sites, do not perfectly match how the MIS wants the XML so not everything flows correctly. Neither side (web2print site software, or MIS) have the capability for us to apply a style sheet to the XML, so I've written it myself and need to transform the XML before it gets to the MIS.

So overall my goal is:
- An order is placed on a Web2Print Order Site by one of our customers.
- XML is sent to a directory on our Switch Server which is picked up by the XSLT Tranform flow I'm creating.
- Transformed XML file is then sent to a server address provided by our MIS which creates a work order for us.

Does that make sense, or am I doing a poor job at explaining my situation?
User avatar
magnussandstrom
Advanced member
Posts: 447
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: HTTP Request

Post by magnussandstrom »

jRitt wrote: Thu Dec 07, 2023 3:50 pm ...sent to a server address provided by our MIS
I think I understand what you are trying to do.. What does this "server address" look like and what is the intended way of sending the XML?
jRitt
Newbie
Posts: 5
Joined: Mon Dec 04, 2023 8:16 pm

Re: HTTP Request

Post by jRitt »

server is like this: https://hh.ppath.com/Planweb/xmllistener.aspx

It was suggested to me that I could use HTTP Request to put or post the file there.

I'm not certain if that's the best or even possible solution for this, but I suppose the avenue I'm attempting first.
User avatar
magnussandstrom
Advanced member
Posts: 447
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: HTTP Request

Post by magnussandstrom »

Could you provide the name of the MIS and the example XML?
Last edited by magnussandstrom on Thu Dec 07, 2023 10:30 pm, edited 1 time in total.
jRitt
Newbie
Posts: 5
Joined: Mon Dec 04, 2023 8:16 pm

Re: HTTP Request

Post by jRitt »

Absolutely.

MIS is Printers Plan

Here is sample XML: https://printreach.com/printersplan/Pla ... mplate.xml
User avatar
magnussandstrom
Advanced member
Posts: 447
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: HTTP Request

Post by magnussandstrom »

Maybe you could try this:

In Attached file you choose Single-line text with variables: [Job.Path]

This way you will POST the XML-file by http as is.
Last edited by magnussandstrom on Tue Mar 26, 2024 3:14 pm, edited 1 time in total.
jRitt
Newbie
Posts: 5
Joined: Mon Dec 04, 2023 8:16 pm

Re: HTTP Request

Post by jRitt »

We're in business. I think I tried that before but was missing the brackets. thanks so much!
User avatar
magnussandstrom
Advanced member
Posts: 447
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: HTTP Request

Post by magnussandstrom »

Great, no problems!
Post Reply