Inheritance: MWSClientCsRuntime.AbstractMwsObject, IMWSResponse
Ejemplo n.º 1
0
        private static string GetProductAttribute( GetMatchingProductForIdResponse response, string path )
        {
            var xmlElement = ( XmlElement ) response.GetMatchingProductForIdResult[ 0 ].Products.Product[ 0 ].AttributeSets.Any[ 0 ];
            var xmlContent = ProductsUtil.FormatXml( xmlElement );
            var xmlDoc = new XmlDocument {
                InnerXml = xmlContent,
            };
            var namespaceManager = new XmlNamespaceManager( xmlDoc.NameTable );
            namespaceManager.AddNamespace( "ns2", "http://mws.amazonservices.com/schema/Products/2011-10-01/default.xsd" );

            var itemIdNode = xmlDoc.SelectSingleNode( path, namespaceManager );

            return itemIdNode != null ? itemIdNode.InnerText : null;
        }
Ejemplo n.º 2
0
 private static string GetProductTitle( GetMatchingProductForIdResponse response )
 {
     return GetProductAttribute( response, "/ns2:ItemAttributes/ns2:Title" );
 }
Ejemplo n.º 3
0
 private static string GetProductSmallImageUrl( GetMatchingProductForIdResponse response )
 {
     return GetProductAttribute( response, "/ns2:ItemAttributes/ns2:SmallImage/ns2:URL" );
 }
Ejemplo n.º 4
0
 private static string GeProductAsinId( GetMatchingProductForIdResponse response )
 {
     return response.GetMatchingProductForIdResult[ 0 ].Products.Product[ 0 ].Identifiers.MarketplaceASIN.ASIN;
 }
Ejemplo n.º 5
0
 private static void CheckForErrors( GetMatchingProductForIdResponse response )
 {
     if( response.GetMatchingProductForIdResult[ 0 ].IsSetError() ) {
         throw new SpreadbotException( response.ToXML() );
     }
 }