cancel
Showing results for 
Search instead for 
Did you mean: 

How to retreive an xml file from a remote computer?

Former Member
0 Kudos

Hello,

I have an xml file which is sitting at this location:


main-uni1\c$\Companies\OutGoing\MonyReports\test.xml

My question is how can I create new File which will contain this xml file for parsing? The File constructor doesn't receive these notations.

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

Hi Roy,

Try to map the folder
main-uni1\c$ under a network drive T for example and then use

new File("T:\Companies\OutGoing\MonyReports\test.xml")

Hope that helps,

Vladimir

Former Member
0 Kudos

Hey Vladimir,

By doing this I receive FileNotFoundException.

Maybe I should note that the application is a DynPro application which is being deployed to the Server and I mapped the driver on the server.

Vlado
Advisor
Advisor
0 Kudos

Hi Roy,

What is the exact message of the exception? Is it "The system cannot find the file specified" or "Access is denied"? I guess the user under which your WebDynpro app is running (i.e. SAPService<SID>) doesn't have access to that network drive/folder.

Best regards,

Vladimir

Former Member
0 Kudos

The error messege is: "The system cannot find the file specified"

Vlado
Advisor
Advisor
0 Kudos

And does the same code work in a single java program running on the machine of the server?

Former Member
0 Kudos

When I test this code in a simple Java application which is running on my comupter (Not the server) and map the same drive, the application finds the file. So, the problem is with the server or with a DynPro configuration since my original application is written in DynPro?

0 Kudos

Hi,

I tried the following

try{

File f=new File("
"+"
<remote system name>
c#
test.txt");

int size=(int)f.length();

System.out.println(""+size);

}catch(Exception e){

System.out.println(e.toString());

}

I recieved a 0 with the web dynpro while i recieved the file size using simple java code.

I also tried writing something into the file in web dynpro and recievd a fileNotfound exception due to unknown username or bad password.

Check out the code and do let me know about the result

Regards

Shyam R

Former Member
0 Kudos

Dear Shyam,

So, you agree that there is a problem with DynPro right?

What do you want me to check exactly?

0 Kudos

I think the problem is because of the login credentials required for logging into the remote system, which the server does not have. So i think discussing the issue in dynpro forum would be better, might be the WD gurus can help.

Web dynpro does not support whole of the java functionalities.

I just wanted you to try the code I have given, in your dynpro, and know what the result was.

Try printing the size.

Vlado
Advisor
Advisor
0 Kudos

The File.length() method returns "The length, in bytes, of the file denoted by this abstract pathname, or 0L if the file does not exist" - and the reason for the latter could be exactly "Logon failure: unknown user name or bad password". What actually was my first guess that the server user doesn't have access to the network folder.

Best regards,

Vladimir

Former Member
0 Kudos

If it is True than why do I receive "The system cannot find the file specified"?

Answers (0)