Web Services
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Web Services

  1. #1
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    1,853

    Web Services

    Not sure if I am better off doing this in VB.Net or VB6 - I would prefer VB6 but am open to guidance.

    I need to POST Orders using JSON or XML to a Web Portal
    I HAVE NO IDEA HOW THIS IS DONE - MY EXPERIENCE IS LIMITED TO FTP TRANSFERS (USING FTP TOOLS)


    The JSON EXAMPLE CODE SUPPLIED

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

    JSON Request

    Code:
    { "clientId":"ACRTest", "clientKey":"106ef642463167e03bc6cdf5d0f6ff930ede3b875949638335e1964f2e1127c3c614650df499be12bbf0a52b344cdd3d4c2a61798c0 5b5d29c5d0a8362d16532", 
    "parameters":{ 
         "sender":"acrtestorder",
         "recipient":"CW999",
         "type":"order01", 
         "order":{ 
              "header":{
                   "customerOrderReference":"887653",
                   "orderType":1,
                   "orderDate":"06\/11\/2013"
                }, 
                "parties": {
                    "BY": {
                    "type": "BY",
                    "id": "500500"
                   } 
                },
                 "lines":{
                 "toSupplyItems": {
                     "L1": {
                        "lineNumber": 1,
                        "id": "10026",
                        "orderQuantity": 3
                     },
                     "L2": {
                        "lineNumber": 2,
                        "id": "04001",
                        "orderQuantity": 7
                     }
                   },
                   "totalLineCount":2,
                   "totalQuantityCount":10 
                   }
                }
             }
          }
    JSON 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:
    {
         "Duration":627.70104408264,
         "Data":{
              "trace_id":"B4TQ4MM9"
         },
         "Message":"",
         "Status":200,
         "SubStatus":0 
    }


    The JSON responses received when the request was sent using the test modes are listed below.
    Shallow Test - Additional JSON included


    Code:
    "testType":"shallow",

    JSON Response



    Code:
    }
         "Duration":159.66892242432,
         "Data":null, 
         "Message":"Shallow test passed successfully.",
         "Status":200,
         "SubStatus":999
     }










    (Side Note - The new Forum Thread Management seems to be playing up on my machine - see attachment
    I have also finally found the "Submit New Thread" button by scrolling aross to the extreme right
    Searching a forum delivers an item every 15 or so lines, with the second column being 1 character wide )
    Attached Images Attached Images  

  2. #2
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,984

    Re: Web Services

    Download FIDDLER or use the tools in IE. It's easier to use, and see results.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center