Focal Point
WebFocus through .NET

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6491086512

February 28, 2007, 04:54 PM
rs
WebFocus through .NET
Hi
I am in the process of coding a .NET C# application. It is a Windows application.
Can I invoke a WebFocus report from it.
When it encounters the code that tries to logon to WebFocus I am getting this error message

"Client found response content type of 'text/html; "
The code is as follows

WebReference.WebFocus wfs = new WebReference.WebFocus();
WebReference.LogOnInfo logon = new WebReference.LogOnInfo();
WebReference.WebFocusReturn ret = new WindowsApplication2.WebReference.WebFocusReturn();
WebReference.FexInfo report = new WindowsApplication2.WebReference.FexInfo();
WebReference.ValuesArrayEntry parm1 = new WindowsApplication2.WebReference.ValuesArrayEntry();

string newOutput = "";
string tempFile = "";

string[] parms = new string[2];

parm1.name = "CASETYPE";
parm1.val = "EXTERNAL";

try
{
report.server = "EDASERVE";
report.app = "ic001w03_cases15daysold";
report.name = "ic001w03_cases15daysold";


logon = wfs.WebFocusLogOn("a76243","ramesh21","","");
ret = wfs.WebFocusRunFex(logon, report);

newOutput = ret.output;

if (ret.mime == "application/vnd.ms-excel" )
tempFile = "c:\\temp\\cases_out.xls";
else
tempFile = "c:\\temp\\cases_out.pdf";


wfs.WebFocusRunFex(logon,report);
}
catch (Exception ex)
{
System.Diagnostics.Debug.Write(ex.ToString());
throw ex;
}

Any help will be appreciated


rs
February 28, 2007, 07:36 PM
Viral
this is .net code in vb change the synatx for c#.

Sub SubmitBtn_Click(sender As Object, e As EventArgs)
'Message.Text = "First ASPNET Page "
Dim webFocus As New WebFocus
Dim logon As New LogOnInfo
Dim returnVal As New WebFocusReturn
Dim Report As New FexInfo
Dim newOutput As String =""
Dim tempfile As String


logon = webFocus.WebFocusLogOn("","","","")
Report.Server = "EDASERVE"
Report.app = "rv_allocation"
Report.name = "TestWSDL"

returnVal = webFocus.WebFocusRunFex(logon, Report)
'Message.text = returnval.output

newOutput = returnVal.output

Message.text = newOutput


WF 7.6.2/ OS WIN2003.
DM 7.6.2
March 01, 2007, 08:51 AM
rs
Thanks lot Viral.
After making changes to my code and when I run
I am getting this message
"Client found reponse content type of 'text/html; charset=iso-8859-1', but expected text/xml "
at this line
logon = webFocus.WebFocusLogOn("","","","")
I am getting this message even if I supply UserId and Password.

Also please note that mine is a Windows Application. Does it have to be a Web App


rs