Содержание

Примеры запросов и ответов метода GetOrder

Запрос XmlOverHttp

GET https://sandbox.mont.ru/Version2/Service/B2BServiceV2Xml.svc/GetOrder?ordernumber=asf1

Ответ XmlOverHttp

<?xml version="1.0" encoding="utf-8"?>
<GetOrderResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <GetOrderResult>
    <Data>
      <OrderLines>
        <OrderLineContract>
          <Id>00000000-0000-0000-0000-000000000000</Id>
          <OrderLineId>83296</OrderLineId>
          <OrderLineNum>abc1</OrderLineNum>
          <DateCreated>2016-04-03T16:42:34.0352558</DateCreated>
          <PartNum>ABC-11111</PartNum>
          <Quantity>1</Quantity>
          <TotalSumm>1122</TotalSumm>
          <ItemPrice>1122</ItemPrice>
          <Currency>RUR</Currency>
          <OrderStatus>Successed</OrderStatus>
          <Keys>
            <OrderKeyContract>
              <ActiveKey>DHBG-7PNQ-DFCW-KPAY</ActiveKey>
              <DateAdd>2016-04-03T16:42:56.49</DateAdd>
              <VendorClientTransactionId>4acd03a9-69ca-43c4-837a-e8a198bd4186</VendorClientTransactionId>
              <KeyTypeId>3</KeyTypeId>
              <Description>Activation Key</Description>
            </OrderKeyContract>
          </Keys>
          <Links>
            <OrderLinkContract>
              <Link>http://test-url-for-abc-11111.tam</Link>
              <DateAdd>2016-04-03T16:42:56.49</DateAdd>
              <VendorClientTransactionId>4acd03a9-69ca-43c4-837a-e8a198bd4186</VendorClientTransactionId>
              <LinkTypeId>1</LinkTypeId>
              <Description>ссылка на скачивание</Description>
            </OrderLinkContract>
          </Links>
          <Files/>
          <MontSubscriberId>00000000-0000-0000-0000-000000000000</MontSubscriberId>
          <ErrorCode>0</ErrorCode>
        </OrderLineContract>
        <OrderLineContract>
          <Id>00000000-0000-0000-0000-000000000000</Id>
          <OrderLineId>83297</OrderLineId>
          <OrderLineNum>ghjk1</OrderLineNum>
          <DateCreated>2016-04-03T16:42:34.0352558</DateCreated>
          <PartNum>ABC-11111</PartNum>
          <Quantity>1</Quantity>
          <TotalSumm>1122</TotalSumm>
          <ItemPrice>1122</ItemPrice>
          <Currency>RUR</Currency>
          <OrderStatus>Successed</OrderStatus>
          <Keys>
            <OrderKeyContract>
              <ActiveKey>DHBG-7PNQ-DFCW-KPAY</ActiveKey>
              <DateAdd>2016-04-03T16:42:56.49</DateAdd>
              <VendorClientTransactionId>9a322f30-d390-4fee-b5dc-0bdc765e64fa</VendorClientTransactionId>
              <KeyTypeId>3</KeyTypeId>
              <Description>Activation Key</Description>
            </OrderKeyContract>
          </Keys>
          <Links>
            <OrderLinkContract>
              <Link>http://test-url-for-abc-11111.tam</Link>
              <DateAdd>2016-04-03T16:42:56.49</DateAdd>
              <VendorClientTransactionId>9a322f30-d390-4fee-b5dc-0bdc765e64fa</VendorClientTransactionId>
              <LinkTypeId>1</LinkTypeId>
              <Description>ссылка на скачивание</Description>
            </OrderLinkContract>
          </Links>
          <Files/>
          <MontSubscriberId>00000000-0000-0000-0000-000000000000</MontSubscriberId>
          <ErrorCode>0</ErrorCode>
        </OrderLineContract>
      </OrderLines>
      <OrderNum>asf1</OrderNum>
      <DateCreated>2016-04-03T16:42:34.007</DateCreated>
      <OrderStatus>Successed</OrderStatus>
    </Data>
    <IsError>false</IsError>
    <ErrorCode>0</ErrorCode>
    <Errors/>
  </GetOrderResult>
</GetOrderResponse>

Запрос SOAP

POST https://sandbox.mont.ru/Version2/Service/B2BServiceV2.svc
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  <s:Header>
    <a:Action s:mustUnderstand="1">http://tempuri.org/IB2BServiceV2/GetOrder</a:Action>
    <a:ReplyTo>
      <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
    </a:ReplyTo>
    <a:To s:mustUnderstand="1">https://sandbox.mont.ru/Version2/Service/B2BServiceV2.svc</a:To>
    <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <o:UsernameToken>
        <o:Username>username</o:Username>
        <o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</o:Password>
      </o:UsernameToken>
    </o:Security>
  </s:Header>
  <s:Body>
    <GetOrder xmlns="http://tempuri.org/">
        <orderNumber>ed-222222</orderNumber>
    </GetOrder>
  </s:Body>
