web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Call CDX Real-Time Service from non-Windows clients (e.g. SoapUI)

(0) ShareShare
ReportReport
Posted on by

Hi guys,

I am evaluating different options on how to integrate our eCommerce with AX.

Currently I am trying to call the CDX Real-time Service directly using a tool called SoapUI. Once I can make it work, I am confident that our ESB software (Java based) will be able to call it too.
(I am aware there are probably other ways like deploying a Retail Server and then trying to call the REST APIs, but currently I am checking this particular option)

So what I have is:

  • Enterprise POS (the "old" POS aka simply "Retail POS") connected and working
  • A WSDL for the Real-time service (Thanks to Patrick Mouwen for help!)

The POS is talking to AX via HTTPS. I have traced a simple message (inquiring a Gift Card balance) via Fiddler. See below.

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="www.w3.org/.../soap-envelope" xmlns:a="www.w3.org/.../addressing" xmlns:u="docs.oasis-open.org/.../oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <s:Header>
      <a:Action s:mustUnderstand="1">schemas.microsoft.com/.../InvokeMethod&lt;/a:Action>
      <a:MessageID>urn:uuid:fd2086ed-8f38-4d37-8f10-e86d79bb36b1</a:MessageID>
      <a:ReplyTo>
         <a:Address>www.w3.org/.../anonymous&lt;/a:Address>
      </a:ReplyTo>
      <a:To s:mustUnderstand="1">rtsserver01.bla.cts.ads/.../Common&lt;/a:To>
      <o:Security xmlns:o="docs.oasis-open.org/.../oasis-200401-wss-wssecurity-secext-1.0.xsd" s:mustUnderstand="1">
         <u:Timestamp u:Id="_0">
            <u:Created>2015-12-04T11:21:59.729Z</u:Created>
            <u:Expires>2015-12-04T11:26:59.729Z</u:Expires>
         </u:Timestamp>
         <c:SecurityContextToken xmlns:c="schemas.xmlsoap.org/.../sc" u:Id="uuid-a20cd0f8-c0dd-4b20-9dda-28490d76cf10-7">
            <c:Identifier>urn:uuid:d83dac73-42dd-4ccd-aa3b-1f5824ce8737</c:Identifier>
         </c:SecurityContextToken>
         <Signature xmlns="www.w3.org/.../xmldsig">
            <SignedInfo>
               <CanonicalizationMethod Algorithm="www.w3.org/.../xml-exc-c14n" />
               <SignatureMethod Algorithm="www.w3.org/.../xmldsig" />
               <Reference URI="#_0">
                  <Transforms>
                     <Transform Algorithm="www.w3.org/.../xml-exc-c14n" />
                  </Transforms>
                  <DigestMethod Algorithm="www.w3.org/.../xmldsig" />
                  <DigestValue>DIG/eIGmYiLimrM0XXX6ELSEqOE=</DigestValue>
               </Reference>
            </SignedInfo>
            <SignatureValue>SiGpekEo+QBmjnJf9ZSOL9aRMOI=</SignatureValue>
            <KeyInfo>
               <o:SecurityTokenReference>
                  <o:Reference ValueType="schemas.xmlsoap.org/.../sct" URI="#uuid-a20cd0f8-c0dd-4b20-9dda-28490d76cf10-7" />
               </o:SecurityTokenReference>
            </KeyInfo>
         </Signature>
      </o:Security>
   </s:Header>
   <s:Body>
      <InvokeMethod xmlns="schemas.microsoft.com/.../TransactionService">
         <requestInfo xmlns:i="www.w3.org/.../XMLSchema-instance">
            <ClientType>AX2012.POS.ver6.3.1000.2139</ClientType>
            <Company>llp</Company>
            <Language>en-gb</Language>
            <ProfileId>Profile1</ProfileId>
         </requestInfo>
         <methodName>GetGiftCardBalance</methodName>
         <parameters xmlns:b="schemas.microsoft.com/.../Arrays" xmlns:i="www.w3.org/.../XMLSchema-instance">
            <b:anyType xmlns:c="www.w3.org/.../XMLSchema" i:type="c:string">GIFTCARD007</b:anyType>
         </parameters>
      </InvokeMethod>
   </s:Body>
