Web Service Setup on Single Machine

bstapyltonbstapylton Member Posts: 34
edited 2012-11-22 in NAV Three Tier
Hey everyone,

I had another topic mentioning that I am trying to setup Web Services under NAV 2009 SP1 but wasn't having much luck. Well that issue was resolved (to do with the alter database) but it seems I'm still stuck.


I have a full install on the one server... that is database, service tier and client.
I have an AD account "NAVService" which I've added to the NAV db in SQL as a user/login. The account is part of the Administrators group and has been given delegation access. In SQL it has db_owner mapping (just to be sure).
The account I'm logging in onto the server with (the AD Administrator) also has been mapped to the NAV server.
The database has been altered to "Enable for Microsoft Dynamics NAV Server".
I assigned NAVService to the "Microsoft Dynamics NAV Server" and "Microsoft Dynamics NAV Business Web Services" services.
In the CustomSettings.config file I have configured "DatabaseServer", "DatabaseName", I have left the "DatabaseInstance" as blank, and set "WebServicesUseNTLMAuthentication" to true.


The services are both running but I'm getting a HTTP500 error when browsing to "http://[server]:7047/DynamicsNAV/WS/Services in IE - it just says "The website cannot display the page."



I didn't always get this 500 error. Before I assigned the NAVService account to the SQL database I was receiving an error in XML/SOAP form telling me that the DOMAIN\NAVService account didn't have permission to the database.


I can't login to NAV Classic client using the NAVService account or the Administrator account, or using Windows Authentication (I get told "The user ID and password are invalid. Try again.").
Edit: Windows Authentication works after I re-checked Tools->Security->Windows Logins. I added the Administrator Group with the SUPER role.


What steps should I take next?
I'd really appreciate a hand here.
Thanks!

Comments

  • bstapyltonbstapylton Member Posts: 34
    *shameful bump*

    Hey again,

    I've had another look over things, accounts, permissions and the like.


    Beginning to think more and more that a complete uninstall/reinstall of NAV might be what the doctor ordered.


    Unless someone can suggest something else I might have overlooked?


    Thanks!
  • ara3nara3n Member Posts: 9,256
    try to login with RTC first.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • bstapyltonbstapylton Member Posts: 34
    Thanks for the reply, Ara3n.

    I was having issues being outside of an AD, so I moved myself into the AD.

    I was getting username/password issues when trying to login using Windows Authentication on both the Classic Client and the RTC. I fixed this by logging into the Classic Client as "sa" and adding a Windows Login.


    So now I can login with the Classic Client just fine - but the RTC throws me this error:

    There is no Object Metadata within the filter. Filters: Object Type: MenuSuite, Object ID: 1000..1999
    
    The MenuSuite objects I have in my database are identical to the Cronus database I have. That is:

    Type ID Name
    7 10 MBS
    7 20 Region
    7 1010 Dept - MBS
    7 1020 Dept - Region



    Since moving into the AD I am getting this error when trying to start the Microsoft Dynamics NAV Business Web Services:
    The service MicrosoftDynamicsNavWS failed to start. This could be caused by a configuration error. Detailed error information:System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:7047/DynamicsNAV/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). ---> System.Net.HttpListenerException: Access is denied
    

    Working on this now. Will let you know how I go.


    Edit: Adding the "Log on as" account to my Administrator group seemed to fix this Service problem. Now onto the other issue!
  • bstapyltonbstapylton Member Posts: 34
    Another update - I am one step closer.


    Seems Metadata is my enemy right now.


    The RTC is still throwing me this:
    There is no Object Metadata within the filter. Filters: Object Type: MenuSuite, Object ID: 1000..1999
    


    But some good news, the Web Service WSDL is listening, and giving me a list of pages I've exposed. I have only exposed the Customer List page to test this is all working, and I can see it in the list.


    Now onto the problem. In VS2008 I go to add a Web Reference, throw the WSDL URL in, click on the Customer List service to see it's list of members and I receive this error in the information pane:
    There was an error downloading 'http://localhost:7047/DynamicsNAV/WS/Page/CustomerList'.
    The request failed with the error message:
    --
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="urn:microsoft-dynamics-schemas/error">a:Microsoft.Dynamics.Na
    


    There is a corresponding error in the Event Log:

    Service: 
    User: 
    Type: Microsoft.Dynamics.Nav.Service.WebServices.ServiceBrokerException
    Message: Service "Page/CustomerList/$metadata" was not found!
    StackTrace:
         at Microsoft.Dynamics.Nav.Service.WebServices.MetadataManager.FindServiceItem(String fullName)
         at Microsoft.Dynamics.Nav.Service.WebServices.MetadataManager.FindWsdlAdapter(String fullName)
         at Microsoft.Dynamics.Nav.Service.WebServices.ServiceBroker.MetadataFor(UrlParser relivantURLPart, Uri orginal, TextWriter output)
         at Microsoft.Dynamics.Nav.Service.WebServices.ServiceBroker.Invoke(Boolean isSoapMessage, String serviceName, Uri url, XmlReader input, TextWriter output, String sid)
         at Microsoft.Dynamics.Nav.Service.WebServices.NavWebService.<>c__DisplayClass3.<>c__DisplayClass5.<ProcessMessage>b__1()
         at Microsoft.Dynamics.Nav.Service.WebServices.Disposer.Scope(Code code)
         at Microsoft.Dynamics.Nav.Service.WebServices.NavWebService.<>c__DisplayClass3.<ProcessMessage>b__0(StreamWriter streamWriter)
         at Microsoft.Dynamics.Nav.Service.WebServices.WCFUtil.GetPopulatedMemoryStream(StreamFillingCallback callback)
         at Microsoft.Dynamics.Nav.Service.WebServices.NavWebService.ProcessMessage(Message message)
         at SyncInvokeProcessMessage(Object , Object[] , Object[] )
         at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
         at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
         at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
         at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
         at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
         at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
         at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
         at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
    Source: Microsoft.Dynamics.Nav.Service.WebServices
    



    Will start searching for similar errors on this forum and on Google.
  • bstapyltonbstapylton Member Posts: 34
    Yet another update:

    After compiling all of the objects I no longer receive an error with the RTC connecting to the database. RTC works now as it should.



    Still, though, this same error is coming up regarding the Web Services. I have tried stopping/starting the NAV services and restarting the server. I have also performed a Windows update to install important hotfixes.



    So the issue is:

    I can navigate to the WSDL page, but cannot navigate to any of the
    http://localhost:7047/DynamicsNAV/WS/Page/XXXXX pages - I just receive a HTTP500 error, and attempting to connect to those pages via Visual Studio generates the error cited in previous post (but I'll copy/paste it here again):
    Service: 
    User: 
    Type: Microsoft.Dynamics.Nav.Service.WebServices.ServiceBrokerException
    Message: Service "Page/CustomerCard/$metadata" was not found!
    StackTrace:
         at Microsoft.Dynamics.Nav.Service.WebServices.MetadataManager.FindServiceItem(String fullName)
         at Microsoft.Dynamics.Nav.Service.WebServices.MetadataManager.FindWsdlAdapter(String fullName)
         at Microsoft.Dynamics.Nav.Service.WebServices.ServiceBroker.MetadataFor(UrlParser relivantURLPart, Uri orginal, TextWriter output)
         at Microsoft.Dynamics.Nav.Service.WebServices.ServiceBroker.Invoke(Boolean isSoapMessage, String serviceName, Uri url, XmlReader input, TextWriter output, String sid)
         at Microsoft.Dynamics.Nav.Service.WebServices.NavWebService.<>c__DisplayClass3.<>c__DisplayClass5.<ProcessMessage>b__1()
         at Microsoft.Dynamics.Nav.Service.WebServices.Disposer.Scope(Code code)
         at Microsoft.Dynamics.Nav.Service.WebServices.NavWebService.<>c__DisplayClass3.<ProcessMessage>b__0(StreamWriter streamWriter)
         at Microsoft.Dynamics.Nav.Service.WebServices.WCFUtil.GetPopulatedMemoryStream(StreamFillingCallback callback)
         at Microsoft.Dynamics.Nav.Service.WebServices.NavWebService.ProcessMessage(Message message)
         at SyncInvokeProcessMessage(Object , Object[] , Object[] )
         at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
         at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
         at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
         at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
         at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
         at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
         at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
         at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
    Source: Microsoft.Dynamics.Nav.Service.WebServices
    



    Any other suggestions would be ideal. Thank you!

    Edit: The error in this post references CustomerCard where previous ones reference CustomerList... it have been exposing other pages to test that it's not just the Customer List page that is causing this.
  • bstapyltonbstapylton Member Posts: 34
    This is quickly becoming a 1-man thread haha.


    I wrote a mock Code Unit up.. just a simple HelloWorld CU - exposed it in the WebService form and voila... I can see the wsdl for it in my browser and in Visual Studio.

    So the plot thickens, it appears Web Services is working with Code Units but not for Pages.
  • bstapyltonbstapylton Member Posts: 34
    I've confirmed that under the same SQL Instance, a CRONUS 2009 SP1 database can have a Page exposed and I can view the WSDL and connect a Web Reference to it in Visual Studio - just as it is expected to.


    This leaves me puzzled... so I decided that since I have no modifications in my database - I'll simply export the Pages from Cronus and import/overwrite them (note: according to Object Designer, all the Page objects had the same date/BLOB size and version number for every object).


    I also made sure that the database license is the same - which it is.. so it doesn't look to be a licensing problem here either.


    Since Code Units seem to work fine I am under the impression that my problem isn't anything to do with SPN/Permissions/Services/Accounts. And since Pages exposed as web services work on another database within the exact same setup (i.e. the only thing I change is the CustomSettings.config file's Database name), and they are identical to the Page objects I'm working with... I gather that it can't be a problem with the objects.


    But there has to be a problem with my database in some way, shape or form.
    I can connect to my database using RTC and open the Customer List and Customer Card pages and look at customer details - so Pages ARE working at least to some extent.


    What is my next step? I'm still getting this "Message: Service "Page/CustomerList/$metadata" was not found!" error when connecting to the service WSDL using Visual Studio's "Add Web Reference" tool.


    Thanks in advance, I'll be very relieved once this is up and running!
  • nattybnattyb Member Posts: 2
    Sorry to drag up an old post. Was there a resolution for your issue where Pages would not publish correctly?

    Codeunits are fine, RTC access is fine, it's just Pages that won't publish.

    The pages are compiled.

    Thanks!
  • BeliasBelias Member Posts: 2,998
    try to add the companyname to the url of the webservice...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • nattybnattyb Member Posts: 2
    Thanks for your reply!

    I included the company name in the URL and experienced the same result.

    IE gives me their usual (and unhelpful) Error 500 when viewing any Pages.

    Chrome advises that the response was:
    Microsoft.Dynamics.Nav.Types.Exceptions.NavReadDeniedPermissionExceptionYou do not have permission to read the Profile table.You do not have permission to read the Profile table.

    The user account has the SUPER role assigned.

    I'd be very grateful for any further suggestions.
  • MacGyverMacGyver Member Posts: 7
    try compiling the tables which are in the range of 200000002-20000000203 , restart ur NAV Server and then try connecting using RTC
  • mcorvaisiermcorvaisier Member Posts: 19
    Hey,
    try compiling the tables which are in the range of 200000002-20000000203 , restart ur NAV Server and then try connecting using RTC
    Didn't work for me...


    I have the same problem with Business Web Services :
    <faultcode xmlns:a="urn:microsoft-dynamics-schemas/error">a:Microsoft.Dynamics.Nav.Types.Exceptions.NavReadDeniedPermissionException</faultcode>
    <faultstring xml:lang="fr-FR">You do not have permission to read the Profile table.</faultstring>
    <detail>
    <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">You do not have permission to read the Profile table.</string>
    

    The user is [Super].

    This problem appears randomly.

    I don't think it's a privileges problem, because when I Run the table with the same Account and Licence, I don't got this error.

    My Microsoft Dynamics Nav version is 2009 SP1.

    Do you think this problem can be fixed with an update to R2 ?

    Anyone to help me ?

    Thanks.
  • ara3nara3n Member Posts: 9,256
    see if can update your license.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • mcorvaisiermcorvaisier Member Posts: 19
    ara3n wrote:
    see if can update your license.

    My Licence is already updated, and I Have access on this table with the Microsoft Dynamics Classic Client.
  • ara3nara3n Member Posts: 9,256
    I suggest to contact MS and ask them to investigate.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • tommyvercetti88tommyvercetti88 Member Posts: 3
    Same problem HTTP 500.

    When you create a database, you must specify the security model. There are two options:

    Standard Security

    Enhanced/Advanced Security (default)

    I changed the security model from advanced to standard and it worked for me.

    Regards
Sign In or Register to comment.