Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Posting and XML Document to a Website

    I have the XML Code and Web Address but do not know how you send it to the address (and then deal with the response) - can anyone help please ?


    Example order submission using XML
    In this example we will submit an order using only the mandatory fields. Our order number is 887653, thus we will POST our XML to https://portal.ipaccess.com.au/PostOrder/887653

    Code:
    <?xml version="1.0" encoding="UTF-8"?> 
    <request> 
    <clientId>ACRTest</clientId> 
    <clientKey>69ef190a160fb4706746e6c4961f2db2ef04bbccfbf28abb2750f962d7aba4f70fa16094113b25134ab54dc0 
    2bfb6de3194ca0ebb605030177e200a35243bec7</clientKey> 
    <parameters> 
    <sender>acrtestorder</sender> 
    <recipient>CW999</recipient> 
    <type>order01</type> 
    <order> 
    <header> 
    <customerOrderReference>887653</customerOrderReference> 
    <orderType>1</orderType> 
    <orderDate>06/11/2013</orderDate> 
    </header> 
    <parties> 
    <BY> 
    <type>BY</type> 
    <id>500500</id> 
    </BY> 
    </parties> 
    <lines> 
    <toSupplyItems> 
    <L1> 
    <lineNumber>1</lineNumber> 
    <id>10026</id> 
    <orderQuantity>3</orderQuantity> 
    </L1> 
    <L2> 
    <lineNumber>2</lineNumber> 
    <id>04001</id> 
    <orderQuantity>7</orderQuantity> 
    </L2> 
    </toSupplyItems> 
    <totalLineCount>2</totalLineCount> 
    <totalQuantityCount>10</totalQuantityCount> 
    </lines> 
    </order> 
    </parameters> 
    </request>
    XML Response. The order was successfully accepted by the portal and has returned a trace_id, this is what can be used to chase up the order with ACR if required.

    Code:
    <?xml version="1.0" encoding="UTF-8"?> 
    <response> 
    <Duration>561.47193908691</Duration> 
    <Data> 
    <trace_id>B6K9A834</trace_id> 
    </Data> 
    <Message></Message> 
    <Status>200</Status> 
    <SubStatus>0</SubStatus> 
    </response>

  • #2
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,387
    Thanks
    32
    Thanked 288 Times in 282 Posts
    Quote Originally Posted by George1111 View Post
    I have the XML Code and Web Address but do not know how you send it to the address (and then deal with the response) - can anyone help please ?
    You don't provide enough information. For example, what's the name of the post variable? The following code will allow submission with the right post variable. (The post variable below is represented by a question mark that needs to be changed to the real variable.)

    Code:
    <!doctype html>
    <html>
    	<head>
    		<meta charset="UTF-8">
    		<title>Demo</title>
    	</head>
    	<body>
    		<form method="post" action="https://portal.ipaccess.com.au/PostOrder/887653">
    			<input type="file" name="?"> <!-- XML -->
    			<button>Submit File</button>
    		</form>
    	</body>
    </html>
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #3
    New to the CF scene
    Join Date
    Feb 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The Post variable is the name of the XML Document which contains the XML content (Top bit) in the example I posted to the forum - is that right ?

    Eg, It could be called Order887653.xml

    Your suggested code looks nice and clear, but my confusion is - How do I read the response that the order arrived safely at the web address ? (Bottom bit of my post)

    Thank you for your interest

  • #4
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,387
    Thanks
    32
    Thanked 288 Times in 282 Posts
    Quote Originally Posted by George1111 View Post
    The Post variable is the name of the XML Document which contains the XML content (Top bit) in the example I posted to the forum - is that right ?

    Eg, It could be called Order887653.xml
    No, the post variable is the name of the variable used to pass the XML data to the receiving page and has nothing to do with the filename. The receiving page is https://portal.ipaccess.com.au/PostOrder/887653 and presumably uses some server-side language to recognize and process the XML data sent with said variable.

    Quote Originally Posted by George1111 View Post
    Your suggested code looks nice and clear, but my confusion is - How do I read the response that the order arrived safely at the web address ? (Bottom bit of my post)
    Have the receiving page output HTML instead of XML or process the XML and convert it to HTML? (Your question isn't entirely clear.)
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •