Showing posts with label WCF. Show all posts
Showing posts with label WCF. Show all posts

Thursday, 4 September 2014

How to call a Syspro Business Object from a SQL Trigger

Sometimes one of the worst options for customising Syspro, using a SQL Trigger, is the best option you've got. In that circumstance, how do you call a Syspro Business Object from within the SQL Trigger? Here are some ways:

Create a CLR Stored Procedure

Create a CLR Stored Procedure and call that from your SQL Trigger. In your CLR Stored Procedure, you can call the Business Object via one of Syspro's COM Objects, or via Syspro's web service or Syspro's WCF service. However, you must watch out for the 32/64-bit issue:

Watch out for the 32/64-bit issue

If you are using one of Syspro's COM objects, you may run into the problem of trying to run a 32-bit application in a 64-bit process, which can't be done (unless you want to hack around with the registry as described here - good luck). This problem arises because if your version of SQL Server is 64-bit, then you won't be able to access any 32-bit COM objects from it (such as Encore.dll or Syspro32.dll); you could use Syspro.dll (which is 64-bit), but at the time of writing, September 2014, it had't been released.

You could overcome the 32-64 bit disconnect by using Inter-Process Communication or some other communication method, but you may just find it easier to use another method.

Call a COM Object

You CAN call a COM object directly from a SQL Trigger using the extended stored procedures, sp_OACreate and sp_OAMethod (details here).
Then you could either call a web service, or call Encore.dll or Syspro.dll (being mindful of the 32/64-bit issue as mentioned above). Here's one example.
However, this is not a good solution due to the level of security you have to give to run those extended stored procedures.

Use Document Flow Manager

You could dump out files and feed them into Syspro's Document Flow Manager, a server process which monitors a directory for files and feeds them into Syspro via one of Syspro's e.Net interfaces.

Call a separate process via xp_cmdshell

The quickest and simplest method is: from your SQL Trigger, use the xp_cmdshell function, e.g.

EXEC master..xp_cmdshell @yourParameters
This has the same security issues as calling a COM Object, but it isolates your process from the SQL Server, and so this is probably the best method.

Thursday, 15 May 2014

How to test your Syspro WCF Service

These are some basic tests you can use to check if Syspro's WCF Service is up and running.
  1. Open a web browser and go to a URL such as:

    http://example.com:97/SYSPROWCFService/Rest

    You should see something like this:

  2. Open a web browser and go to a URL such as:

    http://example.com:97/SYSPROWCFService/Rest/GetVersion

    You should receive a text file called GetVersion containing the version number of the WCF Service, e.g. 7.0.0.3.
  3. Can you ping the Syspro server (provided the Syspro server responds to ICMP ping requests)?
     
  4. Telnet to the server and port, then hit ENTER a few times, e.g.

    telnet example.com 99

    If you get this:

    Connecting To example.com...Could not open connection to the host, on port 99: Connection failed

    then you didn't get a connection at all. This could happen if you had the wrong port or IP address.

    However, if you got a clear screen, then when you hit ENTER the telnet session terminated, then you got a connection OK.

    "Actively refused" means that you got at least as far as a TCP Connect packet arriving at the named server.
     
  5. From an elevated command prompt (i.e. run CMD as Administrator), run this command:

    netstat -ano | findstr 9999

    where 9999 is the process number or port number you are interested in.
    You should see your process and port listed.
     
  6. Check the Event Log for any error messages: in the Event Viewer, look under Application and Services Logs / SYSPROWCF.

Monday, 21 April 2014

How to use XSD2Code for SYSPRO’s Business Objects

When you call one of SYSPRO’s API’s, called a Business Object, via a web service or COM or DCOM or WCF, you need to pass it some XML. That XML is defined in a couple of XSD files. Generating that XML can be done easily in C# or VB .Net using a tool such as XSD2Codewhich is available from http://xsd2code.codeplex.com/. (Note that for Visual Studio 2012, you need XSD2CODE Beta Version 3.5 or later.)
The advantage of using a C# object rather than coding your XML as one big string is you get the advantages including:
  • Intellisense in Visual Studio – it shows you descriptions about each XML element from the XSD file’s annotations
  • Type safety
  • Easier to code: you don’t have to convert your types to strings, nor worry about maximum lengths etc. – it’s all done for you.
