Options

Job Queue through NAV Webservice for mulitple Companies

2

Comments

  • Options
    ara3nara3n Member Posts: 9,255
    I have IE 8 installed and have not had any issues with my webservice.
    I would delete the record webservice table and try to publish it again. Make sure it's in correct CASE.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    elwin68elwin68 Member Posts: 153
    Thanks for the test with IE8.
    I have tried already to delete and add the webservice record again.

    It is a strange issue. I will try again later.
  • Options
    pvarpvar Member Posts: 157
    Hi,

    We are on NAV 2009 SP1 with classic client. We do not have the 3-tier env so we do not have the NAV server installed or web service running. We need to schedule jobs in different companies and we are looking at the options. I looked at Rashed's other option of having 2 NAS licenses but somehow I couldn't get that working(also the license is expensive) and then I saw this thread and I tried this in a playground and everything worked as outlined in the document so I am leaning towards this solution

    So what do we need to implement this solution in our production env? Here is what I am thinking

    1. Install NAV server thereby get access to web services
    2. Import the codeunit and publish it as a web service
    3. Setup job queue entries to run the codeunit for jobs in other companies

    Do we need to purchase any additional license?

    Thanks for the help
  • Options
    ara3nara3n Member Posts: 9,255
    If you are testing this with your license and it's working, then no.

    Otherwise, you'll need one service tier license. and one light user license.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    pvarpvar Member Posts: 157
    I was testing with my developer license so that's probably why it worked. So to move the changes to production I guess we would need the licenses you mentioned. Do you have any idea how much it costs?

    Another question in relation to this. As I said earlier we do not have a service tier right now so we would have to setup that for the job queue to work. We are in a citrix env with a number of terminal servers where the classic client is installed and a sql server so any recommendation on where to install the application server and the NAV server?
  • Options
    ara3nara3n Member Posts: 9,255
    The service tier is about 600 and light user is about 200.
    I suggest to install the NAS and Service tier on one new separate box.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    pvarpvar Member Posts: 157
    Thanks Rashed. Now regarding the windows account to run the NAS & web service, does it really need sysadmin rights on the SQL and SUPER role in Navision?
  • Options
    ara3nara3n Member Posts: 9,255
    no, it can be regular windows user with rights to run as service.

    You'll need to look at delegation to allow 3 tier environment. MSDN has some walk through. As fas as NAV security, it needs to have permission to run what you schedule it to do. .
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    pvarpvar Member Posts: 157
    Thanks again. I was trying to to schedule a report using web service & job queue and I am getting the following message.

    'Report state information cannot be transferred to Microsoft Dynamics NAV Classic client report from the RoleTailored client. One or more of the public functions on report 50374 has been called before running the report.'

    The report I am calling through your codeunit calls a series of reports in turn to do different things and each of them run through every company in our database to pull the information using changecompany and report 50374 is the first sub report it's calling. The main report calls a function in report 50374 to set some parameters before running the report, is that the problem? None of these reports has any RDLC definition attached to it, they are all pure classic reports.

    Any idea?
  • Options
    ara3nara3n Member Posts: 9,255
    If they are processing only reports, it is fine, if they are printing information, then you need to create the RDLC. The webservice cannot call classic client to print a report.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    pvarpvar Member Posts: 157
    Alright, so I added the RDLC and now I am getting the error 'Callback functions are not allowed.'

    While reading more about the error message I found out it could be due to the dialog functions that I am using in the report. But didn't you say in the beginning that one of the advantages of using web service is you don't have to change your programs to remove such code and the web service is going to ignore them?
  • Options
    ara3nara3n Member Posts: 9,255
    That is right. I had used Adjust cost report which opens the dialog during process and I didn't have to modify it to add the following code.

    IF GUIALLOWED THEN
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    pvarpvar Member Posts: 157
    That's the weired thing about it. I also tested adjust cost item routine and it worked fine.

    I have added IF GUIALLOWED THEN to all of the dialog calls but I am still getting the same error. Any other reason for that error message?
  • Options
    ara3nara3n Member Posts: 9,255
    I think the problem is probably somewhere else.

    Are you openning a form on opencompany trigger in CU 1? or anywhere else during the process?

    Do you have CONFIRM somewhere in your code or Message?

    also are you running your report to print something? if you are printing something, you need to call SAVEASPDF or excel instead of actually running the report.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    pvarpvar Member Posts: 157
    I made the report Processonly and that took care of the issue. SAVEASPDF is an RTC function as far as I know so I don't think that will work for us, actually these reports are really process only but it had sections to print some information and that is why I created some RTC layout thinking it will work based on your earlier recommendation. Thanks for all the help.
  • Options
    ara3nara3n Member Posts: 9,255
    That's great.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    pvarpvar Member Posts: 157
    Rashed, I am testing this in a new env where I have the database & NAV server in one server and the client on the other. The services are running and when I tried to run a simple report I am getting the unhandled error and when I checked the response.xml file it is empty. Do you know what could be the issue? Thanks
  • Options
    ara3nara3n Member Posts: 9,255
    make sure RTC can be run from that client.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    pvarpvar Member Posts: 157
    You mean I need Role tailored client installed on the client server? I could see the published web services from the client.
  • Options
    ara3nara3n Member Posts: 9,255
    It could be security related. I want to rule that out. And you are not using R2.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    pvarpvar Member Posts: 157
    I am not on R2 and my login has admin privilege on the NAV server box and SUPER role in NAV. The program stops at the else part of the code in the codeunit
    IF NOT ISCLEAR(XmlNode) THEN BEGIN
    IF XmlNode.text <> Text_Finished THEN
    ERROR(XmlNode.text)
    ELSE
    MESSAGE(XmlNode.text);
    END ELSE BEGIN
    XmlDoc.save('C:\response.xml');
    HYPERLINK('C:\response.xml');
    ERROR(Text50002);
    END;
  • Options
    ara3nara3n Member Posts: 9,255
    Is there anything in the event log?

    There was a blog also on how to monitor the wcf webservice for NAV.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    pvarpvar Member Posts: 157
    The only thing I am seeing in the event log at the server is an http 401 unauthorized information type message for the source NAS. But the account that is assigned to NAS has admin level rights on Windows & sql server and SUPER role in NAV.

    If I schedule a job just using NAS it works fine but it doesn't work if I use the codeunit to schedule a job using web service.
  • Options
    pvarpvar Member Posts: 157
    Also could you please tell me where I can find the blog to monitor the web service. I did some search but no luck. Thanks
  • Options
    pvarpvar Member Posts: 157
    The issue is resolved by changing the server name in the config file and in the codeunit to localhost(makes sense because the database & the NAV server are on the same box) but still wondering why calling with the name cause issue. I could see the published web services by calling with the name of the server in a browser.
  • Options
    ara3nara3n Member Posts: 9,255
    That's interesting. I replied to you post and posted the link where the blog was but I don't see my post :(

    Here is the link again.

    http://blogs.msdn.com/b/nav/archive/201 ... am+Blog%29
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    redkingredking Member Posts: 34
    Hi,

    is this compatible with NAV 2009 R2?

    Our job queue log entries shows “This message is for C/AL programmers:
    The call to member send failed. msxml3.dll returned the following message:
    The connection with the server was terminated abnormally”

    We’ve tried running several different codeunits and get the same error

    Cheers
    Red
  • Options
    ara3nara3n Member Posts: 9,255
    I'll test it on R2 and let you know.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    ara3nara3n Member Posts: 9,255
    I just tested in R2 and it is working. Make sure your webservice record is in correct case

    RunJob.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    battoosaibattoosai Member Posts: 16
    Hi,

    It seems to be the solution that I need for this requirement that I have. I followed all the steps as explained and I was able to check the list of web services in a web browser. However when running the Job Queue I am encountering errors. I duplicated the codeunit in order to debug it and executed the codeunit.

    Here are the errors that I encountered.

    Are there any other setup required that is not mentioned in the blog? ThankS!
Sign In or Register to comment.