In Microsoft Dynamics NAV the company name is part of the URL when you access published webservices. The ‘SystemService’ webservice allows you to retrieve the names of available companies. Even when you publish no webservices in Microsoft Dynamics NAV 2017 there is still this ‘builtin’ webservice that you can access. So let’s try it out! I took a look at the WSDL (Web Services Description Language). After looking at the WSDL I constructed a SOAP request like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sys="urn:microsoft-dynamics-schemas/nav/system/"> <soapenv:Header/> <soapenv:Body> <sys:Companies/> </soapenv:Body> </soapenv:Envelope>
I did sent this SOAP request to the NAV Service which is configured to allow SOAP Services. As a response I got a list of all the NAV companies:
<Soap:Envelope xmlns:Soap="http://schemas.xmlsoap.org/soap/envelope/"> <Soap:Body> <Companies_Result xmlns="urn:microsoft-dynamics-schemas/nav/system/"> <return_value>Company A</return_value> <return_value>Company B</return_value> <return_value>Company C</return_value> </Companies_Result> </Soap:Body> </Soap:Envelope>
You could use these company names in your webservice URL to work with specific company data.