( I also tried using Microsoft’s XSD.exe tool, but found XSD2Code to be far superior – it is more configurable and so can be made to fit SYSPRO.)
These instructions are written for XSD2Code version 3.4 with Visual Studio 2010 and SYSPRO 6.1.
  1. Download and install XSD2Code. It integrates naturally with Visual Studio.
  2. From the <SYSPRO installation directory>/BASE/SCHEMAS directory,  add the XSD files for your desired business object into your project. E.g. to call the SORTOI business object, add C:\Syspro61\Base\Schemas\SORTOI.XSD and SORTOIDOC.XSD into your Visual Studio Project. Actually, I prefer to copy the XSD files into the appropriate sub-directory of my Visual Studio project and then add them from there, so that I can put the XSD files under source code control. (I use Mercurial.)
  3. In the Visual Studio Solution Explorer, right-click on the new XSD file and select Run XSD2Code Generation.
  4. Set the following parameters; the rest can stay as their default values. This is the key bit:
    1. PropertyParams/GeneratePropertyNameSpecified must be None, otherwise you won’t get parameters generated unless you set the correspondingfieldSpecified to true.
    2. Set the Code/NameSpace to <your-namespace> + the XSD name, so that there aren’t clashes with other XSD’s that use the same internal variables. E.g. I set mine to Syspro.Base.Schema.SORTOI and Syspro.Base.Schema.SORTOIDOC.
    3. Set the Code/TargetFramework to Silverlight or Net40 as appropriate.
    4. Leave the Serialization/DefaultEncoder as UTF-8.
    5. Set Serialization / Enabled to True. This saves you having to write your own serialization routine.
    6. Set Serialization / GenerateXMLAttributes to True.
  5. Press the Generate button.

Here is a screen shot of settings to use if you are using XSD2Code version 3.5:

Group your files
In the Visual Studio Solution Explorer, to have the newly generated .cs file (e.g. SORTOI.designer.cs) grouped under the XSD file (e.g. SORTOI.XSD), i.e. as a branch UNDER the XSD file instead of as a sibling file, follow these instructions:
  1. Close Visual Studio.
  2. Edit the .csproj file for that project with a text editor (such as vim or Notepad).
  3. Add DependentUpon tags (and open and close the Compile tag).
    E.g. change this line:
    <Compile Include="Schema\SORTOI.designer.cs" />
    to this:
    <Compile Include="Schema\SORTOI.designer.cs">
    <DependentUpon>SORTOI.XSD</DependentUpon>
    </Compile>

Use Namespaces

Note that when you tell XSD2Code what namespace to use, you need to use a different namespace for each XSD file as many of SYSPRO’s XSD files use properties with the same name, and you need to avoid those names clashing.
For example, for SOIRTOI.XSD, you could use a namespace of Syspro.Base.Schema.SORTOI;
for SORTOIDOC.XSD, you could use a different namespace such as Syspro.Base.Schema.SORTOIDOC.In other words, don’t use the same namespace for all your business objects. 
Then, in your C# code, you can add a reference to your Syspro.Base.Schema project, and you might like to write using statements such as these:
using SORTOI = Syspro.Base.Schema.SORTOI;
using SORTOIDOC = Syspro.Base.Schema.SORTOIDOC;
Then you will be able to access the generated objects with minimal namespace paths in your code.

Generate your XML

Now you can create code your XML settings using plain old C# objects as simply as this example:
var SORTOI_Parameters = new SORTOI.PostOrders()
{
 Parameters = new SORTOI.Parameters()
 {
     ValidateOnly = PORTOI.ValidateOnly.Y,
     StatusInProcess = PORTOI.StatusInProcess.N
 }
};

Edit the code to correct List definitions

Some List definitions in SYSPRO’s XSD files don’t seem to be properly declared, so you may have to manually edit the generated code and find all lines that begin with public List and add a line like this above the declaration (change the parameter on the right to match your type):
[System.XML.Serialization.XmlElementAttribute("Item")]
so that the final code looks like this example:
[System.Xml.Serialization.XmlElementAttribute("Item")]
public List<SetupQotNonStockItem> Item
This problem only occurs for certain XSD files (such as WIPTPBDOC.xsd), where-as others such as PORTOIDOC.xsd have perfectly-generated code. My guess is that some of SYSPRO’s XSD files are not well constructed.
(Note that XSD2Code’s GenerateXMLAttributes option creates these XmlElementAttributes automatically… if the XSD code is correct.)

