Inventory  

Inventory Interface

Supplier Developer Guide



July 2014

 

Contents

 

Recent Revisions to This Document

About This Guide

Audience and Purpose

Conventions

Additional Required Documentation

Introduction

SOAP Request and Response Message Structure

Example Request

Example Response

C# / .NET

Requirements

Data Contracts

Generate Contract

Create a WCF Service Application

Configure the WCF Service

Configure Local Web Server

Java

PHP



Recent Revisions to This Document

 

Release

Changes

0.0.1  Initial Guidelines Release
0.0.2 Updated WSDL links to reflect new folder structure



About This Guide



Audience and Purpose

 

This guide is written for application developers who wants to integrate a supplier’s inventory data with distributors and service providers in the Promotional Product Industry. The guide will describe tasks you must complete to adhere to the to the Inventory Interface’s WSDL.

 

Implementing the Inventory Interface requires programming skills in one of the following programming languages:

 

 

You will be required to write code to develop a SOAP 1.1 Web service that follows the Inventory Interface Standards.

 

Conventions 

 


 note_edit.pngA Note contains helpful suggestions or references to material not contained in this document.


 


error.pngAn Important statement contains information essential to successfully completing a task or learning a concept.


 

 

Additional Required Documentation

 

Inventory Interface Standards documentation contain information about:

 

 

The following documentation is available in the developer package download:

 

Introduction

 

The Inventory Interface provides distributors and service providers, the ability to request product inventory levels from a supplier. There are sections below that will provide technical details on how to implement a SOAP 1.1 Web service. This Web service should follow the Inventory Interface Standards using a Contract-first approach, adhering to predefined WSDL.

 

SOAP Request and Response Message Structure

 

Example Request

 

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

 <s:Header>

   <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">getInventoryLevels</Action>

 </s:Header>

 <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

   <Request xmlns="http://www.promostandards.org/WSDL/InventoryService/1.0.0/">

     <wsVersion>1.0.0</wsVersion>

     <id>demouser</id>

     <password>password</password>

     <productID>32791</productID>

     <productIDtype>Supplier</productIDtype>

   </Request>

 </s:Body>

</s:Envelope>

 

Example Response

 

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

 <s:Header />

 <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

   <Reply xmlns="http://www.promostandards.org/WSDL/InventoryService/1.0.0/">

     <productID>32791</productID>

     <ProductVariationInventoryArray>

       <ProductVariationInventory>

         <partID>3279136</partID>

         <partDescription>16 oz Caturra Vacuum Tumbler</partDescription>

         <quantityAvailable>0</quantityAvailable>

         <attributeColor>Red</attributeColor>

         <customProductMessage>Call Factory</customProductMessage>

         <entryType>exact</entryType>

         <validTimestamp>2014-07-01T19:17:48.4548457Z</validTimestamp>

       </ProductVariationInventory>

       <ProductVariationInventory>

         <partID>3279137</partID>

         <partDescription>16 oz Caturra Vacuum Tumbler</partDescription>

         <quantityAvailable>3600</quantityAvailable>

         <attributeColor>Blue</attributeColor>

         <entryType>exact</entryType>

         <validTimestamp>2014-07-01T19:17:48.4548457Z</validTimestamp>

       </ProductVariationInventory>

       <ProductVariationInventory>

         <partID>3279138</partID>

         <partDescription>16 oz Caturra Vacuum Tumbler</partDescription>

         <quantityAvailable>2400</quantityAvailable>

         <attributeColor>Stainless</attributeColor>

         <entryType>exact</entryType>

         <validTimestamp>2014-07-01T19:17:48.4548457Z</validTimestamp>

       </ProductVariationInventory>

       <ProductVariationInventory>

         <partID>3279145</partID>

         <partDescription>16 oz Caturra Vacuum Tumbler</partDescription>

         <quantityAvailable>3000</quantityAvailable>

         <attributeColor>Green</attributeColor>

         <entryType>exact</entryType>

         <validTimestamp>2014-07-01T19:17:48.4548457Z</validTimestamp>

       </ProductVariationInventory>

       <ProductVariationInventory>

         <partID>3279146</partID>

         <partDescription>16 oz Caturra Vacuum Tumbler</partDescription>

         <quantityAvailable>2200</quantityAvailable>

         <attributeColor>Orange</attributeColor>

         <entryType>exact</entryType>

         <validTimestamp>2014-07-01T19:17:48.4548457Z</validTimestamp>

       </ProductVariationInventory>

       <ProductVariationInventory>

         <partID>3279168</partID>

         <partDescription>16 oz Caturra Vacuum Tumbler</partDescription>

         <quantityAvailable>2000</quantityAvailable>

         <attributeColor>Purple</attributeColor>

         <entryType>exact</entryType>

         <validTimestamp>2014-07-01T19:17:48.4548457Z</validTimestamp>

       </ProductVariationInventory>

       <ProductVariationInventory>

         <partID>3279198</partID>

         <partDescription>16 oz Caturra Vacuum Tumbler</partDescription>

         <quantityAvailable>100</quantityAvailable>

         <attributeColor>Light Blue</attributeColor>

         <entryType>exact</entryType>

         <validTimestamp>2014-07-01T19:17:48.4548457Z</validTimestamp>

       </ProductVariationInventory>

     </ProductVariationInventoryArray>

     <ProductCompanionInventoryArray>

       <ProductCompanionInventory>

         <partID>62619</partID>

         <partDescription>FP04-FLOCK BAG</partDescription>

         <quantityAvailable>101446</quantityAvailable>

         <attributeColor>Black</attributeColor>

         <validTimestamp>2014-07-01T19:17:48.4704458Z</validTimestamp>

       </ProductCompanionInventory>

     </ProductCompanionInventoryArray>

   </Reply>

 </s:Body>

