using System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
namespace
TestWebService3
{
class Program
{
private
const string
Username = "username";
private
const string
Password = "password";
static private dclcorp.DCLWebService myService = new dclcorp.DCLWebService();
static private string
SessionID = "";
//
-------------------------------------
static void
{
if
(string.IsNullOrEmpty(Username) || string.IsNullOrEmpty(Password))
{
Console.WriteLine("Please set Username and Password");
return;
}
SessionID = myService.Login(Username,
Password);
if
(string.IsNullOrEmpty(SessionID))
{
Console.WriteLine("Wrong Username/Password");
return;
}
return;//
dclcorp.RMAType01Result RMAResult =
new dclcorp.RMAType01Result();
dclcorp.RMAType01Object RMA = new dclcorp.RMAType01Object();
// Set
basic RMA values
RMA.Comments = "My RMA Comments";
RMA.ShippingCarrier = "UPS";
RMA.ShippingService = "GROUND SERVICE RESIDENTIAL";
RMA.RMANumber = "TEST-123"; //
Auto-generate when empty
RMA.RMAType =
dclcorp.RMATypeObject.T01;
// Add
shipping address
RMA.ShipTo = new dclcorp.AddressType01Object();
RMA.ShipTo.Attention = "Walter";
RMA.ShipTo.Email = "XXX@XXXXX.com";
RMA.ShipTo.Address1 = "
RMA.ShipTo.City = "
RMA.ShipTo.StateProvince = "CA";
RMA.ShipTo.Country = "
RMA.ShipTo.PostalCode = "94538";
// In
this sample we add just one detail to the order
RMA.DetailArray = new dclcorp.DetailType02Object[1];
for
(int i = 0; i < RMA.DetailArray.Length; i++)
{
RMA.DetailArray[i] = new dclcorp.DetailType02Object();
}
// Let's
set the first detail
dclcorp.DetailType02Object Detail =
RMA.DetailArray[0];
Detail.ItemNumber = "XXXXX";
Detail.Description = "XXXXX Description";
Detail.Quantity = 1;
// Submit
the RMA
dclcorp.RMAType01Result Result =
myService.SubmitRMA(SessionID, RMA);
if
(Result.ResultStatus.Error == 0)
{
//
Update SessionID for next calls (in case needed)
SessionID =
Result.ResultStatus.SessionID;
Console.WriteLine("Success!");
// Result.RMANumber
contains the RMA Number submitted
Console.WriteLine(string.Format("RMA
Number: {0}", Result.RMANumber));
}
else
{
Console.WriteLine(Result.ResultStatus.ErrorStr);
}
}
}
}