</s:Envelope>

Ответ SOAP

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  <s:Header>
    <a:Action s:mustUnderstand="1">http://tempuri.org/IB2BServiceV2/GetOrderResponse</a:Action>
    <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <u:Timestamp u:Id="_0">
        <u:Created>2015-10-28T12:52:04.067Z</u:Created>
        <u:Expires>2015-10-28T12:57:04.067Z</u:Expires>
      </u:Timestamp>
    </o:Security>
  </s:Header>
  <s:Body>
    <GetOrderResponse xmlns="http://tempuri.org/">
      <GetOrderResult xmlns:b="http://schemas.datacontract.org/2004/07/WebStore2.B2B.Version2.Contracts.Responses" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <b:Data xmlns:c="http://schemas.datacontract.org/2004/07/WebStore2.B2B.Version2.Contracts">
          <c:DateCreated>2015-10-28T14:14:22.873</c:DateCreated>
          <c:OrderLines>
            <c:OrderLineContract>
              <c:Action i:nil="true"/>
              <c:Currency>RUR</c:Currency>
              <c:DateCreated>2015-10-28T14:14:22.876949</c:DateCreated>
              <c:EndUserInfo i:nil="true" xmlns:d="http://schemas.datacontract.org/2004/07/WebStore2.B2B.Version2.Contracts.UserInfo"/>
              <c:ErrorCode>0</c:ErrorCode>
              <c:ErrorText i:nil="true"/>
              <c:Files/>
              <c:ItemPrice>16950</c:ItemPrice>
              <c:Keys>
                <c:OrderKeyContract>
                  <c:ActiveKey>THCYX-QGKXB-2T7MK-7D9VC-HKGPW</c:ActiveKey>
                  <c:DateAdd>2015-10-28T14:14:24.113</c:DateAdd>
                  <c:Description>Token which must be exchanged for a key to activate a product.</c:Description>
                  <c:KeyTypeId>1</c:KeyTypeId>
                  <c:VendorClientTransactionId>e151926a-214f-49f3-8e73-e8e0fa3ca0e0</c:VendorClientTransactionId>
                </c:OrderKeyContract>
              </c:Keys>
              <c:Links>
                <c:OrderLinkContract>
                  <c:DateAdd>2015-10-28T14:14:24.167</c:DateAdd>
                  <c:Description>Points to a Microsoft website to redeem the token provided.</c:Description>
                  <c:Link>https://setup.officeppe.com/?token=DmszLXlh5SLtY2%2bxvrQQSXrnsuPwrloLazfYgwaigAyNSighQMvpG%2bjWUbRePBJV6UIwRpCuBn4v1payX6LQTvj41DyTfRKNsqt0BbyKcre%2foIzTgQ4gJQsgnoZWfPKAFh8R8XBSeuxsCT6ubuhbb5hUH9dUmMysUOQASJ413%2f0%2fC5uS5n8mhqZ9vxV3yNhDfMWm8wHg%2blpg82IEziJxdbF9ZD26hUcpr5cIUk1b3IbpTa2yTFpXFf61Abiv%2bZgfCa%2bnEoHX7YAgoT3a6xCx9sPp0l06c0lpyNQZhfmcT3rMJftwSDBUxtQSIHqw8g%2bzT3z%2bXu5QF929hjrtcD9bpg%3d%3d&amp;ctid=e151926a-214f-49f3-8e73-e8e0fa3ca0e0</c:Link>
                  <c:LinkTypeId>2</c:LinkTypeId>
                  <c:VendorClientTransactionId>e151926a-214f-49f3-8e73-e8e0fa3ca0e0</c:VendorClientTransactionId>
                </c:OrderLinkContract>
              </c:Links>
              <c:MontSubscriberId>00000000-0000-0000-0000-000000000000</c:MontSubscriberId>
              <c:OrderLineNum>ED-008543-1</c:OrderLineNum>
              <c:OrderStatus>Successed</c:OrderStatus>
              <c:PartNum>ABC-77777</c:PartNum>
              <c:Quantity>1</c:Quantity>
              <c:SubscriptionId i:nil="true"/>
              <c:TotalSumm>16950</c:TotalSumm>
            </c:OrderLineContract>
          </c:OrderLines>
          <c:OrderNum>ED-008543</c:OrderNum>
          <c:OrderStatus>Successed</c:OrderStatus>
        </b:Data>
        <b:ErrorCode>0</b:ErrorCode>
        <b:ErrorText i:nil="true"/>
        <b:Errors/>
        <b:IsError>false</b:IsError>
      </GetOrderResult>
    </GetOrderResponse>
  </s:Body>
</s:Envelope>
Стоит обратить внимание, что у вендора Microsoft есть товары, для которых поле FulfillmentType = 1. Для таких товаров вендор ограничил срок действия ссылки 24 часа. Если получателю требуется актуальная ссылка, то ее необходимо запрашивать с помощью того же метода GetOrder. В ответе метода будут содержаться актуальные на момент вызова ссылки.