WO_5ResultCode not set -- HOW TO FIX?
Well I tried adding a new webpage for a project I'm trying to do, but it ain't working.
Here's my page code:
Code:
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
public partial class api_FinancialTransactions : WOApiWebPage
{
protected override void Execute()
{
if (!WoCheckLoginSession())
return;
string s_id = web.CustomerID();
//string sessao = web.SessionKey();
//int s_key = Convert.ToInt32(sessao);
SqlCommand sqcmd = new SqlCommand("SELECT TOP 10 * from DBG_GPTransactions where CustomerID=@in_CustomerID");
//sqcmd.CommandType = CommandType.Text;
//sqcmd.CommandText = "SELECT TOP 10 * from DBG_GPTransactions where CustomerID=@in_CustomerID";
sqcmd.Parameters.AddWithValue("@in_CustomerID", s_id);
StringBuilder xml = new StringBuilder();
xml.Append("<?xml version=\"1.0\"?>\n");
xml.Append("<transactions>");
while (reader.Read())
{
string itemname = reader["Reason"].ToString();
int currentgc = (int)reader["CurrentGC"] + (int)reader["Amount"];
xml.Append("<transaction ");
xml.Append(xml_attr("TransactionID", reader["TransactionID"]));
xml.Append(xml_attr("Date", reader["TransactionTime"]));
xml.Append(xml_attr("ItemName", itemname));
xml.Append(xml_attr("Amount", reader["Amount"]));
xml.Append(xml_attr("CurrentGC", currentgc));
//xml.Append(xml_attr("ResultMsg", "success"));
xml.Append("/>\n");
}
if (!CallWOApi(sqcmd))
return;
xml.Append("<\transactions>");
GResponse.Write(xml.ToString());
//Response.Write("WO_0");
}
}
And this is the result in r3dLog:
WO_5ResultCode not set
How would I fix it?
Re: WO_5ResultCode not set -- HOW TO FIX?
Anyone knows how to fix it?
Re: WO_5ResultCode not set -- HOW TO FIX?
You're missing WO_0.
try using this function in your Eclipse Studio:
Quote:
CWOBackendReq req(this, "FILE");
Re: WO_5ResultCode not set -- HOW TO FIX?
Okay, look, this is my code inside frontendwarz.cpp:
Code:
CWOBackendReq req("api_FinancialTransactions.aspx");
//req.AddSessionInfo(gUserProfile.CustomerID, gUserProfile.SessionID);
req.AddParam("s_id", gUserProfile.CustomerID);
req.AddParam("s_key", gUserProfile.SessionID);
if(!req.Issue())
{
r3dOutToLog("Financial Transaction lookup FAILED, code: %d\n", req.resultCode_);
//return req.resultCode_;
}
// TODO ADD LOGIC
pugi::xml_document xmlFile;
req.ParseXML(xmlFile);
parseTransactions(xmlFile.child("transactions"));
Throws this:
Code:
000090.695| WO_API: failed with error code 5 ResultCode not set
000090.695| Financial Transaction lookup FAILED, code: 5
Re: WO_5ResultCode not set -- HOW TO FIX?
Quote:
Originally Posted by
GigaToni
Oh I know. Your MSSQL procedure doesnt return ResultCode
Send with my C6603 using Tapatalk 4
Okay did it and my api webpage is throwing WO_1 while my client is throwing the same error as before.