Currently I am running a servlet that reads data from a URL generated by another servlet on another machine. The problem I am experiencing is missing data being replaced by a null. When I cut and paste the URL, the data appears to be fine. I use the same class to read from the URL for other purposes without any problems (different data based on call, same URL).
Here is the code that reads the URL (the URL is well formed, if cut and pasted into the address location of the browser with the variables, the data appears fine):
/***********************************************************
Check URL input
***********************************************************/
fName = " + strBillAcct + "&CALLTYPE=" + strCallType + "&BILLDATE=" + strBillDate + "&BILLSEQ=" + strBillSeq;
try
{
URL inBill = new URL(fName);
DataInputStream server = new DataInputStream (inBill.openStream());
while((s = server.readLine()) != null)
{
lnCnt += 1;
strData += s;
}
server.close();
strCallError = "Sucessfull Call - " + lnCnt + " lines read!";
}
catch(FileNotFoundException e)
{
strCallError = "File not found " + fName;
}
catch(IOException e)
{
strCallError = "IO Exception for " + fName;
}
When the URL is Cut and Pasted the data returned is:
OK RLKTDAT U REGR1000000900 crider1 crider crider crider@email.com 2j7jHMzSWAbg104162170 N
The servlet reading the URL is returning:
OK RLKTDAT U REGR1000000900 null N
What I need to know is why null is getting returned in the place of data, when the data is there when you cut and paste the url into your browser??
Any suggestions would be appreciated!
Here is the code that reads the URL (the URL is well formed, if cut and pasted into the address location of the browser with the variables, the data appears fine):
/***********************************************************
Check URL input
***********************************************************/
fName = " + strBillAcct + "&CALLTYPE=" + strCallType + "&BILLDATE=" + strBillDate + "&BILLSEQ=" + strBillSeq;
try
{
URL inBill = new URL(fName);
DataInputStream server = new DataInputStream (inBill.openStream());
while((s = server.readLine()) != null)
{
lnCnt += 1;
strData += s;
}
server.close();
strCallError = "Sucessfull Call - " + lnCnt + " lines read!";
}
catch(FileNotFoundException e)
{
strCallError = "File not found " + fName;
}
catch(IOException e)
{
strCallError = "IO Exception for " + fName;
}
When the URL is Cut and Pasted the data returned is:
OK RLKTDAT U REGR1000000900 crider1 crider crider crider@email.com 2j7jHMzSWAbg104162170 N
The servlet reading the URL is returning:
OK RLKTDAT U REGR1000000900 null N
What I need to know is why null is getting returned in the place of data, when the data is there when you cut and paste the url into your browser??
Any suggestions would be appreciated!