CData Python Connector for Sage 50 UK

Build 23.0.8839

接続の確立

コネクタ内で利用可能なオブジェクトは、"cdata.sage50uk" モジュールからアクセスできます。モジュールのオブジェクトを直接使用するには:

  1. モジュールを以下のようにインポートします。
    import cdata.sage50uk as mod
  2. 接続を確立するには、以下のような適切な接続文字列を使用してコネクタオブジェクトからconnect() メソッドを呼び出します。
    mod.connect("URL=http://localhost:5493/sdata/accounts50/GCRM/{C4C863BE-B098-4A7D-A78B-D7A92B8ADB59};User=Manager;Password=xxxxxx;")

接続の前に

v28 以降では、Sage 50 UK のドライバーを使用する前に、Sdata アダプターをインストールする必要があります。詳しくは、Sage 50 UK ドキュメントを参照してください。

Sage 50 UK への接続

本製品 は、Sage 50 UK のインストールに含まれるSData REST API 経由でSage 50 UK データに接続します。SData では、ローカルの企業データセットやネットワークドライブ上のデータセットにアクセスできます。

Sage SData Service を設定したのち、以下の手順で接続すると、URL プロパティに希望する企業データセットのアドレスが設定されます。アドレスを取得するには、以下を行います。

  1. Sage 50 UK ソフトウェアを開いていない場合は、開きます。
  2. Tools -> Internet Options を選択します。
  3. Sdatasettings タブを選択します。
  4. 接続したいSage 50 ソフトウェアアプリケーションの横にあるDetails をクリックします。企業名のリストと対応するデータセットのアドレスを含むウィンドウが開きます。
  5. URL プロパティを、目的の企業の横にあるアドレスフィールドの値に設定します。

Sage 50 UK への認証

User プロパティとPassword プロパティに、有効なSage 50 UK ユーザー資格情報を設定する必要があります。これらの値は、Sage 50 UK ソフトウェアにログインするために使用される値と同じになります。SData サービスへのHTTP ダイジェストで認証するには、AuthScheme をDigest に設定します。それ以外の場合は、Basic AuthScheme が使用されます。

Note:接続先のデータセットが表示されない場合は、Sage 50 UK フォルダの場所の権限が正しくない可能性があります。ネットワークドライブ上のデータセットに接続する場合は、次のことを確認してください。

  • SData プロバイダとして使用しているマシン上のフォルダへのUNC パスを使用します。
  • SData サービスのログイン権限は、ネットワーク共有またはマップドライブに対する完全な権限を持つユーザーに設定します。

Starting the SData Service

The CData Python Connector for Sage 50 UK connects to Sage 50 UK via the Sage SData service (which is Sage's Web toolkit for connecting to Sage instances) that is built into the Sage 50 UK software. SData allows for remote access to Sage software applications. By default, Sage UK 2015 instances will have SData turned on and ready for use.

You can follow the steps below to verify that the SData service is started.

  1. If you have not already done so, open Sage 50.
  2. Navigate to Tools > Internet Options. The Internet Options window is displayed.
  3. Select the Sdatasettings tab. A list is displayed of Sage software applications that are currently available.
  4. To turn the SData service on for the application, select the On option.
  5. If the SData Service Status does not read "SData is currently running", click the Advanced button.
  6. In the dialog that is displayed, specify the Port Number desired when making the connection and click the Restart button.
  7. If the Windows Firewall button is enabled, click this button to unblock the port. If you have any additional firewalls on the machine, ensure that they are configured to allow connections to be made on the specified port number.

Once you apply any changes, you can then establish a connection to your Sage 50 UK software.

Enabling HTTPS Support

The Sage SData service provides secure and encrypted connections via HTTPS. Data confidentiality and the authenticity of the server are provided by digital certificates. If you do not have a certificate, use IIS to generate a self-signed certificate.

You can follow the steps below to configure the SData service to use a certificate; the 本製品 will validate this certificate against the system trust store by default. If you generated a self-signed certificate, you can add the certificate to this certificate store or set SSLServerCert.

See 高度な機能 for more information on configuring the 本製品 for HTTPS.

Fulfilling the Certificate Requirements

The certificate has the following requirements:

  • The certificate must have a full valid trust chain.
  • The common name (CN) for the certificate must match the machine/domain name where the SData service is running. To ensure that the CN is correct, generate the self-signed certificate on the machine where Sage 50 SData is running.
  • The certificate must be added to the personal My certificate store for the Local Machine account.

Configuring the SData Service for TLS/SSL

You can then configure the SData service to use the certificate:

  1. Navigate to C:\Program Files (x86)\Common Files\Sage SData and open Sage.SData.Service.Config.UI.exe.
  2. Click the Advanced button. The SData Configuration window is displayed.
  3. Select the Enable HTTPS Access option and select the port desired.
  4. If you have any firewalls on your machine, make sure the ports specified are not blocked.
  5. Click the button next to the Certificate box.
  6. In the resulting dialog, select the certificate.

    If you select a certificate and do not see the certificate name populated in the Certificate textbox, this is most likely due to missing extended properties within the certificate. The extended properties include thumbprint, thumbprint algorithm, key usage, and enhanced key usage.

    Use IIS to avoid this issue: IIS automatically populates these fields when generating a self-signed certificate.

  7. Click OK to restart the server.
  8. Verify that the Enable HTTPS option is selected in the SData configuration window.

Troubleshooting

If the SData configuration window is closed and reopened but the Enable HTTPS option is not enabled, this is most likely caused by the Sage.SData.Service.exe.config file not being updated properly. Follow the steps below to use the alternate configuration file below.

You will need the certificate thumbprint. Note that the thumbprint data includes spaces. The thumbprint data can be obtained using Windows services. You can also access the thumbprint in the SData configuration window:

  1. If you have not already done so, open the Sage.SData.Service.Config.UI.exe application and open the advanced settings.
  2. Click the button next to the Certificate box.
  3. In the Windows security dialog, click "Click here to view certificate properties". The Certificate Details window is displayed.
  4. On the Details tab, copy the value in the Thumbprint field.
Use this value in the CertificateLookupValue setting in the configuration file. For example:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Sage.SData.Service.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="Sage.Integration.Server.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="Sage.Common.Syndication.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<Sage.SData.Service.Properties.Settings>
<setting name="DigestTimeout" serializeAs="String">
<value>12000000000</value>
</setting>
<setting name="EnableBasicAuthentication" serializeAs="String">
<value>True</value>
</setting>
<setting name="WebAppPath" serializeAs="String">
<value />
</setting>
<setting name="EnableSSL" serializeAs="String">
<value>True</value>
</setting>
<setting name="Port" serializeAs="String">
<value>443</value>
</setting>
</Sage.SData.Service.Properties.Settings>
<Sage.Integration.Server.Properties.Settings>
<setting name="EnableBroadcast" serializeAs="String">
<value>False</value>
</setting>
</Sage.Integration.Server.Properties.Settings>
<Sage.Common.Syndication.Properties.Settings>
<setting name="IPAddress" serializeAs="String">
<value />
</setting>
<setting name="Server" serializeAs="String">
<value>sdata</value>
</setting>
<setting name="EnableSSLPort" serializeAs="String">
<value>True</value>
</setting>
<setting name="Port" serializeAs="String">
<value>5493</value>
</setting>
<setting name="SettingsProviderType" serializeAs="String">
<value>Sage.Common.Syndication.ConfigurationSyndicationSettings, Sage.Common.Syndication</value>
</setting>
<setting name="PathPrefix" serializeAs="String">
<value />
</setting>
<setting name="DoNotUseRegistry" serializeAs="String">
<value>False</value>
</setting>
<setting name="EnableStandardPort" serializeAs="String">
<value>True</value>
</setting>
<setting name="SSLPort" serializeAs="String">
<value>5494</value>
</setting>
<setting name="CertificateLookupValue" serializeAs="String">
<value>ENTER YOUR CERTIFICATE THUMBPRINT HERE</value>
</setting>
<setting name="CertificateLookupType" serializeAs="String">
<value>Thumbprint</value>
</setting>
</Sage.Common.Syndication.Properties.Settings>
</applicationSettings>
</configuration>

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 23.0.8839