Running XMLPort from webservice

balhiniobalhinio Member Posts: 28
edited 2011-01-04 in NAV Three Tier
Hi all,
I have a codeunit that run an XMLPort to export a table. When I run the code unit directly from Navision every thing is ok
but when I expose the code unit as a web service and I call it there is no result: no file was exported!!
the following is the code unit:

TestFile.CREATE('C:\\XXXX.xml') ;
TestFile.CREATEOUTSTREAM(TestStream);
XMLPORT.EXPORT(50099,TestStream);
TestFile.CLOSE;

Thanks for help

Comments

  • ara3nara3n Member Posts: 9,256
    Is there any error in event log? or do you receive a success or failure response when you call the function from your client that consumes the NAV webservice?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • balhiniobalhinio Member Posts: 28
    There is no error or warning in the eventlog.
    I had change the code unit as the following:

    TestFile.CREATE('C:\\XXXX.xml') ;
    TestFile.CREATEOUTSTREAM(TestStream);
    XMLPORT.EXPORT(50099,TestStream);
    TestFile.CLOSE;
    exit(true);

    from the web service the code unit return the bolean value correctly!! so the is no exeption here!
    but no file was created!!!!
  • EgnazEgnaz Member Posts: 111
    Can you please try to get the result from the XMLPort.

    [{Ok} :=] XMLPORT.EXPORT(Number, OutStream [, Record])

    What is the return from the export ?

    Regards,
    egnaz
  • ara3nara3n Member Posts: 9,256
    Also does the user that the nav service running under have permission to write to that directory?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.