Skip to content

Commit

Permalink
close #29 close #28
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaia committed Oct 2, 2019
1 parent ae4b660 commit b886d38
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 9 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,29 @@ Included samples in project
* List FI Customers
* Get Details of a FI Customer
* FI General Ledger Account

## Single sign-on (SSO)

Alternatively it's possible to sign-on with SSO instead of user and password.

Example : Opening a RFC connection using NTLM.

```C#
var conn = new RfcConnection(
hostname: "server_name",
client: "000",
sncPartnername: @"p:DOMAIN\SRVACC",
sncLib: @"gx64ntlm.dll" )
```

Define the SNC parameters related to your environment. If SncLib is not defined, NetWeaver RFC Library uses library defined in environment variable SNC_LIB or SNC_LIB_64.

```C#
public string SncQop { get ; set; }

public string SncMyname { get; set; }

public string SncPartnername { get; set; }

public string SncLib { get; set; }
```
2 changes: 1 addition & 1 deletion samples/BapiCompanyList/BapiCompanyList.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.6.0" />
<PackageReference Include="NwRfcNet" Version="0.0.3" />
<PackageReference Include="NwRfcNet" Version="0.0.4" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion samples/BapiCustomerDetail/BapiCustomerDetail.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.6.0" />
<PackageReference Include="NwRfcNet" Version="0.0.3" />
<PackageReference Include="NwRfcNet" Version="0.0.4" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion samples/BapiCustomerList/BapiCustomerList.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.6.0" />
<PackageReference Include="NwRfcNet" Version="0.0.3" />
<PackageReference Include="NwRfcNet" Version="0.0.4" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.6.0" />
<PackageReference Include="NwRfcNet" Version="0.0.3" />
<PackageReference Include="NwRfcNet" Version="0.0.4" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions src/NwRfcNet/NwRfcNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>NwRfcNet</AssemblyName>
<RootNamespace>NwRfcNet</RootNamespace>
<Version>0.0.3</Version>
<Version>0.0.4</Version>
<Authors>Nuno Maia</Authors>
<Description>An easy way of making SAP RFC calls from .NET Core (Windows, Linux and macOS )</Description>
<PackageTags>sap rfc bapi</PackageTags>
Expand All @@ -13,8 +13,8 @@
<DelaySign>false</DelaySign>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/nunomaia/NwRfcNet/</PackageProjectUrl>
<AssemblyVersion>0.0.3.0</AssemblyVersion>
<FileVersion>0.0.3.0</FileVersion>
<AssemblyVersion>0.0.4.0</AssemblyVersion>
<FileVersion>0.0.4.0</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
51 changes: 50 additions & 1 deletion src/NwRfcNet/RfcConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ public RfcConnection(string userName = null,
string client = null,
string language = null,
string systemNumber = null,
string sapRouter = null)
string sapRouter = null,
string sncQop = null,
string sncMyname = null,
string sncPartnername = null,
string sncLib = null
)
{
UserName = userName;
Password = password;
Expand All @@ -47,6 +52,10 @@ public RfcConnection(string userName = null,
Language = language;
SystemNumber = systemNumber;
SapRouter = sapRouter;
SncQop = sncQop;
SncMyname = sncMyname;
SncPartnername = sncPartnername;
SncLib = sncLib;
}

#endregion
Expand Down Expand Up @@ -138,6 +147,46 @@ public string Trace
}
}

public string SncQop
{
get => _parms.SncQop;
set
{
CheckConnectionIsClosed();
_parms.SncQop = value;
}
}

public string SncMyname
{
get => _parms.SncMyname;
set
{
CheckConnectionIsClosed();
_parms.SncMyname = value;
}
}

public string SncPartnername
{
get => _parms.SncPartnername;
set
{
CheckConnectionIsClosed();
_parms.SncPartnername = value;
}
}

public string SncLib
{
get => _parms.SncLib;
set
{
CheckConnectionIsClosed();
_parms.SncLib = value;
}
}

public RfcMapper Mapper { get; set; } = RfcMapper.DefaultMapper;

#endregion
Expand Down
13 changes: 13 additions & 0 deletions src/NwRfcNet/RfcConnectionBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ internal class RfcConnectionBuilder
[RfcConnectionPropertyAttribute("trace")]
public string Trace { get ; set; }

[RfcConnectionPropertyAttribute("snc_qop")]
public string SncQop { get ; set; }

[RfcConnectionPropertyAttribute("snc_myname")]
public string SncMyname { get; set; }

[RfcConnectionPropertyAttribute("snc_partnername")]
public string SncPartnername { get; set; }

[RfcConnectionPropertyAttribute("snc_lib")]
public string SncLib { get; set; }


#endregion

/// <summary>
Expand Down
8 changes: 7 additions & 1 deletion src/NwRfcNet/RfcFunction.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NwRfcNet.Interop;
using NwRfcNet.TypeMapper;
using System;

namespace NwRfcNet
Expand Down Expand Up @@ -34,6 +35,11 @@ internal RfcFunction(RfcConnection rfcConnection, string functionName)

public string FunctionName { get; }

/// <summary>
/// If required, define a function level RfcMapper
/// </summary>
public RfcMapper Mapper { get; set; }

#endregion

#region Dispose
Expand Down Expand Up @@ -89,7 +95,7 @@ public void Invoke<T>(T input)

if (input != null)
{
var inParam = new RfcParameterInput(_rfcConnection.Mapper);
var inParam = new RfcParameterInput(Mapper ?? _rfcConnection.Mapper);
inParam.SetParameters(FunctionHandle, input);
}

Expand Down

0 comments on commit b886d38

Please sign in to comment.