How to Communiccate between JD Edwards Enterprise one 9.0 and .Net - c#-2.0

I have problem that how to communicate Jd Edwards Enterprise one 9.0 with .Net,and my project manager told me to look at the "fatclient" as it acts as a middle ware between these two,but there is no luck in my search,
Thanks in advance

Responding to this old post. Hopefully, this will help someone who has a similar need:
Take a look at our product LynX Business Integrator. It is Oracle Validated and it allows you to create integration processes natively in C# and publish it as a web service. So, you can write code like this:
private bool CallAddressBookBsfn(BusinessDocument businessDocument, Transaction transaction)
{
AddressBookMaster abm = businessDocument.document.input.AddressBook;
// create an instance of the Address Book Master Business function
// note the use of JDE Transactions
AddressBookMasterMBF bsfn = new AddressBookMasterMBF(transaction);
// set parameters - most of this code is auto-generated
bsfn.DpmnAddressBookNumber.InValue = (long)abm.AddressNumber;
bsfn.DpszSearchType.InValue = abm.AddressType;
bsfn.DpszAlphaName.InValue = abm.Name;
bsfn.DpszAddressLine1.InValue = abm.AddressLine1;
bsfn.DpszAddressLine2.InValue = abm.AddressLine2;
bsfn.DpszAddressLine3.InValue = abm.AddressLine3;
bsfn.DpszAddressLine4.InValue = abm.AddressLine4;
bsfn.DpszPostalCode.InValue = abm.ZipCodePostal;
bsfn.DpszCity.InValue = abm.City;
bsfn.DpszState.InValue = abm.State;
bsfn.DpszCountry.InValue = abm.Country;
bsfn.DpcActionCode.InValue = 'A';
bsfn.DpcUpdateMasterFile.InValue = '1';
// execute the business function
if (bsfn.Execute() != BusinessFunctionResult.Success)
{
// get errors
return false;
}
// assign output
businessDocument.document.output.AddressNumber = bsfn.DpmnAddressBookNumber.OutValue;
businessDocument.document.output.AddressNumberSpecified = true;
return true;
}
Take a look at our YouTube Channel at http://www.youtube.com/user/aelliuslynx and our product page at http://www.aellius.com/products/lynx-business-integrator

I am using old version 8.0 and if by "communication" you mean to be able from a .NET application to run JDE BSFN directly, then i am gonna dissapoint you but there isn't any way i know of.
Maybe things have changed in 9.0 but i doubt it.
Personally whenever i want to communicate with our JDE (AS400 based) i am using:
Frontend
-.NET Web Api services
-C# winforms apps
-ASP.NET
Backend
-Custom Dlls for Business logic and Data Access Layers.

Related

Get TFS version programmatically

