Hello everyone,
I'm trying to setup a 3-tier installation following the Walkthough provided by Microsoft: (
https://msdn.microsoft.com/en-us/library/dd301254.aspx )
I have 2 machines currently setup. First is the SQL Server (omisqldev), and the second machine is the Web Services machine (ws1). Both machines are members of the EOMEGA domain, and I created 1 Domain User for use for both system's services (SQLAdmin).
Here are the services for the Web Services server:
Here are the services for the SQL Server:
Here is the Domain User for both services:
Here is the list of delegations, reported by setspn:
And this is the output of the Best Practices Analyser:
Unless I'm missing something, the MSSQLSvc/omisqldev.eomega.org SPN is defined for the service account user. I don't know what's missing in the setup.
When I try to connect from a third machine via Web Services, I am presented with a login screen:
After providing the credentials for a local account to WS1 (Domain Users didn't work) I get:
Anyone have any suggestions on where I should go next or what the missing piece to this puzzle is?
Thanks for taking the time to read this,
- Rob
Comments
Do you set "WebServicesUseNTLMAuthentication = true" under service config?
Regards,
Yukon
How about the RTC? Can you open the nav with RTC? What is the database role membership for SQLAdmin on your database. If you still face with same error, try to use separate a/c and re-configure again.
Regards,
Yukon
The Windows users have been added to the database. I can connect using the Classic client in Windows Authentication mode for the SQLAdmin user.
Also, I am able to run the RTC, but only on WS1 (when logged into the domain with SQLAdmin).
It looks to be a delegation issue, as the SQL Logs show attempts of logging in as Anonoymous
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT: 192.168.0.51]
The infrastructure error is the missing SPN that IS setup (at least what I believe to be setup, as provided by the setspn screen capture I provided). The BPA says the SPN isn't setup, when it looks like it is.
Thank you for your answers so far Yukon,
- Rob
I figured out where my error was in this whole process.
After I had set (on the Navision Service) the "WebServicesUseNTLMAuthentication" to true, I never tested logging into Web Services with the Domain User. I was able to log in to Web Services with the Domain User and I got the expected results from the session:
Thank you for your assistance Yukon!
The function in the codeunit is called GetGuest and it has 2 parameters. First is the GuestNo, which is the value linked to a Contact Record, and the second parameter is GIXML, which is an VAR declared XMLPort to the Contact table. I am trying to access this codeunit via PHP, and am having no luck in getting the XML back from the function.
Using both Freddy.DK's blogs, as well as Arte's blog post regarding NAV and PHP, I am able to do the basics like accessing the Company List and reading information via a page. When I try to access the codeunit though, I am getting a SOAP Exception: ERROR: SoapException: [SoapFault exception: [a:System.Xml.XmlException] Data at the root level is invalid. Line 1, position 1. in /opt/lampp/htdocs/guest.php:18
Here's the code in my guest.php file:
Basically, I'm not getting anything back from the codeunit. The XMLPort does work, as I have written a test codeunit to generate an XML file with it.
Here's what my registered codeunit looks like:
Any assistance here would be greatly appreciated.
Thanks for taking the time to read this.
First, if you have error checks in functions that are called using webservices, you should not use the exit, but an error instead.
It appears that the XMLPort is called anyway, no matter if you Exit the function. You can only prevent this from happening with an error.
Second, the error message you get "Data at the root level is invalid" tells something about the XML returned through the XMLPort. Did you check all properties of your XMLPort?
for example:
Encoding : UTF-8
XMLVersionNo : 1.1
Format/Evaluate : XML Format/Evaluate
regards, Remco
Hello Remco,
Thanks for the heads-up on Exiting a function when XMLPorts are involved. Makes sense. I will change those to error calls instead of exits.
I have tried all of those settings for the XMLPort (The Format/Evaluate, version, etc.) and the PHP code still doesn't work.
What the function is supposed to do is return data via the XMLPort. Even though I have the XMLPort setup as Export-Only, I fear the codeunit is trying to execute it as an Import (Since I am feeding the function a null object, and not explicitly calling the XMLPort with XMLPort.EXPORT().
I can get the data out as a Page, but the pages are behaving differently than the XMLPort. When I extract the data via a page, if a field has no value in the table being accessed it is omitted from the output from the page entirely. In the PHP code I have to test for the existence of the element via isset() for every field which is annoying.
Ideally I'd like the codeunit to work but I'm not having any luck.
Thank you for the suggestions though. Appreciate the help
- Rob
It should be no problem to call the EXPORT in the function. And you can use it to check if it succeeded:
e.g. this is a function that also gets called through a webservice using php :
Just another question: Is the first node in your XMLPort a text element?
Remco
The first node in my XMLPort is a Text Field (Root);
I added in code to manually do the EXPORT, and it seems to complete but is still not returning anything to the php object. I have written a test codeunit to see if I can generate an xml file using the XMLPort, and it works so I'm a tad confused as to what's wrong.