Hi,
I am trying to get B1WS to work and am experiencing some issues I am hoping you can please help with.
We are wanting to be able to add, edit and remove batch information for order line items.
The code I have written will work, though it will only work once, when it is updating the document.
If the code is run, with the Update command commented out, it will work every time.
But if it does update the record, it will begin to crash with it is run again.
The code I am using is:
protected void Page_Load(object sender, EventArgs e)
{
loginWebRef.LoginService ls = new loginWebRef.LoginService();
string sessionID = ls.Login("SQL-PATCH", "SBOJFDC_US", loginWebRef.LoginDatabaseType.dst_MSSQL2005, true, "sa", "PASSWORD", "manager", "PASSWORD", loginWebRef.LoginLanguage.ln_English, true, "LICENSE:30000");
Response.Write(sessionID + "<BR><BR>");
orderWebRef.MsgHeader msgHeader = new orderWebRef.MsgHeader();
msgHeader.SessionID = sessionID;
msgHeader.ServiceName = MsgHeaderServiceName.OrdersService;
msgHeader.ServiceNameSpecified = true;
orderWebRef.OrdersService order = new OrdersService();
order.MsgHeaderValue = msgHeader;
DocumentParams param = new DocumentParams();
param.DocEntry = 89364;
param.DocEntrySpecified = true;
orderWebRef.Document document = new orderWebRef.Document();
document = order.GetByParams(param);
StringBuilder orderSb = new StringBuilder();
orderSb.Append("Order " + document.DocNum.ToString() + "<BR><BR>");
foreach (DocumentDocumentLine docLine in document.DocumentLines)
{
orderSb.Append("Line Num: " + docLine.LineNum + "<BR>");
orderSb.Append("Item Code: " + docLine.ItemCode + "<BR>");
orderSb.Append("Description: " + docLine.ItemDescription + "<BR>");
foreach (DocumentDocumentLineBatchNumber batch in docLine.BatchNumbers)
{
orderSb.Append("+++++ Batch Num: " + batch.BatchNumber + "<BR>");
orderSb.Append("+++++ Quantity: " + batch.Quantity + "<BR>");
if (batch.Quantity > 0)
{
batch.Quantity = 1;
}
}
orderSb.Append("--------------------------------<BR><BR>");
}
order.Update(document);
Response.Write(orderSb.ToString());
}
Do you have any idea why the update will only work once, and then need to have the machine rebooted so it can work again, only once?
Is there a way to test this with DIServer directly, to be sure whether it is a DIServer issue, or a B1WS issue?
Thank you,
Mike