How can I get the TFS version programmatically?
I am trying to get the version that shows up in the TFS Administration console.
I tried the following code, but it returns the server version as "Server Version: Dev14.M89-Part7", that doesn't seem correct.
var server = new TfsTeamProjectCollection(new Uri("http://tfs2015:8080/tfs"));
server.EnsureAuthenticated();
var serverVersion = server.ServerDataProvider.ServerVersion;
Console.WriteLine("Server Version: {0}", serverVersion);
I guess I am looking at the wrong property...
I'm using the Microsoft.TeamFoundation.Server.dll version number then the table from this link.
Unfortunately there is not some uniform method that you can call that will simply tell you “You are communicating with version X of TFS”. In order to determine what version of the server you are talking to we are going to use the principals about querying for services along with some knowledge about what services were available in each release.
Check this blog:http://blogs.msdn.com/b/taylaf/archive/2010/01/05/determining-the-tfs-server-version-using-client-apis.aspx
Another approach can be to pick the version number from a DLL, but requires to reach the server via PSExec, CIFS/SMB or Powershell Remoting.
The C# code should be something like
using (var tfsBaseKey = Registry.LocalMachine.OpenSubKey(#"SOFTWARE\Microsoft\TeamFoundationServer"))
{
var versionKeys = tfsBaseKey.GetSubKeyNames();
double dummy;
double maxVersion = versionKeys.Max(x => double.TryParse(x, out dummy) ? dummy : 0.0);
var latestVersionKey = maxVersion.ToString("#.0");
using (var tfsKey = tfsBaseKey.OpenSubKey(latestVersionKey))
{
string tfsInstallPath = tfsKey.GetValue("InstallPath").ToString();
string refAssemblyPath = Path.Combine(tfsInstallPath, #"Application Tier\Web Services\bin\Microsoft.TeamFoundation.Server.Core.dll");
var refAssembly = Assembly.ReflectionOnlyLoadFrom(refAssemblyPath);
var fileVer = refAssembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false).FirstOrDefault() as AssemblyFileVersionAttribute;
return fileVersion.Version;
}
}

How can I implement a custom challenge handler in Xamarin for iOS using IBM MobileFirst?

I'm trying to implement an adapter-based authentication using IBM MobileFirst Platform Foundation 6.3 and Xamarin in iOS.
I have followed the IBM documentation on how to setup a customSecurityTest, adding realms and equivalent loginModules within authenticationConfig.xml. I have then setup 2 adapter procedures:
authenticateUser with securityTest="wl_unprotected", and another
HelloFromServer with a securityTest="SingleStepAuthAdapter" that actually does a user authentication, and executing WL.Server.setActiveUser("SingleStepAuthRealm", userIdentity) to create the user identity.
I have then created an iOS app using Xamarin Studio. Tried to invoke HelloFromServer, which as expected runs my ChallengeHandler module BUT within the HandleChallenge method while trying to invoke the authenticateUser procedure on the server, it respond back with another authRequired=TRUE.
Anybody having the same problem?
You did not provide any useful implementation code that can be inspected for errors - add both the adapter authentication implementation as well as the client-side code of the challenge handler.
While I have no experience with Xamarin, it should be noted that in order to get started you could:
Use the same exact implementation as done in the Adapter-based authentication tutorial. That is, the implementation in the adapter files, project configuration and so on.
Follow through the native iOS implementation, also based on the tutorial
The MFP Studio project and the native iOS project can be downloaded from here.
If you are repeatedly getting back authRequired=true, it looks like you are not notifying the server of the success from your HandleChallenge function. You can refer to the CustomChallengeHandler.cs provided with the sample that is shipped with the component. This is coded to handle a form-based challenge. You can modify it to handle an realm for adapter-based authentication.
So, here are the changes you need to do
1) You should implement the GetAdapterAuthenticationParameters method in your ChallengeHandler class.
For example,
public AdapterAuthenticationInfo AdapterAuthenticationParameters = new AdapterAuthenticationInfo();
....
public override AdapterAuthenticationInfo GetAdapterAuthenticationParameters ()
{
return AdapterAuthenticationParameters;
}
2) In the HandleChallenge function of your ChallengeHandler class, set the isAuthRequired = true. For example,
if (challenge.ResponseJSON["authRequired"] == true)
{
WorklightProcedureInvocationData invocationData = new WorklightProcedureInvocationData("DemoAdapter",
"submitAuthentication" , new object[1]); // Add the parameters you want to pass to the adapter
AdapterAuthenticationParameters.InvocationData = invocationData;
AdapterAuthenticationParameters.RequestOptions = null;
isAdapterAuth = true;
}
else
{
isAdapterAuth = false;
authSuccess = true;
}

Is it possible to use the HttpClient class in MonoDroid?

I'm trying to use the HttpClient class on a MonoDroid project but it looks like the System.Net.http namespace it's not valid.
I try to add a reference in the project to System.Net.http.dll but it doesn't seem to be available in the references list.
Any idea?
Thks
HttpClient is a .NET 4.5 class, which is not available yet in Mono for Android. Mono itself added supported for it in version 3.0, but Mono for Android is still based on Mono 2.10. I know Xamarin is working on updating Mono for Android (and MonoTouch) to Mono 3.0 now, but as far as I know there's no release date set yet.
I know it is an old thread but I just saw that Xamarin has finally given System.Net.Http in Xamarin.Android 4.8, so thought to share it with you too.
Thanks.
You can't use HttpClient (yet!), but you can still use the System.Net.HttpWebRequest object, which does actually do what HttpClient can provide convenient wrappers for (especially when hitting up a Web API controller).
Here's a sample from a current project I'm working on (it's using the monodroid port of NewtonSoft.Json, not the standard System.Runtime.Serialization.Json) :
private void AddARecord()
{
var cartesian = new Cartesian()
{
Description = "next item blah",
X = 5,
Y = 10,
Z = 15,
};
string json = JsonConvert.SerializeObject(cartesian);
var request = new HttpWebRequest(new Uri(_url)) {ContentType = "application/json", Method = "POST"};
var sw = new StreamWriter(request.GetRequestStream(), System.Text.Encoding.ASCII);
sw.Write(json);
sw.Close();
request.BeginGetResponse(ProcessJsonResponseForSingleResult, request);
}
...the Web API controller I'm hitting does something arbitrary, saves the object I just sent, and then tweaks the description so I know it works. Then it sends the tweaked object back...
And then the callback ProcessJsonResponseForSingleResult looks like
private void ProcessJsonResponseForSingleResult(IAsyncResult ar)
{
var request = (HttpWebRequest)ar.AsyncState;
var response = request.EndGetResponse(ar);
using (var outputStream = new StreamReader(response.GetResponseStream(), System.Text.Encoding.ASCII))
{
var jsonString = outputStream.ReadToEnd();
Log.Info("PJRFSR", string.Format("JSON string: {0} - deserialising...", jsonString));
var cartesian = JsonConvert.DeserializeObject<Cartesian>(jsonString);
RunOnUiThread(() => UpdateUiTextView(cartesian.Description));
}
}
Yeah, I know, it uses the BeginAsync/EndAsync pattern which I don't like any more either, but it does work if you just need to get something done.

Is there a relatively easy way for a hybrid .Net exe (console app/Windows service) to install and start itself as a service?

Suppose an executable named ConsoleOrService.exe is written in C#. It currently is a hybrid. I can just start it on the command line, or I can install it using the .Net's installutil ConsoleOrService.exe and then start the service. I would like a third option: running it on the command line like so: ConsoleOrService.exe --install and have it do all of the work.
Is this possible?
Is this hard?
How can I get started?
Thank you, and let me know if there are questions please.
It's actually quite simple. I've used it in many of my own services (in fact, ALL of my services are capable of doing their own install/uninstall. I control it with a command-line switch, such as /install or /uninstall.
The installation is performed like this:
private static void InstallService()
{
var ti = new System.Configuration.Install.TransactedInstaller();
var si = new MyServiceInstaller();
var cl = new string[] { string.Format(CultureInfo.InvariantCulture, "/assemblypath={0}", System.Reflection.Assembly.GetExecutingAssembly().Location) };
var ctx = new System.Configuration.Install.InstallContext(null, cl);
ti.Installers.Add(si);
ti.Context = ctx;
ti.Install(new Hashtable());
}
The uninstallation is the same, except that you call ti.Uninstall(null); instead of ti.Install(...);.
My MyServiceInstaller is a class that inherits from the System.Configuration.Install.Installer class (as you would normally have in a service).

Is there any way to specify a service name in the app.config file?

I want to specify my service name in the app.config without needing to recomple and install/uninstall my service repeatedly.
But just retrieving service name from app.config, the service seems ignoring it. Are there any special tricks how to obtain this?
Thanks in advance.
I mean classic windows service. I don't think any code is needed here. I just want to retrieve the service name from app.config dynamically.
After searching a while on the internet and reading articles, it became clearer to me that A service name can't be specified in the app.config in so dynamic way, instead sc command can be used to perform a similar solution. You can specify other configuration variables in the app.config and use sc to rename it
sc.exe create "servicename" binPath="myservicepath.exe"
I am not sure what scenario you have in mind. You would like the name of your Windows service to change. Fair enough. When would it change?
Imagine you have found the solution and created such a Windows service. I presume in your scenario you would install it at least the first time. Then you do not want to uninstall/install it. But presumably you would like to start/stop and do other things with it. Will one of those actions cause the name of the service to change?
If so, I imagine you could launch a process that uninstalls and installs it with a different name for you transparently, based on some kind of naming logic.
I don't see how else you could do it.
Or just come up with a really generic name to cover all possibilities (which might be incredibly simple or incredibly difficult).
http://www.codeproject.com/Articles/21320/Multiple-Instance-NET-Windows-Service
<add key="ServiceName" value="I"/>
[RunInstaller(true)]
public class ServiceInstaller1 : Installer
{
internal static string ServiceNameDefault = "My Service";
internal static string ServiceName = GetConfigurationValue("ServiceName");
/// <summary>
/// Public Constructor for WindowsServiceInstaller.
/// - Put all of your Initialization code here.
/// </summary>
public ServiceInstaller1()
{
var serviceProcessInstaller = new ServiceProcessInstaller();
var serviceInstaller = new ServiceInstaller();
//# Service Account Information
serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
//serviceProcessInstaller.Username = null;
//serviceProcessInstaller.Password = null;
//# Service Information
serviceInstaller.DisplayName = ServiceName;
serviceInstaller.StartType = ServiceStartMode.Manual;
//# This must be identical to the WindowsService.ServiceBase name
//# set in the constructor of WindowsService.cs
serviceInstaller.ServiceName = ServiceName;
Installers.Add(serviceProcessInstaller);
Installers.Add(serviceInstaller);
}
private static string GetConfigurationValue(string key)
{
Assembly service = Assembly.GetAssembly(typeof(Service));
Configuration config = ConfigurationManager.OpenExeConfiguration(service.Location);
if (config.AppSettings.Settings[key] != null)
return ServiceNameDefault + " " + config.AppSettings.Settings[key].Value;
else
return ServiceNameDefault;
}
}
Assuming you mean Windows Service, the answer is no. The service has to be installed in the registry, and the name is one of the registry keys.
I'm afraid that what you are trying to do its not possible. It actually seems to go against the nature of a Windows Service purpose and current behavior.
After a windows service is installed the name can't be changed without re-installing it again. What actually names the service is an element called service installer. Which by now, I assume you know what it is and where its located.
However there are ways of manipulating an installed service by using Windows Management Instrumentation (WMI). Maybe this combined with Izabela's recommendation become the right path to your solution.
I would recommend you to read the following tutorial, you might find an alternate way of achieving what you're trying to do.
http://www.serverwatch.com/tutorials/article.php/1576131/Windows-Services-Management-With-WMI-Part-1.htm

Resources