New-NAVWebService

Creates a new Microsoft Dynamics NAV web service.

Syntax

New-NAVWebService
   -ObjectType <ObjectType>
   -ObjectId <Int32>
   -ServiceName <String>
   [-Published <Boolean>]
   [-ServerInstance] <String>
   [-Force]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Use the New-NAVWebService cmdlet to create and optionally publish web services that are based on Microsoft Dynamics NAV application objects. You can see which web services have already been created by running the Get-NAVWebService cmdlet.

In a multitenant deployment of Microsoft Dynamics NAV, web services are created in the application database, and they apply to all tenants that are mounted against that Microsoft Dynamics NAV Server instance.

Examples

EXAMPLE 1

New-NAVWebService -ServerInstance DynamicsNAV -ServiceName Customer -ObjectType Page -ObjectId 21 -Published 1

This example uses the New-NAVWebService cmdlet to create and publish a web service that is based on page 21, Customer Card.

Parameters

-Confirm

Prompts you for confirmation before executing the command.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ObjectId

Specifies the ID of the object that you want to publish as a web service.

Type:Int32
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ObjectType

Specifies the type of the object that you want to publish as a web service. You can publish two types of web services from Microsoft Dynamics NAV objects: SOAP Web Services and OData Web Services

With SOAP Web Services, you can publish either Microsoft Dynamics NAV pages or codeunits.

With OData Web Services, you can publish either pages or queries.

For more information, see "Overview of Microsoft Dynamics NAV Web Services" in the Developer and ITPro documentation for Microsoft Dynamics NAV 2016.

Type:ObjectType
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Published

Specifies if the web service must be published immediately.

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ServerInstance

Specifies the name of a Dynamics NAV Server instance, for example, DynamicsNAV or myinstance. You can specify either the full name of an instance, such as MicrosoftDynamicsNavServer$myinstance or the short name such as myinstance.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ServiceName

Specifies the name of the web service.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

None

Notes

Because cmdlets do not execute application code, if there is any logic on application objects that are associated with creating or modifying web services from the client, be aware that the logic will not be executed when you run the cmdlet.