</s:Envelope>


The Body part is relatively simple. It invokes a method in the X++ class RetailTransactionService and passes parameters. However, the Header part contains a lot of overhead. All of it looks like standardized info which is not Microsoft/WCF specific. 

I was able to load the WSDL into SoapUI and it has generated sample requests. However, sending these requests result in HTTP error 500 (internal server error). And this is something to expect as I am not setting any of these cryptic Header values. The error message is:

The message could not be processed. This is most likely because the action 'schemas.microsoft.com/.../InvokeMethod' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.

Which points to all the header information around security (and other) not being set.

So I guess my general question is: how easy is it to call the AX Real-time Service from a non-Windows client? Is it just my lack of knowledge of all the WS standards (WS-Addressing, WS-Security) or is it just not a feasible way to integrate a 3rd party eCommerce (using a non-Windows / non-WCF ESB)?

SoapUI_5F00_getGiftCardBalance.png

And the more specific question would be: does anybody know how to make this call in SoapUI?

Would it be easier (performance overhead aside) to leverage the "modern" Retail Server APIs?

Any help will be appreciated!

Thanks,
Waldemar

*This post is locked for comments

I have the same question (0)
  • nunomaia Profile Picture
    23 Moderator on at
    RE: AX 2012 R3 Retail: call CDX Real-Time Service from non-Windows clients (e.g. SoapUI)

    It Isn’t easy to manually create a WS-Security XML file. There are several fields that are time dependent, you must sign the message using a certificate, etc. If you change the timestamp, you must also create a new message digest using the certificate. There are several steps to create such kind of message.   It not impossible but I takes some time.

    I’m not in in mistake, in the past I had to create a XML file similar to a WS-Security format directly in AX, I took a couple of days due to certificates and other securities fields.  

    I don’t java world, but if you have a development kit ( like WCF in .NET ) that supports natively WS-Security, you could create a message that posts using those standards. Or manually create the XML file.  If you are having difficulties because of the WS-Security, you can expose the CDX classes as Web Services execute them externally. If you can install the MPOS server, you call that API, is it easier to use.

  • Community Member Profile Picture
    on at
    RE: AX 2012 R3 Retail: call CDX Real-Time Service from non-Windows clients (e.g. SoapUI)

    Hi Nuno. Thanks for sharing your experience.

    I agree it is not easy to generate this kind of message manually. I think what I really meant is how to configure a client (SopaUI, MuleSoft or any other) and also more importantly whether there will be any reasons why we shouldn't even try that.

    Anyway, I will keep trying to configure my tool as proof of concept that we can leverage AX Real-time service.

    Also I agree with you that installing the Retail Server used for MPOS might make it easier to use the real-time and asynchronous APIs, but this would be plan B for me. I worry that it adds unnecessary additional layer (performance, complexity), which we won't be using with POS anyway.

    DO you have experience in calling Retail Server APIs from some systems other than Microsoft own online store or MPOS?

    It's a shame I can't official documentation from Microsoft on whether we can use the Real-time service directly to integrate 3rd part non-Windows based eCommerce (or ESB middleware). It give me bad feeling that there might be something that will stop us from using Real-time service from a non-Microsoft POS client.

  • nunomaia Profile Picture
    23 Moderator on at
    RE: AX 2012 R3 Retail: call CDX Real-Time Service from non-Windows clients (e.g. SoapUI)

    I don’t have the experience in calling retail server API directly, but I created a small client in .NET and it did work without any issues.

    I have created the client in Visual Studio from the WSDL of Realtime Service.

    TransactionServiceClient client = new TransactionServiceClient("TSWsHttpEndpoint");
    client.ClientCredentials.UserName.UserName = "user";
    client.ClientCredentials.UserName.Password = "password";

    RequestInfo info = new RequestInfo()
    {
    ClientType = "AX2012.POS.ver6.3.1000.2139",
    Company = "usrt",
    Language = "en-gb",
    ProfileId = "profile1"
    };

    object[] parameters = {"123"};

    ServiceResponse response = client.InvokeMethod(info, "GetGiftCardBalance", parameters);

    This is your goal ? 

    Real-time server isn’t a documented API, therefore Microsoft can break the API compatibility in future upgrades.

  • nunomaia Profile Picture
    23 Moderator on at
    RE: AX 2012 R3 Retail: call CDX Real-Time Service from non-Windows clients (e.g. SoapUI)

    I forgot to mention, if you have some kind of development kit, that creates a client proxy in Java from a WSDL, it should work as easily as Visual studio .net. I don’t think that there is any reason why it shouldn’t work from a non-windows application, the security user / password, isn’t from AD but from is stored in AX database.  

    The biggest issue is to create the message security (RSA certificate, etc.). Visual studio handles all that complexity for you.

    I also changed the config file to force message transport security. I have inserted here the file config

     <system.serviceModel>

       <bindings>

         <netTcpBinding>

           <binding name="BufferedTCPBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transferMode="Buffered" listenBacklog="32" maxBufferPoolSize="67108864" maxBufferSize="10485760" maxConnections="16" maxReceivedMessageSize="10485760" portSharingEnabled="true">

             <readerQuotas maxStringContentLength="1048576" maxBytesPerRead="1048576" />

             <reliableSession enabled="true" inactivityTimeout="00:10:00" ordered="true" />

             <security mode="TransportWithMessageCredential">

               <transport clientCredentialType="None" />

               <message clientCredentialType="UserName" algorithmSuite="Default" />

             </security>

           </binding>

         </netTcpBinding>

         <wsHttpBinding>

           <binding name="WSHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" maxBufferPoolSize="10485760" maxReceivedMessageSize="1048576" textEncoding="utf-16" messageEncoding="Text" useDefaultWebProxy="true">

             <readerQuotas maxStringContentLength="1048576" maxBytesPerRead="1048576" />

             <security mode="TransportWithMessageCredential">

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

               <message clientCredentialType="UserName" algorithmSuite="Default" negotiateServiceCredential="true" />

             </security>

           </binding>

         </wsHttpBinding>

       </bindings>

       <client>

         <endpoint address="net.tcp://example.com:8402/RealtimeService/Service.svc/Commonn" binding="netTcpBinding" bindingConfiguration="BufferedTCPBinding" contract="ServiceReference1.ITransactionService" name="TSNetTcpEndpoint">

           <identity>

             <dns value="example.com" />

           </identity>

         </endpoint>

         <endpoint address="example.com:8401/RealtimeService/Service.svc/Common" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding" contract="ServiceReference1.ITransactionService" name="TSWsHttpEndpoint">

           <identity>

             <dns value="example.linkmsax.com" />

           </identity>

         </endpoint>

       </client>

     </system.serviceModel>

  • Community Member Profile Picture
    on at
    RE: AX 2012 R3 Retail: call CDX Real-Time Service from non-Windows clients (e.g. SoapUI)

    Hi Nuno,

    Yeah, I spend some time to call the real-time service from a .NET (Visual Studio) client too as I thought it will generate all the security in Header automatically. But I gave up, because it wouldn't really help us as we won't be using .NET. But yes, it would be a small step towards proving that we can reuse the Real-tiem service somehow.

    Thank you for sharing the VS code anyway! It looks very similar to mine and I will give it another go (this could be my plan C: to build something like a wrapper WCF service and expose it via HTTP with basic HTTP auth).

    Also thanks for the tip to force message transport security. This might help.

    Yeah, this is the main challenge: to generate all the security in Header (WS-Security standard?) and WS-Addressing standard (?) from a non .NET/WCF client or ESB system. The actual Body is simple.

    I managed to load the WSDL into SoapUI (Java/Apache based test client) and in generated sample requests which look the same as the messages between AX ePOS and RTS. Now I am playing with all the security settings in this tool.

    Will update here (original post) on my progress.

  • SergeyP Profile Picture
    2,928 on at
    RE: AX 2012 R3 Retail: call CDX Real-Time Service from non-Windows clients (e.g. SoapUI)

    >... DO you have experience in calling Retail Server APIs from some systems other than Microsoft own online store or MPOS? ...

    Please see whether this is something you are looking for: How to access Retail Server in managed code.

    As for non Microsoft platforms: Retail Server is ODATA Service and therefore can be easily consumed by any client which can work with HTTP. Retail Server hosts CRT and CRT knows how to talk to RTS, therefore, if you consume Retail Server you can build any client which will result (on server side) to RTS calls when needed.

  • Community Member Profile Picture
    on at
    RE: AX 2012 R3 Retail: call CDX Real-Time Service from non-Windows clients (e.g. SoapUI)

    Hi Sergey,

    This brings me a step forward, definitely. Thanks.

    I will read it in detail, but from a quick look I understood that you are using Visual Studio and added the DLL as reference. This is obviously something a Java or PHP based client wouldn't be able to do.

    In my experience as long as you stay within the cozy world of Microsoft (Visual Studio, WCF, .NET), Microsoft takes care of a lot of things for you (e.g. authentication).

    So it would be still nice to see an example of a client calling the APIs (Retail Server or whichever way) which is not based on Windows.

    As you wrote, theoretically since it is a HTTP/ODATA service, we should be able to call it. I'll keep trying.

  • SergeyP Profile Picture
    2,928 on at
    RE: AX 2012 R3 Retail: call CDX Real-Time Service from non-Windows clients (e.g. SoapUI)

    >... This is obviously something a Java or PHP based client wouldn't be able to do. ...

    There is one more type of the proxy which was shipped in CTP8 (this one is used by MPOS) that one was written in Type Script and therefore for clients which can natively work with Java Script.

    You can find the project in the SDK at I:\RetailSDK\Proxies\Proxies.Retail.TypeScript, that proxy logically is similar to the one described in the article I mentioned in previous post, so, there is a class ManagerFactory which expects RS URL and OUN, the class also provides the method getManager() to get specific manager.

    If, by some reason, JavaScript is not your option neither then you can still easily consume Retail Server by generating the library for the language/framework you are using, if you search online you should be able to find many client code generators for ODATA, some of the libraries are referenced here.

    And finally, if, by some reason you don't want/cannot generate a client proxy you still can consume RS by manually issuing request by using the language you want (the only requirement for that language is to be capable of issuing standard HTTP requests), for instance, to get the list of categories (equivalent to the call from the article) you just need to issue GET request https://PutYourServerNameHere.cloudax.test.dynamics.com/Commerce/Categories?$top=100

    with the header oun and value (depends on your channel) let's say 068

    As a result you should see status 200 (OK) in response and the response will contain JSON payload with categories corresponding to the channel you supplied via Operating Unit Number

    Similarly, to get the channel's configuration you should send POST request

    https://PutYourServerNameHere.cloudax.test.dynamics.com/Commerce/OrgUnits/GetOrgUnitConfiguration

    by also supplying the header and as a result you will see JSON payload describing channel configuration.

    So, you can call each and every method of RS by using this approach, the only difference for a specific query would be to supply query specific parameters.

  • Community Member Profile Picture
    on at
    RE: AX 2012 R3 Retail: call CDX Real-Time Service from non-Windows clients (e.g. SoapUI)

    What is the URL of WSDL for [quote user="Waldemar Pross"]

    Hi guys,

    I am evaluating different options on how to integrate our eCommerce with AX.

    Currently I am trying to call the CDX Real-time Service directly using a tool called SoapUI. Once I can make it work, I am confident that our ESB software (Java based) will be able to call it too.
    (I am aware there are probably other ways like deploying a Retail Server and then trying to call the REST APIs, but currently I am checking this particular option)

    So what I have is:

    • Enterprise POS (the "old" POS aka simply "Retail POS") connected and working
    • A WSDL for the Real-time service (Thanks to Patrick Mouwen for help!)

    The POS is talking to AX via HTTPS. I have traced a simple message (inquiring a Gift Card balance) via Fiddler. See below.

    <?xml version="1.0" encoding="UTF-8"?>
    <s:Envelope xmlns:s="www.w3.org/.../soap-envelope" xmlns:a="www.w3.org/.../addressing" xmlns:u="docs.oasis-open.org/.../oasis-200401-wss-wssecurity-utility-1.0.xsd">
       <s:Header>
          <a:Action s:mustUnderstand="1">schemas.microsoft.com/.../InvokeMethod&lt;/a:Action>
          <a:MessageID>urn:uuid:fd2086ed-8f38-4d37-8f10-e86d79bb36b1</a:MessageID>
          <a:ReplyTo>
             <a:Address>www.w3.org/.../anonymous&lt;/a:Address>
          </a:ReplyTo>
          <a:To s:mustUnderstand="1">rtsserver01.bla.cts.ads/.../Common&lt;/a:To>
          <o:Security xmlns:o="docs.oasis-open.org/.../oasis-200401-wss-wssecurity-secext-1.0.xsd" s:mustUnderstand="1">
             <u:Timestamp u:Id="_0">
                <u:Created>2015-12-04T11:21:59.729Z</u:Created>
                <u:Expires>2015-12-04T11:26:59.729Z</u:Expires>
             </u:Timestamp>
             <c:SecurityContextToken xmlns:c="schemas.xmlsoap.org/.../sc" u:Id="uuid-a20cd0f8-c0dd-4b20-9dda-28490d76cf10-7">
                <c:Identifier>urn:uuid:d83dac73-42dd-4ccd-aa3b-1f5824ce8737</c:Identifier>
             </c:SecurityContextToken>
             <Signature xmlns="www.w3.org/.../xmldsig">
                <SignedInfo>
                   <CanonicalizationMethod Algorithm="www.w3.org/.../xml-exc-c14n" />
                   <SignatureMethod Algorithm="www.w3.org/.../xmldsig" />
                   <Reference URI="#_0">
                      <Transforms>
                         <Transform Algorithm="www.w3.org/.../xml-exc-c14n" />
                      </Transforms>
                      <DigestMethod Algorithm="www.w3.org/.../xmldsig" />
                      <DigestValue>DIG/eIGmYiLimrM0XXX6ELSEqOE=</DigestValue>
                   </Reference>
                </SignedInfo>
                <SignatureValue>SiGpekEo+QBmjnJf9ZSOL9aRMOI=</SignatureValue>
                <KeyInfo>
                   <o:SecurityTokenReference>
                      <o:Reference ValueType="schemas.xmlsoap.org/.../sct" URI="#uuid-a20cd0f8-c0dd-4b20-9dda-28490d76cf10-7" />
                   </o:SecurityTokenReference>
                </KeyInfo>
             </Signature>
          </o:Security>
       </s:Header>
       <s:Body>
          <InvokeMethod xmlns="schemas.microsoft.com/.../TransactionService">
             <requestInfo xmlns:i="www.w3.org/.../XMLSchema-instance">
                <ClientType>AX2012.POS.ver6.3.1000.2139</ClientType>
                <Company>llp</Company>
                <Language>en-gb</Language>
                <ProfileId>Profile1</ProfileId>
             </requestInfo>
             <methodName>GetGiftCardBalance</methodName>
             <parameters xmlns:b="schemas.microsoft.com/.../Arrays" xmlns:i="www.w3.org/.../XMLSchema-instance">
                <b:anyType xmlns:c="www.w3.org/.../XMLSchema" i:type="c:string">GIFTCARD007</b:anyType>
             </parameters>
          </InvokeMethod>
       </s:Body>
    </s:Envelope>


    The Body part is relatively simple. It invokes a method in the X++ class RetailTransactionService and passes parameters. However, the Header part contains a lot of overhead. All of it looks like standardized info which is not Microsoft/WCF specific. 

    I was able to load the WSDL into SoapUI and it has generated sample requests. However, sending these requests result in HTTP error 500 (internal server error). And this is something to expect as I am not setting any of these cryptic Header values. The error message is:

    The message could not be processed. This is most likely because the action 'schemas.microsoft.com/.../InvokeMethod' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.

    Which points to all the header information around security (and other) not being set.

    So I guess my general question is: how easy is it to call the AX Real-time Service from a non-Windows client? Is it just my lack of knowledge of all the WS standards (WS-Addressing, WS-Security) or is it just not a feasible way to integrate a 3rd party eCommerce (using a non-Windows / non-WCF ESB)?

    SoapUI_5F00_getGiftCardBalance.png

    And the more specific question would be: does anybody know how to make this call in SoapUI?

    Would it be easier (performance overhead aside) to leverage the "modern" Retail Server APIs?

    Any help will be appreciated!

    Thanks,
    Waldemar

    [/quote][quote user="Waldemar Pross"]

    Hi guys,

    I am evaluating different options on how to integrate our eCommerce with AX.

    Currently I am trying to call the CDX Real-time Service directly using a tool called SoapUI. Once I can make it work, I am confident that our ESB software (Java based) will be able to call it too.
    (I am aware there are probably other ways like deploying a Retail Server and then trying to call the REST APIs, but currently I am checking this particular option)

    So what I have is:

    • Enterprise POS (the "old" POS aka simply "Retail POS") connected and working
    • A WSDL for the Real-time service (Thanks to Patrick Mouwen for help!)

    The POS is talking to AX via HTTPS. I have traced a simple message (inquiring a Gift Card balance) via Fiddler. See below.

    <?xml version="1.0" encoding="UTF-8"?>
    <s:Envelope xmlns:s="www.w3.org/.../soap-envelope" xmlns:a="www.w3.org/.../addressing" xmlns:u="docs.oasis-open.org/.../oasis-200401-wss-wssecurity-utility-1.0.xsd">
       <s:Header>
          <a:Action s:mustUnderstand="1">schemas.microsoft.com/.../InvokeMethod&lt;/a:Action>
          <a:MessageID>urn:uuid:fd2086ed-8f38-4d37-8f10-e86d79bb36b1</a:MessageID>
          <a:ReplyTo>
             <a:Address>www.w3.org/.../anonymous&lt;/a:Address>
          </a:ReplyTo>
          <a:To s:mustUnderstand="1">rtsserver01.bla.cts.ads/.../Common&lt;/a:To>
          <o:Security xmlns:o="docs.oasis-open.org/.../oasis-200401-wss-wssecurity-secext-1.0.xsd" s:mustUnderstand="1">
             <u:Timestamp u:Id="_0">
                <u:Created>2015-12-04T11:21:59.729Z</u:Created>
                <u:Expires>2015-12-04T11:26:59.729Z</u:Expires>
             </u:Timestamp>
             <c:SecurityContextToken xmlns:c="schemas.xmlsoap.org/.../sc" u:Id="uuid-a20cd0f8-c0dd-4b20-9dda-28490d76cf10-7">
                <c:Identifier>urn:uuid:d83dac73-42dd-4ccd-aa3b-1f5824ce8737</c:Identifier>
             </c:SecurityContextToken>
             <Signature xmlns="www.w3.org/.../xmldsig">
                <SignedInfo>
                   <CanonicalizationMethod Algorithm="www.w3.org/.../xml-exc-c14n" />
                   <SignatureMethod Algorithm="www.w3.org/.../xmldsig" />
                   <Reference URI="#_0">
                      <Transforms>
                         <Transform Algorithm="www.w3.org/.../xml-exc-c14n" />
                      </Transforms>
                      <DigestMethod Algorithm="www.w3.org/.../xmldsig" />
                      <DigestValue>DIG/eIGmYiLimrM0XXX6ELSEqOE=</DigestValue>
                   </Reference>
                </SignedInfo>
                <SignatureValue>SiGpekEo+QBmjnJf9ZSOL9aRMOI=</SignatureValue>
                <KeyInfo>
                   <o:SecurityTokenReference>
                      <o:Reference ValueType="schemas.xmlsoap.org/.../sct" URI="#uuid-a20cd0f8-c0dd-4b20-9dda-28490d76cf10-7" />
                   </o:SecurityTokenReference>
                </KeyInfo>
             </Signature>
          </o:Security>
       </s:Header>
       <s:Body>
          <InvokeMethod xmlns="schemas.microsoft.com/.../TransactionService">
             <requestInfo xmlns:i="www.w3.org/.../XMLSchema-instance">
                <ClientType>AX2012.POS.ver6.3.1000.2139</ClientType>
                <Company>llp</Company>
                <Language>en-gb</Language>
                <ProfileId>Profile1</ProfileId>
             </requestInfo>
             <methodName>GetGiftCardBalance</methodName>
             <parameters xmlns:b="schemas.microsoft.com/.../Arrays" xmlns:i="www.w3.org/.../XMLSchema-instance">
                <b:anyType xmlns:c="www.w3.org/.../XMLSchema" i:type="c:string">GIFTCARD007</b:anyType>
             </parameters>
          </InvokeMethod>
       </s:Body>
    </s:Envelope>


    The Body part is relatively simple. It invokes a method in the X++ class RetailTransactionService and passes parameters. However, the Header part contains a lot of overhead. All of it looks like standardized info which is not Microsoft/WCF specific. 

    I was able to load the WSDL into SoapUI and it has generated sample requests. However, sending these requests result in HTTP error 500 (internal server error). And this is something to expect as I am not setting any of these cryptic Header values. The error message is:

    The message could not be processed. This is most likely because the action 'schemas.microsoft.com/.../InvokeMethod' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.

    Which points to all the header information around security (and other) not being set.

    So I guess my general question is: how easy is it to call the AX Real-time Service from a non-Windows client? Is it just my lack of knowledge of all the WS standards (WS-Addressing, WS-Security) or is it just not a feasible way to integrate a 3rd party eCommerce (using a non-Windows / non-WCF ESB)?

    SoapUI_5F00_getGiftCardBalance.png

    And the more specific question would be: does anybody know how to make this call in SoapUI?

    Would it be easier (performance overhead aside) to leverage the "modern" Retail Server APIs?

    Any help will be appreciated!

    Thanks,
    Waldemar

    [/quote][quote user="Waldemar Pross"]

    Hi guys,

    I am evaluating different options on how to integrate our eCommerce with AX.

    Currently I am trying to call the CDX Real-time Service directly using a tool called SoapUI. Once I can make it work, I am confident that our ESB software (Java based) will be able to call it too.
    (I am aware there are probably other ways like deploying a Retail Server and then trying to call the REST APIs, but currently I am checking this particular option)

    So what I have is:

    • Enterprise POS (the "old" POS aka simply "Retail POS") connected and working
    • A WSDL for the Real-time service (Thanks to Patrick Mouwen for help!)

    The POS is talking to AX via HTTPS. I have traced a simple message (inquiring a Gift Card balance) via Fiddler. See below.

    <?xml version="1.0" encoding="UTF-8"?>
    <s:Envelope xmlns:s="www.w3.org/.../soap-envelope" xmlns:a="www.w3.org/.../addressing" xmlns:u="docs.oasis-open.org/.../oasis-200401-wss-wssecurity-utility-1.0.xsd">
       <s:Header>
          <a:Action s:mustUnderstand="1">schemas.microsoft.com/.../InvokeMethod&lt;/a:Action>
          <a:MessageID>urn:uuid:fd2086ed-8f38-4d37-8f10-e86d79bb36b1</a:MessageID>
          <a:ReplyTo>
             <a:Address>www.w3.org/.../anonymous&lt;/a:Address>
          </a:ReplyTo>
          <a:To s:mustUnderstand="1">rtsserver01.bla.cts.ads/.../Common&lt;/a:To>
          <o:Security xmlns:o="docs.oasis-open.org/.../oasis-200401-wss-wssecurity-secext-1.0.xsd" s:mustUnderstand="1">
             <u:Timestamp u:Id="_0">
                <u:Created>2015-12-04T11:21:59.729Z</u:Created>
                <u:Expires>2015-12-04T11:26:59.729Z</u:Expires>
             </u:Timestamp>
             <c:SecurityContextToken xmlns:c="schemas.xmlsoap.org/.../sc" u:Id="uuid-a20cd0f8-c0dd-4b20-9dda-28490d76cf10-7">
                <c:Identifier>urn:uuid:d83dac73-42dd-4ccd-aa3b-1f5824ce8737</c:Identifier>
             </c:SecurityContextToken>
             <Signature xmlns="www.w3.org/.../xmldsig">
                <SignedInfo>
                   <CanonicalizationMethod Algorithm="www.w3.org/.../xml-exc-c14n" />
                   <SignatureMethod Algorithm="www.w3.org/.../xmldsig" />
                   <Reference URI="#_0">
                      <Transforms>
                         <Transform Algorithm="www.w3.org/.../xml-exc-c14n" />
                      </Transforms>
                      <DigestMethod Algorithm="www.w3.org/.../xmldsig" />
                      <DigestValue>DIG/eIGmYiLimrM0XXX6ELSEqOE=</DigestValue>
                   </Reference>
                </SignedInfo>
                <SignatureValue>SiGpekEo+QBmjnJf9ZSOL9aRMOI=</SignatureValue>
                <KeyInfo>
                   <o:SecurityTokenReference>
                      <o:Reference ValueType="schemas.xmlsoap.org/.../sct" URI="#uuid-a20cd0f8-c0dd-4b20-9dda-28490d76cf10-7" />
                   </o:SecurityTokenReference>
                </KeyInfo>
             </Signature>
          </o:Security>
       </s:Header>
       <s:Body>
          <InvokeMethod xmlns="schemas.microsoft.com/.../TransactionService">
             <requestInfo xmlns:i="www.w3.org/.../XMLSchema-instance">
                <ClientType>AX2012.POS.ver6.3.1000.2139</ClientType>
                <Company>llp</Company>
                <Language>en-gb</Language>
                <ProfileId>Profile1</ProfileId>
             </requestInfo>
             <methodName>GetGiftCardBalance</methodName>
             <parameters xmlns:b="schemas.microsoft.com/.../Arrays" xmlns:i="www.w3.org/.../XMLSchema-instance">
                <b:anyType xmlns:c="www.w3.org/.../XMLSchema" i:type="c:string">GIFTCARD007</b:anyType>
             </parameters>
          </InvokeMethod>
       </s:Body>
    </s:Envelope>


    The Body part is relatively simple. It invokes a method in the X++ class RetailTransactionService and passes parameters. However, the Header part contains a lot of overhead. All of it looks like standardized info which is not Microsoft/WCF specific. 

    I was able to load the WSDL into SoapUI and it has generated sample requests. However, sending these requests result in HTTP error 500 (internal server error). And this is something to expect as I am not setting any of these cryptic Header values. The error message is:

    The message could not be processed. This is most likely because the action 'schemas.microsoft.com/.../InvokeMethod' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.

    Which points to all the header information around security (and other) not being set.

    So I guess my general question is: how easy is it to call the AX Real-time Service from a non-Windows client? Is it just my lack of knowledge of all the WS standards (WS-Addressing, WS-Security) or is it just not a feasible way to integrate a 3rd party eCommerce (using a non-Windows / non-WCF ESB)?

    SoapUI_5F00_getGiftCardBalance.png

    And the more specific question would be: does anybody know how to make this call in SoapUI?

    Would it be easier (performance overhead aside) to leverage the "modern" Retail Server APIs?

    Any help will be appreciated!

    Thanks,
    Waldemar

    [/quote]?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans