-->
Webservices/device
Based in Chattanooga, Alliance Web Services has helped businesses across the nation build and improve their online marketing efforts. Our clients consistently see an increase in traffic to their business. We also maintain an open line of communication to keep clients informed of. Contact Web Services 730 Rivers Street 116 Edwin Duncan Hall ASU Box 32134 Boone, NC 28608 Email us. Amazon Web Services offers reliable, scalable, and inexpensive cloud computing services. Free to join, pay only for what you use.
Web Services take Web-applications to the Next Level. By using Web services, your application can publish its function or message to the rest of the world. Web services use XML to code and to decode data, and SOAP to transport it (using open protocols).
Web services are a lightweight, industry-standard way to make application functionality available to a variety of external systems and users. Microsoft Dynamics NAV 2018 supports creation and publishing of Dynamics NAV functionality as web services. You can expose pages, codeunits, or queries as web services, and even enhance a page web service by using an extension codeunit. When you publish Dynamics NAV objects as web services, they are immediately available on the network.
Developers can publish two types of web services from Dynamics NAV objects:
SOAP Web Services. You can publish either Dynamics NAV pages or codeunits as SOAP services.
OData Web Services. You can publish either pages or queries as OData services.
Dynamics NAV web services are stateless and do not preserve the values of global variables or single-instance codeunits between calls.
Web Service Protocols
The following table shows the types of web service applications that you can create for the web service protocols supported in Microsoft Dynamics NAV 2018.
SOAP web services | OData web services | |
---|---|---|
Pages | Yes: Create, Read, Update, and Delete operations (CRUD) | Yes: Create, Read, Update, and Delete operations (CRUD) |
Codeunits | Yes | No |
Queries | No | Yes: Read-only |
For more information about the difference between these protocols, see Web Service Alternatives: SOAP and OData.
Page Web Services
When you expose a page as an OData web service, you can query that data to return a service metadata (EDMX) document, an AtomPub document, or a JavaScript Object Notation (JSON) document. You can also write back to the database if the exposed page is writable. For more information, see OData Web Services.
When you expose a page as a SOAP web service, you expose a default set of operations that you can use to manage common operations such as Create, Read, Update, and Delete. Page-based web services offer built-in optimistic concurrency management. Each operation call in a page-based web service is managed as a single transaction.
For SOAP services, you can also use extension codeunits to extend the default set of operations that are available on a page. Adding an extension codeunit to a page is useful if you want to perform operations other than the standard Create, Read, Update, and Delete operations. The benefit of adding an extension codeunit to a page is that you can make the web service complete by adding operations that are logical to that service. Those operations can use the same object identification principle as the basic page operations. For an example of how to implement an extension codeunit, see Walkthrough: Creating a Web Service using Extension Codeunits (SOAP).
Codeunit Web Services
For SOAP services only, codeunit web services provide you with the most control and flexibility. When a codeunit is exposed as a web service, all functions defined in the codeunit are exposed as operations.
Query Web Services
When you expose a Dynamics NAV query as an OData web service, you can query that data to return a service metadata (EDMX) document or an AtomPub document. For more information about how to create and use Dynamics NAV queries, see Queries.
Web Services and Regional Settings
Data is formatted according to the value of the Services Language setting for the relevant Microsoft Dynamics NAV Server instance. The default value is en-us. This means that Microsoft Dynamics NAV Server interprets all incoming data as the specified culture, such as dates and amounts.
If you know that the Services Language setting is always en-us, for example, your code can be based on that assumption. In a multilanguage environment, you will see more predictable transformations of data if data that is transmitted through web services is in a consistent culture.
Similarly, you can use the ServicesOptionFormat setting to specify how Microsoft Dynamics NAV Server must understand option values. If you set the ServicesOptionFormat setting to OptionString, Microsoft Dynamics NAV Server understand option values as the name of the option value, which is always en-us. If you set the setting to OptionCaption, web service data will be interpreted in the language specified by the Services Language setting.
Note
In earlier versions of Dynamics NAV, you could enable ServicesCultureDefaultUserPersonalization on the Microsoft Dynamics NAV Server instance. This was deprecated in Microsoft Dynamics NAV 2016 in order to guarantee that web services have a consistent culture.
Web Services in Multitenant Deployments
If your Dynamics NAV solution is used in a multitenant deployment architecture, you must make sure that any code that generates or consumes a web service specifies the relevant tenant. Web services are set up in the application, but typically you want to consume company-specific and tenant-specific data.
If you use the GETURL function, the generated URL will automatically apply to the user's tenant ID. For more information, see GETURL Function.
The URL for accessing a web service in a multitenant deployment must specify the tenant ID in one of two ways: As a query parameter, or as a host name. If you use host names for tenants, the host name must be specified as an alternative ID.
For example, the following URL consumes the Customer ODATA web service for a specific tenant:
Web Services Https
For more information, see Multitenant Deployment Architecture.
See Also
How to: Publish a Web Service
Web Service Alternatives: SOAP and OData
SOAP Web Service URIs
How to: Use SystemService to Find Companies
Basic Page Operations
Web Services Best Practices
Configuring Microsoft Dynamics NAV Server
Web services and APIs are two of those overlapping tech terms that regularly get confused. You might have even heard these words used interchangeably, but are they even the same thing?
While they do have some overlap, web services and APIs are two different concepts. If you need a quick and simple explanation, we've got you covered. In previous articles, we broke down the difference between microservices and APIs, SDKs and APIs, and today we'll do the same for web services and APIs!
What Is an API?
The term 'API' stands for Application Programming Interface. If you break that down word by word, you can get a pretty good grasp of what it means. An API is an interface that can be used to program software that interacts with an existing application. In practice, an API is 'a set of functions and procedures' that allow you to access and build upon the data and functionality of an existing application.
'APIs have been described as the glue holding the Internet together. They are woven into the fabric of most things end users do on their devices. Ever wonder how you can play Spotify from within an Uber? APIs enable two otherwise distanced entities to talk to each other in a more standardized format.' – What is an API?, Nordic APIs
APIs have been around for donkey's years. Pretty soon after the first computer application was created, clever developers realized that you could get a lot more out of distinct applications by linking them together — and so the API was born.
Nowadays, when we're talking about APIs we're typically referring to web APIs, which expose an application's data and functionality over the internet. If you look closely, you'll see that web APIs power our everyday lives:
- When you log into a website using your Facebook profile
- When you switch on Netflix and see dozens of new movies flood the screen
- When you look for flights on Google
… and the list goes on and on
Technically speaking, web APIs usually send data back and forth using HTTP requests. These requests often return textual data in the form of a JSON or XML response.
What Is a Web Service?
Simply put, a web service is a resource that's made available over the internet. Therefore, web services, by definition, require a network. The term 'web service' is defined by W3C (the World Wide Web Consortium) and so it technically follows a whole host of standards.
A Web service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP-messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.
As far as many developers are concerned, web services mostly use SOAP — a messaging protocol where XML data is shared via HTTP requests. Others disagree with this, saying that web services don't have to use SOAP, but it's an issue of semantics more than anything else.
Finally, web services are usually associated with Service Oriented Architecture. Service Oriented Architecture, or SOA, is an architectural pattern for designing software applications where features are split up and made available as services in a network.
Web Services
APIs vs Web Services
Contrary to what you might think, APIs and web services are not mutually exclusive. In fact, one is a subset of the other: every web service is an API — since it exposes an application's data and/or functionality — but not every API is a web service. This is because the definition of a web service is quite restrictive when it comes to implementation:
Data is formatted according to the value of the Services Language setting for the relevant Microsoft Dynamics NAV Server instance. The default value is en-us. This means that Microsoft Dynamics NAV Server interprets all incoming data as the specified culture, such as dates and amounts.
If you know that the Services Language setting is always en-us, for example, your code can be based on that assumption. In a multilanguage environment, you will see more predictable transformations of data if data that is transmitted through web services is in a consistent culture.
Similarly, you can use the ServicesOptionFormat setting to specify how Microsoft Dynamics NAV Server must understand option values. If you set the ServicesOptionFormat setting to OptionString, Microsoft Dynamics NAV Server understand option values as the name of the option value, which is always en-us. If you set the setting to OptionCaption, web service data will be interpreted in the language specified by the Services Language setting.
Note
In earlier versions of Dynamics NAV, you could enable ServicesCultureDefaultUserPersonalization on the Microsoft Dynamics NAV Server instance. This was deprecated in Microsoft Dynamics NAV 2016 in order to guarantee that web services have a consistent culture.
Web Services in Multitenant Deployments
If your Dynamics NAV solution is used in a multitenant deployment architecture, you must make sure that any code that generates or consumes a web service specifies the relevant tenant. Web services are set up in the application, but typically you want to consume company-specific and tenant-specific data.
If you use the GETURL function, the generated URL will automatically apply to the user's tenant ID. For more information, see GETURL Function.
The URL for accessing a web service in a multitenant deployment must specify the tenant ID in one of two ways: As a query parameter, or as a host name. If you use host names for tenants, the host name must be specified as an alternative ID.
For example, the following URL consumes the Customer ODATA web service for a specific tenant:
Web Services Https
For more information, see Multitenant Deployment Architecture.
See Also
How to: Publish a Web Service
Web Service Alternatives: SOAP and OData
SOAP Web Service URIs
How to: Use SystemService to Find Companies
Basic Page Operations
Web Services Best Practices
Configuring Microsoft Dynamics NAV Server
Web services and APIs are two of those overlapping tech terms that regularly get confused. You might have even heard these words used interchangeably, but are they even the same thing?
While they do have some overlap, web services and APIs are two different concepts. If you need a quick and simple explanation, we've got you covered. In previous articles, we broke down the difference between microservices and APIs, SDKs and APIs, and today we'll do the same for web services and APIs!
What Is an API?
The term 'API' stands for Application Programming Interface. If you break that down word by word, you can get a pretty good grasp of what it means. An API is an interface that can be used to program software that interacts with an existing application. In practice, an API is 'a set of functions and procedures' that allow you to access and build upon the data and functionality of an existing application.
'APIs have been described as the glue holding the Internet together. They are woven into the fabric of most things end users do on their devices. Ever wonder how you can play Spotify from within an Uber? APIs enable two otherwise distanced entities to talk to each other in a more standardized format.' – What is an API?, Nordic APIs
APIs have been around for donkey's years. Pretty soon after the first computer application was created, clever developers realized that you could get a lot more out of distinct applications by linking them together — and so the API was born.
Nowadays, when we're talking about APIs we're typically referring to web APIs, which expose an application's data and functionality over the internet. If you look closely, you'll see that web APIs power our everyday lives:
- When you log into a website using your Facebook profile
- When you switch on Netflix and see dozens of new movies flood the screen
- When you look for flights on Google
… and the list goes on and on
Technically speaking, web APIs usually send data back and forth using HTTP requests. These requests often return textual data in the form of a JSON or XML response.
What Is a Web Service?
Simply put, a web service is a resource that's made available over the internet. Therefore, web services, by definition, require a network. The term 'web service' is defined by W3C (the World Wide Web Consortium) and so it technically follows a whole host of standards.
A Web service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP-messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.
As far as many developers are concerned, web services mostly use SOAP — a messaging protocol where XML data is shared via HTTP requests. Others disagree with this, saying that web services don't have to use SOAP, but it's an issue of semantics more than anything else.
Finally, web services are usually associated with Service Oriented Architecture. Service Oriented Architecture, or SOA, is an architectural pattern for designing software applications where features are split up and made available as services in a network.
Web Services
APIs vs Web Services
Contrary to what you might think, APIs and web services are not mutually exclusive. In fact, one is a subset of the other: every web service is an API — since it exposes an application's data and/or functionality — but not every API is a web service. This is because the definition of a web service is quite restrictive when it comes to implementation:
- Web services require a network. While APIs can be on- or offline, web services must use a network.
- APIs are protocol agnostic. While APIs can use any protocols or design styles, web services usually use SOAP (but sometimes REST, UDDI, and XML-RPC).
Web Service Vs Api
There's another big distinction. Many public APIs are transparent, with open documentation and self-service portals for quick developer onboarding. That's because the point of many modern day APIs is, after all, to facilitate interaction with an application. On the other hand, web services have not enjoyed such an open history: instead, they tend to offer specific data and/or functionality to specific partners — they're not there to be hacked about with.
SOA Gave Web Services a Bad Name
For developers for whom web services necessarily mean SOA, there's one big issue with web services. In Service Oriented Architecture, the services have to be designed in anticipation of how they'll ultimately be used and who will be using them. If there's a lack of proper planning, or if needs change just with the passing of time, developers can quickly find themselves stringing together a mishmash of services to build the right implementation.
Inherently, web services don't have this problem. It's only when web services are used in a Service Oriented Architecture that these issues can pop up. In truth, then, SOA has given web services a bit of a bad name.
Webservices.nl
Final Thoughts
There you have it: an API is an interface that allows you to build on the data and functionality of another application, while a web service is a network-based resource that fulfills a specific task. Yes, there's overlap between the two: all web services are APIs, but not all APIs are web services.
Webservices.ulm.edu
Both web services and APIs are — at their core — very useful and very much used today. However, it's the web services associated with SOAP and/or Service Oriented Architecture which are falling out of favor.