Sometimes the XSD file is incorrect

Sometimes the XSD file is actually incorrect. I am getting such problems reported and corrected if and when I find them. See this forum post for more information.

If you right-click on the XSD file but can’t see “Run XSD2Code generation”

If you right-click on your XSD file but can’t see Run XSD2Code generation enabled, this may be because the highlighted file has just switched to a different file, due to some behaviour in Visual Studio. To work around this, double-click on your XSD file first so that it comes up for editing; then you will be able to right-click on the XSD file and generate code for it.

Serialize your objects

To convert your object to XML, you can use code such as this:
string XmlParameters = SORTOI_Parameters.Serialize();

Syspro’s VBScript Business Objects don’t like namespace declarations

Note that if you may have XML Namespace declarations in your XML from serialization like this:
<Orders xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""">
This shouldn’t be a problem BUT if you are passing this XML to Syspro’s VBScript and then calling a Business Object from VBScript, it will not like the xmlns declaration, so you may want to add this code on the VBSCript side (see related article, How to invoke a Syspro VBScript function from a .Net User Control):
Dim nameSpaceDeclaration
nameSpaceDeclaration = "xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"""
XmlParameters = Replace(XmlParameters, nameSpaceDeclaration,"")
This was the case for Syspro 6.1 Port 69.
However, this doesn’t seem to be an issue if calling the Business Object not from VB Script but from a web service or via DCOM.

Adjust the encoding for Silverlight

If you are using this in Silverlight, you may need to adjust the XML encoding; this is an ugly way of doing it:
XmlParameters = XmlParameters.Replace("encoding=\"utf-8\"", "encoding=\"Windows-1252\"");
A better way of doing this may be to pass the Serialize routine a parameter to select which encoding to use; I have yet to try this.

Finally

Then you can pass those XML strings to the web service for the business object, e.g:
setupProxySORTOI.AddAsync(userId, "SORTOI", XMLParameters, XMLIn);

See Also

Thursday, 17 October 2013

Developing .Net User Controls for Syspro - Intro

Syspro gives you the ability to house a .Net User Control inside the Syspro application, in a custom pane. (A custom pane can be housed in nearly any Window in the Syspro application, or in the Syspro main menu.) The custom-written control can then interact with your Syspro user interface, the Syspro database, and the Syspro Business Objects - so it's a very nice way to write custom solutions.

However, there are a few traps for the uninitiated:


  1. You need to start with a WinForm user control because Syspro can’t run WPF user controls directly; not hard to resolve; you just add a WPF user control inside your WinForm user control.
  2. You need to add Assembly Resolver code so that your DLL’s are loaded from ManagedAssemblies rather than BASE. See this post on the Syspro Forum for details.
  3. You need to override the loading of configuration files as the .Net default of BASE\IMPACT.exe.config is obviously inappropriate.
    This code is good: http://stackoverflow.com/questions/6150644/change-default-app-config-at-runtime
  4. There are some traps with calling Business Objects from .Net via Syspro's VBScript interface.
    In short, you need to:

    A. Avoid going over the 70-character limit, so passing XML files via temporary files is one solution.

    B. Avoid using spaces, new lines, or other characters, that are of significance to VBScript, in the strings you pass from .Net to Syspro's VBScript. The way to solve this is to encode all those characters as control characters before passing them to VBScript, then decode them inside the VBScript.

    C. You may need to pass more than two parameters to Syspro from .Net, but you only have two variables you can use. One way to solve this is to combine several parameters into one string, separating them with control characters.



Thursday, 11 April 2013

How to access Syspro Business Objects from VBA in a 64-bit process

If you get this error, "ActiveX component can't create object", when you move your spreadsheet to a 64-bit environment and you're calling a Syspro Business Object, here is a solution.

Background: It is quite easy to create an Excel spreadsheet, put a button on the spreadsheet, and write a macro in VBA (Visual Basic for Applications) to pass the data into Syspro using one of Syspro's Business Objects, and so perform some business function such as creating a sales order or closing a manufacturing job; this can easily be done by using COM to access Syspro's Encore.transaction object which lives in Encore.DLL. On Windows XP and Vista and 32-bit versions of Windows 7, all runs well; you might use VBScript code like this:


