This section describes the components you need in order to call an Oracle ATG Web Commerce Web Service. Because there are a few ways that you can generate a Web Service call on .NET, this section focuses only on the Oracle ATG Web Commerce resources you will use and assumes that you will refer to your .NET documentation for specific instructions.

The following sections should provide guidance when creating a Web Service call:

Accessing an ATG Web Service

The Oracle ATG Web Commerce platform provides client stubs for all Oracle ATG Web Commerce platform Web Services in ATGWS.dll. Once you have installed a version of ATGWS.dll to your GAC and Assembly folders (see Installing ATGWS.dll for instructions), you need to do two things:

  1. In your Visual Studio .NET project, make a reference to ATGWS.dll.

  2. Create instances of the client stubs and use them in your Web Service call.

Accessing a Custom ATG Web Service

To access a Web Service that you created in the Oracle ATG Web Commerce platform, you create client stub and a reference to it in your Visual Studio.NET project:

Sample Web Service Calls

The Web Service call is a document that incorporates calls to any number of Oracle ATG Web Commerce Web Services that may exist in the same session. For each Web Service, you create an instance of the client stub, call methods on the Web Service, and call the Web Service itself. These Web Service calls are written in C#.

Simple Call Example

This Web Service call obtains a RepositoryItem by accessing the getRepositoryItem Oracle ATG Web Commerce Web Service.

using Atg.DotNet.WebService.Repository.GetRepositoryItem;

 // ...

 // create stub instance
 GetRepositoryItemSEIService getItemClientStub = new
 // assign URL of web service
 getRepositoryItemClientStub.Url =
 // call web service
 string itemXml =
"itemDescriptorName", "repositoryId"
Complex Call Example

The following code demonstrates how you would construct a call that uses security controls to restrict the information users can access. Notice that the loginUser Web Service establishes the user identity role, which other Web Services refer to. Because an instance of a CookieContainer is created in this code and assigned to each Web Service stub, all Web Services called here exist in the same session.

For brevity these examples omit some details such as a exception handling for the SoapException as well as class syntax.

using System.Net; // for CookieContainer
using Atg.DotNet.WebService.Repository.GetItem;
using Atg.DotNet.WebService.Repository.PerformRQLQuery;
using Atg.DotNet.WebService.UserSession.LoginUser;
using Atg.DotNet.WebService.UserSession.LogoutUser;

// create stub instances
GetItemSEIService getItemClientStub = new GetItemSEIService();
PerformRQLQuerySEIService performRQLQueryClientStub = new
LoginUserSEIService loginUserClientStub = new LoginUserSEIService();
LogoutUserSEIService logoutUserClientStub = new LogoutUserSEIService();

// create a new cookie container for our session and share it between
// the various stub instances
CookieContainer cookieContainer = new CookieContainer();
getItemClientStub.CookieContainer = cookieContainer;
performRQLQueryClientStub.CookieContainer = cookieContainer;
loginUserClientStub.CookieContainer = cookieContainer;
logoutUserClientStub.CookieContainer = cookieContainer;

// authenticate the user for the session
loginUserClientStub.loginUser("user", "password", false);

// call services
string itemXml =
 "itemDescriptorName", "repositoryId");
string[] itemsXml =
 "itemDescriptorName", "property = 'value'");

// log out the user

Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices