Skip to content

Commit

Permalink
Merge pull request #37 from moldypenguins/WebServicesAPIv1.6
Browse files Browse the repository at this point in the history
add webservice 1.6
  • Loading branch information
Craig Roberts authored Sep 12, 2019
2 parents 3237d0f + 5cd1b93 commit ab46ae9
Show file tree
Hide file tree
Showing 46 changed files with 2,353 additions and 611 deletions.
Binary file modified .vs/AutotaskNET/v15/.suo
Binary file not shown.
Binary file modified .vs/AutotaskNET/v15/Server/sqlite3/storage.ide
Binary file not shown.
Binary file modified .vs/AutotaskNET/v15/Server/sqlite3/storage.ide-shm
Binary file not shown.
Binary file modified .vs/AutotaskNET/v15/Server/sqlite3/storage.ide-wal
Binary file not shown.
38 changes: 26 additions & 12 deletions AutotaskNET/AutotaskNET.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
using System;
using System.Linq;
using System.Text;
using System.Net;
using System.Collections.Generic;

namespace AutotaskNET
{
public class ATWSInterface
{
public const string serviceURL = "https://webservices.autotask.net/ATServices/1.5/atws.asmx";

/// <summary>
/// The Autotask Web Service Object.
/// </summary>
Expand All @@ -23,6 +20,25 @@ public class ATWSInterface
/// </value>
public bool HasAuthenticated { get; internal set; } = false;


public int? ImpersonateAsResourceID
{
set
{
if (value.HasValue)
{
this._atws.AutotaskIntegrationsValue.ImpersonateAsResourceID = value.Value;
this._atws.AutotaskIntegrationsValue.ImpersonateAsResourceIDSpecified = true;
}
else
{
this._atws.AutotaskIntegrationsValue.ImpersonateAsResourceID = 0;
this._atws.AutotaskIntegrationsValue.ImpersonateAsResourceIDSpecified = false;
}
}
}


/// <summary>
/// Initializes a new instance of the <see cref="ATWSInterface"/> class.
/// </summary>
Expand All @@ -32,29 +48,27 @@ public ATWSInterface() { } //end ATWSInterface
/// Connects using the specified username and password.
/// </summary>
/// <param name="username">The username.</param>
/// <param name="password">The password.</param>
/// <param name="trackingId">The tracking id.</param>
/// <param name="resourceId">The resource id.</param>
/// <exception cref="AutotaskNETException">Error getting zone information.</exception>
public void Connect(string username, string password)
public void Connect(string username, string trackingId, int? resourceId = null)
{
this._atws = new net.autotask.webservices.ATWS() { Url = ATWSInterface.serviceURL };
//ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

this._atws = new net.autotask.webservices.ATWS() { Url = Properties.Settings.Default.Autotask_Net_Webservices_ATWS };
net.autotask.webservices.ATWSZoneInfo zoneInfo = this._atws.getZoneInfo(username);
if (zoneInfo.ErrorCode >= 0)
{
this._atws = new net.autotask.webservices.ATWS() { Url = zoneInfo.URL };
CredentialCache _cache = new CredentialCache
{
{ new Uri(this._atws.Url), "BASIC", new NetworkCredential(username, password) }
};
this._atws.Credentials = _cache;
this._atws.AutotaskIntegrationsValue.IntegrationCode = trackingId;
this.ImpersonateAsResourceID = resourceId;
this.HasAuthenticated = true;
}
else
{
throw new AutotaskNETException("Error getting zone information.");
}
}




Expand Down
27 changes: 14 additions & 13 deletions AutotaskNET/AutotaskNET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -200,19 +200,7 @@
<WebReferences Include="Web References\" />
</ItemGroup>
<ItemGroup>
<WebReferenceUrl Include="https://webservices.autotask.net/atservices/1.5/atws.wsdl">
<UrlBehavior>Dynamic</UrlBehavior>
<RelPath>Web References\net.autotask.webservices\</RelPath>
<UpdateFromURL>https://webservices.autotask.net/atservices/1.5/atws.wsdl</UpdateFromURL>
<ServiceLocationURL>
</ServiceLocationURL>
<CachedDynamicPropName>
</CachedDynamicPropName>
<CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName>
<CachedSettingsPropName>Autotask_Net_Webservices_ATWS</CachedSettingsPropName>
</WebReferenceUrl>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down Expand Up @@ -241,6 +229,19 @@
<ItemGroup>
<Content Include="psa.ico" />
</ItemGroup>
<ItemGroup>
<WebReferenceUrl Include="https://webservices.autotask.net/atservices/1.6/atws.wsdl">
<UrlBehavior>Dynamic</UrlBehavior>
<RelPath>Web References\net.autotask.webservices\</RelPath>
<UpdateFromURL>https://webservices.autotask.net/atservices/1.6/atws.wsdl</UpdateFromURL>
<ServiceLocationURL>
</ServiceLocationURL>
<CachedDynamicPropName>
</CachedDynamicPropName>
<CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName>
<CachedSettingsPropName>AutotaskNET_net_autotask_webservices_ATWS</CachedSettingsPropName>
</WebReferenceUrl>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
4 changes: 2 additions & 2 deletions AutotaskNET/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.12.0.0")]
[assembly: AssemblyFileVersion("0.12.0.0")]
[assembly: AssemblyVersion("0.13.0.0")]
[assembly: AssemblyFileVersion("0.13.0.0")]
[assembly: NeutralResourcesLanguage("en-CA")]

10 changes: 10 additions & 0 deletions AutotaskNET/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions AutotaskNET/Properties/Settings.settings
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="AutotaskNET.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings />
<Settings>
<Setting Name="Autotask_Net_Webservices_ATWS" Type="(Web Service URL)" Scope="Application">
<Value Profile="(Default)">https://webservices.autotask.net/ATServices/1.6/atws.asmx</Value>
</Setting>
</Settings>
</SettingsFile>
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="ATWSResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>AutotaskNET.net.autotask.webservices.ATWSResponse, Web References.net.autotask.webservices.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
<TypeInfo>AutotaskNET.net.autotask.webservices.ATWSResponse, AutotaskNET, Version=0.13.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="ATWSZoneInfo" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>AutotaskNET.net.autotask.webservices.ATWSZoneInfo, Web References.net.autotask.webservices.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
<TypeInfo>AutotaskNET.net.autotask.webservices.ATWSZoneInfo, AutotaskNET, Version=0.13.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="Attachment" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>AutotaskNET.net.autotask.webservices.Attachment, Web References.net.autotask.webservices.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
<TypeInfo>AutotaskNET.net.autotask.webservices.Attachment, AutotaskNET, Version=0.13.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="EntityInfo" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>AutotaskNET.net.autotask.webservices.EntityInfo, Web References.net.autotask.webservices.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
<TypeInfo>AutotaskNET.net.autotask.webservices.EntityInfo, AutotaskNET, Version=0.13.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="Field" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>AutotaskNET.net.autotask.webservices.Field, Web References.net.autotask.webservices.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
<TypeInfo>AutotaskNET.net.autotask.webservices.Field, AutotaskNET, Version=0.13.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

This file was deleted.

Loading

0 comments on commit ab46ae9

Please sign in to comment.