Dim transaction As Object
Set transaction = CreateObject("Encore.transaction")


Dim XmlParameters as string
Dim XmlIn as string

Dim EncoreLanguageCode as string
Dim EncoreLogLevel as string
Dim EncoreInstance as string

EncoreLanguageCode = "AUTO"

EncoreLogLevel = "ldNoDebug"
EncoreInstance = "EncoreInstance_0"

XmlParameters = "<your xml>"
XmlIn = "<your xml in>"

Dim GUID as string
GUID = transaction.Logon("Operator", "OperatorPassword", "CompanyId", _
          "CompanyPassword", EncoreLanguageCode, EncoreLogLevel, EncoreInstance, "")


Dim XmlOut as string
XmlOut = transaction.Post(GUID, "SORTOI", XmlParameters, XmlIn)




However, on 64-bit versions of Microsoft Office on 64-bit versions of Windows 7 or Windows 8 or Windows Server 2008, you will get an error such as this:


ActiveX component can't create object




This is because you can no longer call Encore.DLL because 64-bit processes can't run 32-bit DLL's. So how do you solve it? Here's a couple of ways you can solve it.

Use a 32-bit version of Microsoft Office

You can install the 32-bit version of Microsoft Office on your 64-bit computer; this works OK, but isn't the preferred solution, but it could be the simplest solution.

Web services via SOAP - stuck again

You could try to call Syspro web services using Microsoft's SOAP Toolkit 3.0, BUT again, the SOAP Tookit is no longer supported by Microsoft, and there isn't a 64-bit version of it, so again, you're stuck.
See this post for more details.

Web services via a WCF proxy

In Visual Studio 2010, you can create a 64-bit DLL which you can reference the same way you'd reference Encore.DLL, but this DLL is just a proxy to call the Syspro Web Services using SOAP. To do that, create a new project in Visual Studio 2010; the output should be a Class Library, and mark the Assembly as COM-Visible (go to the project's properties / Application / Assembly Information).
Then add Service References: add the four Syspro web services (Query, Setup, Transaction and Utilities).
Create your object: here's C# code:

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.ServiceModel;

using Syspro.Base.SoapClient.SysproQueryServiceReference;
using Syspro.Base.SoapClient.SysproSetupServiceReference;
using Syspro.Base.SoapClient.SysproUtilitiesServiceReference;
using Syspro.Base.SoapClient.SysproTransactionServiceReference;

namespace Syspro.Base.SoapClient
{
    [Guid("2672CDBD-F7C9-41E9-A86E-BD7034285E2E")]
    [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
    public interface ISoapClient
    {
        [DispId(1)] // TODO: Are these Dispatch ID's necessary? If not, remove them.
        void SetBaseURL(string URL);

        // Utility routines
        [DispId(2)]
        string Logon(string Operator, string OperatorPassword, string CompanyId, string CompanyPassword);

        [DispId(3)]
        string Logoff(string userId);

        [DispId(4)]
        string GetLogonProfile(string UserId);

        [DispId(5)]
        string Run(string UserId, string BusinessObject, string Parameter);

        // Transaction routines
        [DispId(6)]
        string Post(string UserId, string BusinessObject, string XmlParameters, string XmlIn);

        [DispId(7)]
        string Build(string UserId, string BusinessObject, string XmlIn);

        // Query routines
        [DispId(8)]
        string Query(string UserId, string BusinessObject, string XmlIn);

        [DispId(9)]
        string Browse(string UserId, string XmlIn);

        [DispId(10)]
        string Fetch(string UserId, string XmlIn);

        [DispId(11)]
        string NextKey(string UserId, string XmlIn);

        [DispId(12)]
        string PreviousKey(string UserId, string XmlIn);

        // Setup routines
        [DispId(13)]
        string Add(string UserId, string BusinessObject, string XmlParameters, string XmlIn);

        [DispId(14)]
        string Delete(string UserId, string BusinessObject, string XmlParameters, string XmlIn);

        [DispId(15)]
        string Update(string UserId, string BusinessObject, string XmlParameters, string XmlIn);
    }

    // Reference: http://msdn.microsoft.com/en-us/library/bb608604.aspx
    [Guid("7D825322-30C9-42A4-9A74-57154FC3169F")]
    [ClassInterface(ClassInterfaceType.None)]
    [ProgId("Syspro.Base.SoapClient")]
    public class SoapClient : ISoapClient
    {
        private string BaseURL = String.Empty;

        private const string utilitiesEndpointName = "/utilities.asmx";
        private const string transactionEndpointName = "/transaction.asmx";
        private const string queryEndpointName = "/query.asmx";
        private const string setupEndpointName = "/setup.asmx";

        public SoapClient()
        {
            // Must have a public default constructor so that COM clients can create the type.
            // Reference: http://msdn.microsoft.com/en-us/library/7fcfby2t.aspx
        }

        public void SetBaseURL(string URL)
        {
            BaseURL = URL;
        }


        #region Utility Routines

        public string Logon(string Operator, string OperatorPassword, string CompanyId, string CompanyPassword)
        {
            System.ServiceModel.Channels.Binding binding = new System.ServiceModel.BasicHttpBinding();
            var endPoint = new EndpointAddress(BaseURL + utilitiesEndpointName);
            var client = new utilitiesclassSoapClient(binding, endPoint);

            var result = client.Logon(Operator, OperatorPassword, CompanyId,
                              CompanyPassword, Language.AUTO,
                              LogDetail.ldNoDebug, Instance.EncoreInstance_0, "");
            return result;
        }

        public string Logoff(string userId)
        {
            System.ServiceModel.Channels.Binding binding = new System.ServiceModel.BasicHttpBinding();
            var endPoint = new EndpointAddress(BaseURL + utilitiesEndpointName);
            var client = new utilitiesclassSoapClient(binding, endPoint);

            var result = client.Logoff(userId);
            return result;
        }

        public string GetLogonProfile(string userId)
        {
            System.ServiceModel.Channels.Binding binding = new System.ServiceModel.BasicHttpBinding();
            var endPoint = new EndpointAddress(BaseURL + utilitiesEndpointName);
            var client = new utilitiesclassSoapClient(binding, endPoint);

            var result = client.GetLogonProfile(userId);
            return result;
        }

        public string Run(string UserId, string BusinessObject, string Parameter)
        {
            System.ServiceModel.Channels.Binding binding = new System.ServiceModel.BasicHttpBinding();
            var endPoint = new EndpointAddress(BaseURL + utilitiesEndpointName);
            var client = new utilitiesclassSoapClient(binding, endPoint);

            var result = client.Run(UserId, BusinessObject, Parameter);
            return result;
        }

        #endregion Utilities Routines


        #region Transaction Routines

        public string Post(string UserId, string BusinessObject, string XmlParameters, string XmlIn)
        {
            BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding();
            binding.ReaderQuotas.MaxStringContentLength = 2147483647;
            binding.MaxReceivedMessageSize = 2147483647;

            var endPoint = new EndpointAddress(BaseURL + transactionEndpointName);
            var client = new transactionclassSoapClient(binding, endPoint);

            var result = client.Post(UserId, BusinessObject, XmlParameters, XmlIn);
            return result;
        }

        public string Build(string UserId, string BusinessObject, string XmlIn)
        {
            BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding();
            binding.ReaderQuotas.MaxStringContentLength = 2147483647;
            binding.MaxReceivedMessageSize = 2147483647;

            var endPoint = new EndpointAddress(BaseURL + transactionEndpointName);
            var client = new transactionclassSoapClient(binding, endPoint);

            var result = client.Build(UserId, BusinessObject, XmlIn);
            return result;
        }


        #endregion Transaction Routines


        #region Query Routines

        public string Query(string UserId, string BusinessObject, string XmlIn)
        {
            BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding();
            binding.ReaderQuotas.MaxStringContentLength = 2147483647;
            binding.MaxReceivedMessageSize = 2147483647;

            var endPoint = new EndpointAddress(BaseURL + queryEndpointName);
            var client = new queryclassSoapClient(binding, endPoint);

            var result = client.Query(UserId, BusinessObject, XmlIn);
            return result;
        }

        public string Browse(string UserId, string XmlIn)
        {
            BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding();
            binding.ReaderQuotas.MaxStringContentLength = 2147483647;
            binding.MaxReceivedMessageSize = 2147483647;

            var endPoint = new EndpointAddress(BaseURL + queryEndpointName);
            var client = new queryclassSoapClient(binding, endPoint);

            var result = client.Browse(UserId, XmlIn);
            return result;
        }

        public string Fetch(string UserId, string XmlIn)
        {
            BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding();
            binding.ReaderQuotas.MaxStringContentLength = 2147483647;
            binding.MaxReceivedMessageSize = 2147483647;

            var endPoint = new EndpointAddress(BaseURL + queryEndpointName);
            var client = new queryclassSoapClient(binding, endPoint);

            var result = client.Fetch(UserId, XmlIn);
            return result;
        }

        public string NextKey(string UserId, string XmlIn)
        {
            BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding();
            binding.ReaderQuotas.MaxStringContentLength = 2147483647;
            binding.MaxReceivedMessageSize = 2147483647;

            var endPoint = new EndpointAddress(BaseURL + queryEndpointName);
            var client = new queryclassSoapClient(binding, endPoint);

            var result = client.NextKey(UserId, XmlIn);
            return result;
        }

        public string PreviousKey(string UserId, string XmlIn)
        {
            BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding();
            binding.ReaderQuotas.MaxStringContentLength = 2147483647;
            binding.MaxReceivedMessageSize = 2147483647;

            var endPoint = new EndpointAddress(BaseURL + queryEndpointName);
            var client = new queryclassSoapClient(binding, endPoint);

            var result = client.PreviousKey(UserId, XmlIn);
            return result;
        }

        #endregion Query Routines


        #region Setup Routines

        public string Add(string UserId, string BusinessObject, string XmlParameters, string XmlIn)
        {
            BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding();
            binding.ReaderQuotas.MaxStringContentLength = 2147483647;
            binding.MaxReceivedMessageSize = 2147483647;

            var endPoint = new EndpointAddress(BaseURL + setupEndpointName);
            var client = new setupclassSoapClient(binding, endPoint);

            var result = client.Add(UserId, BusinessObject, XmlParameters, XmlIn);
            return result;
        }

        public string Delete(string UserId, string BusinessObject, string XmlParameters, string XmlIn)
        {
            BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding();
            binding.ReaderQuotas.MaxStringContentLength = 2147483647;
            binding.MaxReceivedMessageSize = 2147483647;

            var endPoint = new EndpointAddress(BaseURL + setupEndpointName);
            var client = new setupclassSoapClient(binding, endPoint);

            var result = client.Delete(UserId, BusinessObject, XmlParameters, XmlIn);
            return result;
        }

        public string Update(string UserId, string BusinessObject, string XmlParameters, string XmlIn)
        {
            BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding();
            binding.ReaderQuotas.MaxStringContentLength = 2147483647;
            binding.MaxReceivedMessageSize = 2147483647;

            var endPoint = new EndpointAddress(BaseURL + setupEndpointName);
            var client = new setupclassSoapClient(binding, endPoint);

            var result = client.Update(UserId, BusinessObject, XmlParameters, XmlIn);
            return result;
        }

        #endregion Setup Routines

    }
}



Compile your object, Syspro.Base.SoapClient.DLL.

Copy Syspro.Base.SoapClient.DLL into your Syspro\Base\ManagedAssemblies folder; the ideal way to do this is to upload it using Syspro’s tool available from the main menu: Home / Customization / Customization Tools / Upload Files to the Server….


Now you need to register the DLL. Run an elevated command prompt (go to Start / All Programs / Accessories, right-click on Command Prompt, click on Run as Administrator), and type in these commands:


cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319
regasm /codebase "C:\Syspro61\Base\ManagedAssemblies\Syspro.Base.SoapClient.dll"


You should get this response:


Types registered successfully


Now in your VBscript, you can call the web service using code such as this:


Dim soap as Object
Dim XmlOut as string
Dim XmlParameters as string
Dim XmlIn as string

XmlParameters = "<your xml>"
XmlIn = "<your xml in>"


Set soap = CreateObject("Syspro.Base.SoapClient")
soap.SetBaseURL "http://www.example.com/sysprowebservices/"

Dim GUID as string
GUID = soap.Logon("Operator", "OperatorPassword", "CompanyId", "CompanyPassword")

XmlOut = soap.Post(GUID, "SORTOI", XmlParameters, XmlIn)