Retrieve Item Info
Name | Type | Length | Description |
---|---|---|---|
itemTag | System.String | 13 | [Required] Unique Item Tag |
POST http://localhost/FusionServices/v3/Naviline/BarCode/ItemInfo
Name | Description |
---|---|
OUT_PIID1 | COMMODITY DESCRIPTION |
OUT_PIID2 | SUB COMMODITY DESCRIPTION |
OUT_PIUOMO | EA |
OUT_PIUOMI | EA |
OUT_PILOTS | 1 |
OUT_PIINVC | Y |
OUT_PIABC | A |
OUT_PIMNCD | XXX |
OUT_PIMPN | XX |
OUT_PIAICD | A |
OUT_PIIREF | CHRISTY REFERENCE |
OUT_PILOC1 | BI |
OUT_PILOC2 | N1 |
OUT_PILOC3 | |
OUT_PILOC4 | |
OUT_PILOC5 | |
OUT_PIABNL | ALTERNATE |
OUT_PIFRZN | |
OUT_PIMINQ | 50000.00 |
OUT_PIMAXQ | 100000.00 |
OUT_PIQOH | 6315.75 |
OUT_PIQTYA | 6300.00 |
OUT_PIQOO | 98511.00 |
OUT_PILOD | 04/15/2024 |
OUT_PILRD | 01/09/2024 |
OUT_PIDLI | |
OUT_ERCD | 0000 |
OUT_ERDS |
using System.Net;
using Newtonsoft.Json.Linq;
public void MethodName(parms)
{
string uri = "http://localhost/FusionServices/v3/Naviline/BarCode/ItemInfo";
System.Collections.Specialized.NameValueCollection postParms =
new System.Collections.Specialized.NameValueCollection();
// Set paramater values
postParms.Add("itemTag",System.Web.HttpUtility.UrlEncode("COCLOCLO00002"));
WebClient req = new WebClient();
wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
wc.Headers.Set("X-APPID", "YOURID");
wc.Headers.Set("X-APPKEY", "YOURKEY");
byte[] responseBytes = wc.UploadValues(new Uri(uri), "POST", postParms);
string stringResult = Encoding.UTF8.GetString(responseBytes);
JObject response = JObject.Parse(stringResult);
string error = response["OutputParms"]["ErrorCode"].ToString();
if (error == "0000")
{
// TODO - YOUR CODE HERE
}
}
using System;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Collections.Specialized;
using FusionServiceHelper.Models;
// NOTE: Use the namespace generated when you add the class, so that it is correct.
namespace FusionRazor.Models
{
public class RetrieveItemInfo
{
// Add property for each input param in order to map a field to it
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,13}$).*", ErrorMessage = "Must be 13 characters or less. ")]
public string itemTag{get; set;}
public RetrieveItemInfo()
{
//Set any defaults here
}
}
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the RetrieveItemInfo class. *@
@* NOTE: Select Edit as the Scaffold template. *@
@* NOTE: Use the @model line that is generated at the top. Replace the rest with the lines below.
@model FusionRazor.Models.RetrieveItemInfo
@{
ViewBag.Title = "RetrieveItemInfo";
}
<h2>RetrieveItemInfo</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>RetrieveItemInfo</legend>
<div class="editor-label">
@Html.LabelFor(model => model.itemTag)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.itemTag)
@Html.ValidationMessageFor(model => model.itemTag)
</div>
<p>
<input type="submit" value="Submit"/>
</p>
</fieldset>
}
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
using System;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FusionServiceHelper.Models;
// NOTE: Replace 'MyController' with the name of your controller.
//
// GET: /MyController/RetrieveItemInfo
public ActionResult RetrieveItemInfo()
{
// Create a new instance of the model to pick up any default values.
RetrieveItemInfo model = new RetrieveItemInfo();
// pass model to set to default values
// NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
return View("~/Views/MyFolderPath/RetrieveItemInfo.cshtml", model);
}
//
// POST: /MyController/RetrieveItemInfo
[HttpPost]
public ActionResult RetrieveItemInfo(FormCollection collection)
{
string url = "v3/Naviline/BarCode/ItemInfo";
// Get the value from each input field
NameValueCollection inputParms = new NameValueCollection();
inputParms.Add("itemTag", collection["itemTag"]);
try
{
// Send the request
FusionServiceRequest request = new FusionServiceRequest();
FusionServiceResult result = request.Post(url, inputParms);
return View("Result", result);
}
catch(Exception e)
{
HandleErrorInfo info = new HandleErrorInfo(e, "MyController", "RetrieveItemInfo");
return View("Error", info);
}
}