</s:Envelope>



C# / .NET

 

Requirements

 

The instructions and examples require the following:

 

 

The ServiceModel Metadata Utility Tool (Svcutil.exe) is included in the Windows Software Development Kit (SDK) for Windows 8.1

 

After the SDK is installed, ensure that C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\ is included in the system PATH variable so that the operating system can locate the ServiceModel Metadata Utility Tool (Svcutil.exe).

 

Data Contracts

 

A data contract is a formal agreement that describes the data to be exchanged between a service and  a client. Windows Communication Foundation (WCF) uses a serialization engine called the Data Contract Serializer to serialize and deserialize data (convert it to and from XML). These data contracts can be generated using the svcutil.exe or hand written. The handwritten Data Contracts can be found in the C# / .NET developer package.

 

 


 note_edit.pngWhen the ServiceModel Metadata Utility Tool (Svcutil.exe) is used to generate data contracts, the class names are prepended with ancestor element names. If this is undesirable, handwritten data and service contracts are included in the C# / .NET developer package.


 

 

Generate Contract

 

ServiceModel Metadata Utility Tool (Svcutil.exe) is used to generate service model code from metadata documents. This tool can be run in a build event.

 

To specify a build event

  1. In Solution Explorer, select the project for which you want to specify the build event.

  2. On the Project menu, click Properties.

  3. Select the Build Events tab.

  4. In the Pre-build event command line box, add  

 

svcutil /language:C# /out:$(SolutionDir)Path\vX_0_0\InventoryServiceContract.cs /n:*,PromoStandards.InventoryService.Contract.vX_X_X $(ProjectDir)\WSDLPath\InventoryService.wsdl $(ProjectDir)\WSDL\1.0.0\InventoryRequest.xsd $(ProjectDir)\WSDLPath\InventoryReply.xsd /serviceContract


vX_X_X corresponds to the the WSDL version (i.g., v1_0_0).

Path is the location of the data contact file.

WSDLPath is the location of the WSDL and additional schemas.

 

This will create the necessary service and data contracts.

 

Create a WCF Service Application

 

To create a WCF service

  1. On the File menu, point to New and then click Project.

  2. In the New Project dialog box, expand the Visual C# node and click WCF, followed by WCF Service Application. Click OK to open the project.

  3. In Solution Explorer, select IService.cs interface and delete it.

  4. Rename Service1.cs to an appropriate name.

  5. Open the renamed service class and alter it to implement the InventoryService interface (which is provided in the developer package or generated by the ServiceModel Metadata Utility Tool).

  6. Add an necessary code to the getInventoryLevels method.

 

Configure the WCF Service

 

Open the web.config file add the following to <system.serviceModel>

 

<bindings>

     <basicHttpBinding>

       <binding name="basicHttpBindingConfig">

         <security mode="None">

           <transport clientCredentialType="None" proxyCredentialType="None"/>

         </security>

       </binding>

     </basicHttpBinding>     

   </bindings>

   <services>

     <service name="CustomerInventoryService">

       <endpoint

         address=""

         binding="basicHttpBinding"

         bindingConfiguration="basicHttpBindingConfig"

         contract="PromoStandards.InventoryService.Contract.vX_X_X.InventoryService" />

       <endpoint address="mex"

         binding="mexHttpsBinding"

         contract="IMetadataExchange" />

     </service>

   </services>

   <behaviors>

     <serviceBehaviors>

       <behavior>

         <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->

         <serviceMetadata httpGetEnabled="true" externalMetadataLocation="../WSDLPath/InventoryService.wsdl"/>

         <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->

         <serviceDebug includeExceptionDetailInFaults="true"/>

       </behavior>

     </serviceBehaviors>

   </behaviors>

 

vX_X_X corresponds to the the WSDL version (i.g., v1_0_0).

WSDLPath is the location of the WSDL and additional schemas



Configure Local Web Server

 

 


 error.pngThe Visual Studio Development Server does not support SSL. To use SSL, the Web Server for the WCF Service project can be changed to use IIS Express.


 

 

  1. In Solution Explorer, right-click the name of the WCF Service project for which you want to specify a Web server, and then click Properties.

  2. In the Properties window, click the Web tab.

  3. Under Servers, select Local IIS Web server, and then select Use IIS Express.

  4. In Solution Explorer, select the WCF Service project

  5. On the View menu, click Property Pages.

  6. In the Project Properties Window set SSL Enabled to true

 

 


 error.pngVerify the WSDL’s soap address location matches the Project Url, which is defined in the Project Properties Window’s Web tab. 


 

 

Java



PHP