简体   繁体   English

Microsoft CommerceServer Web服务搜索条款

[英]Microsoft CommerceServer Web Service searchClause

i'm using microsoft commerce server and I recently learned how to use the xml web service. 我正在使用Microsoft Commerce Server,最近又学习了如何使用xml Web服务。 I need to update some products using the 'updateitems' method. 我需要使用“ updateitems”方法更新某些产品。

The SOAP envelope looks like this: SOAP信封如下所示:

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
<UpdateItems xmlns="http://schemas.microsoft.com/CommerceServer/2006/06/CatalogWebService">
  <catalogName>string</catalogName>
  <searchClause>string</searchClause>
  <propertyName>string</propertyName>
  <replacementValue />
  <classTypes>None or CategoryClass or ProductVariantClass or ProductClass or ProductFamilyClass or ProductFamilyForVariantsClass or ProductVariantsForFamilyClass or AllClassTypesClass</classTypes>
  <language>string</language>
</UpdateItems>
</soap:Body>
</soap:Envelope>

My request using nuSoap looks like this: 我使用nuSoap的请求如下所示:

$client = new nusoap_client($wsdl, TRUE);
$client->setCredentials('', '', 'ntlm');
$client->setUseCurl(true);
$client->useHTTPPersistentConnection();
$client->setCurlOption(CURLOPT_USERPWD, *);

$m = array(
'catalogName' => 'cat',
'propertyName => 'itemdesc',
'replacementValue' => 'somevalue'
);
$resp = ($client->call('UpdateItems', $m));

What I am not understanding is the searchClause. 我不了解的是searchClause。 I don't know what any of the table or columns are named and since I am working with sensitive data, and a lot of it, I don't want to test via trial and error. 我不知道任何表或列的名称,并且由于我使用的是敏感数据,而且其中有很多,所以我不想通过反复试验进行测试。 I want to do something like 'ProductID = 159999' in the search clause, but it is not having it. 我想在搜索子句中执行类似“ ProductID = 159999”的操作,但是它没有。

Couple of points of guidance: 指导要点:

  1. SearchClause properties: The searchclause allows you to build a where clause based on the properties in your _CatalogProducts table inside of your _ProductCatalog database where refers to the name of you catalog (as viewable in Commerce Server Catalog Manager) and refers to the name you gave to you CommerceServer Site SearchClause属性:Searchclause允许您基于_ProductCatalog数据库内_CatalogProducts表中的属性来构建where子句,其中where引用目录名称(在Commerce Server Catalog Manager中可见),并引用给定的名称您的CommerceServer网站

  2. Property Name: This property name you use here would correspond to the classType of the entity you are updating. 属性名称:您在此处使用的此属性名称将与您要更新的实体的classType相对应。 Click here to learn more about the various classtypes http://msdn.microsoft.com/en-us/library/ee784608(v=cs.20).aspx . 单击此处以了解有关各种类类型的更多信息http://msdn.microsoft.com/zh-cn/library/ee784608(v=cs.20).aspx To learn what properties are mapped to which entities, you could look in Commerce Server Catalog and Inventory Schema Manager. 若要了解将哪些属性映射到哪些实体,可以查看Commerce Server目录和库存模式管理器。 Here you will find all property definitions, product definitions, category definitions, and catalog definitions. 在这里,您将找到所有属性定义,产品定义,类别定义和目录定义。

Example search clause to update the list price of a red product variant of the tennis shoe whose productid is ABC123 and variant id (for the red variant color of the shoe, is ABC123-RED. I'm not familiar with nuSoap, but based on your example above, I think your code wuld look something like. Also, you would need to properly escape the single quotes in the searchClause below 搜索关键词示例,用于更新网球鞋的红色产品型号(产品编号为ABC123和产品型号ID(对于鞋的红色型号为ABC123-RED)的标价。我不熟悉nuSoap,但基于在上面的示例中,我认为您的代码将类似于以下内容。此外,您需要在下面的searchClause中正确转义单引号

$client = new nusoap_client($wsdl, TRUE);
$client->setCredentials('', '', 'ntlm');
$client->setUseCurl(true);
$client->useHTTPPersistentConnection();
$client->setCurlOption(CURLOPT_USERPWD, *);

$m = array(
'catalogName' => 'YourCatalogName',
'searchClause' => '(ProductId = ''ABC123'' AND VariantId = ''ABC123-RED'')',
'propertyName => 'Description',
'replacementValue' => 'Red is the new color for fall, check out these kicks!'
);
$resp = ($client->call('UpdateItems', $m));

Obviously if you have spaces in the property names, you will want to use [] as delimiters, as in "[My Custom Column]". 显然,如果属性名称中有空格,则需要使用[]作为分隔符,如“ [我的自定义列]”中所示。

The best thing to do is to first familiarize yourself with the SQL database tables where the product catalog is stored and then check out your current data configurations using Commerce Server Catalog and Inventory Manager and Commerce Server Catalog Manager for your current data instances. 最好的办法是先熟悉存储产品目录的SQL数据库表,然后使用Commerce Server Catalog和库存管理器以及Commerce Server Catalog Manager来检查当前数据实例的当前数据配置。

You may want to consider that Microsoft, then Cactus, then Ascentium and now Smith who owns the product have said for years that these ASMX based web services are going away, so you may just want to write your own service that consumes the API. 您可能想要考虑的是,微软,然后是Cactus,然后是Ascentium,现在是拥有该产品的Smith,多年来一直说这些基于ASMX的Web服务正在消失,因此您可能只想编写自己的使用API​​的服务。 I would recommend that for having greater control over the update. 我建议您更好地控制此更新。 If you are more comfortable with SQL, I would recommend diving deeper into the product catalog database I mentioned above, its a very simple structure and very easy to write SSIS or other bulk copy operations for. 如果您更喜欢SQL,我建议您更深入地研究我上面提到的产品目录数据库,它的结构非常简单,并且非常容易编写SSIS或其他批量复制操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM