Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Connecting to the Junos XML Protocol Server

You can connect to the Junos XML protocol server through the Junos OS command-line interface (CLI) or through a client application. The following sections provide details for each method:

Connecting to the Junos XML Protocol Server from the CLI

The Junos XML management protocol and Junos XML API are primarily intended for use by client applications; however, for testing purposes you can establish an interactive Junos XML protocol session and type commands in a shell window. To connect to the Junos XML protocol server from the CLI operational mode, issue the junoscript interactive command (the interactive option causes the Junos XML protocol server to echo what you type):

To begin a Junos XML protocol session over the connection, emit the initialization PI and tag that are described in Starting Junos XML Protocol Sessions. You can then type sequences of tag elements that represent operational and configuration operations. To eliminate typing errors, save complete tag element sequences in a file and use a cut-and-paste utility to copy the sequences to the shell window.

Note:

When you close the connection to the Junos XML protocol server (for example, by emitting the <request-end-session/> and </junoscript> tags), the routing platform completely closes your connection instead of returning you to the CLI operational mode prompt. For more information about ending a Junos XML protocol session, see Ending a Junos XML Protocol Session and Closing the Connection.

Connecting to the Junos XML Protocol Server from the Client Application

For a client application to connect to the Junos XML protocol server and open a session, you must first satisfy the prerequisites described in Satisfying the Prerequisites for Establishing a Connection to the Junos XML Protocol Server.

When the prerequisites are satisfied, an application written in Perl can most efficiently establish a connection and open a session by using the Junos XML protocol Perl module provided by Juniper Networks. For more information, see Understanding the Junos XML Protocol Perl Distribution and Sample Scripts.

A client application that does not use the Junos XML protocol Perl module connects to the Junos XML protocol server by opening a socket or other communications channel to the Junos XML protocol server device, invoking one of the remote-connection routines appropriate for the programming language and access protocol that the application uses.

What the client application does next depends on which access protocol it is using: