I’ve read and put together the code in Visual Studio that’s contained within the WCF Techref guide. I would however like to try connecting using Net.TCP and Windows auth. Can somebody give me the code required to connect in this manner. This is what is currently in my project, taken straight from the techref guide:
If you want to use net.tcp you need to use the client DLL proxies. The examples use the SOAP protocol to interop nicely with other clients (Though not as nice as REST does now). Net.tcp does not have a SOAP flavor out of the box so you would need to use the custom binary serialization approach which means knowing the column order, etc on the client - a royal pain unless you want to rewrite the client generator.
Hi Bart, thanks for the reply. I’m a complete beginner when it comes to creating code outside of Epicor – I’ve done a some inside the Custom Code Blocks in BPMs and customisations with good results, but I want to expand my knowledge and capability to develop further. I thought a good place to start would be that guide, then build up different examples of interacting with data in our test environment.
No particular interested in Net.TCP, only that the app server is already configured and the desired usage is within the LAN. I can setup the HTTP binding, but if I’m just starting out to learn this should I be going straight for REST?
Go REST if you can. However I believe the WCF http endpoint is there even if you only have net.tcp setup.
Have you tried just calling the example without changing anything?
I don’t recall if you have to do anything special for that one. I don’t think so
We’re only configured for Windows auth, not username/password. What changes would I need to make to the code for this? I can see in the enum that the options are only SOAPHttp and BasicHttp. I added Windows here, but would need help in creating the right connection.
I feel like this has become over complicated. Excuting code outside Epicor is quite easy.
First, you make a session using the Ice.Core.Session assembly.
Session session = new Session(“******“, “********”, Session.LicenseType.Default, @”.Sysconfig Location”);
Second, you choose your BO. Make a call to the WCF Service Support and bam. You can now call Epicor methods for that BO, like GetByID, or Update, or anything else. If you’d like to learn more about this I’d be happy to explain further.
var customerBO = WCFServiceSupport.CreateImpl<Erp.Proxy.BO.CustomerImpl>(session, Erp.Proxy.BO.CustomerImpl.UriPath);
Now you can do things like :
CustomerDataSet cds = new CustomerDataSet();
customerBO.GetCustomerTerritory(cds, 0);
cds.Customer[0].CreditHold = false;
cds.Customer[0].SalesRepName = "John Doe";
//Required check to verify customer is not on credit hold. Credit hold must be set to false before this method.
customerBO.CheckCreditHold(cds, out vMessage);
customerBO.Update(cds);
Seems like different people have different preferences and are suggesting different methods. Aaron is saying use the client dlls, Bart saying don’t, and then choice between REST and not.
Sitting in an airport heading home for a week off to rest my vocal chords
I promise all an overview and trade off doc (I owe our docs team too so thanks to all in advance for volunteering to proof read).
Quick Sumnary from whay had seen said.
The session based using net tcp is the first approach ever documented and released. It’s is still the fastest and works fine. You have to deploy the dlls somehow, keep them updated. You have to have same dotnet version. You have to be on windows in as well. So more deployment maintenance.
Next is the service approach. You use soap so can call from most any os. Its just that soap is not that friendly in all clients. It’s also not as fast as raw net.tcp where we control both sides of the wire.
This week we released the REST approach. With opt in columns you can speed things unlike the options. It can speak json or xml so is very flexible and easy to get going from any platform.
Does that help while I jump on a plane?
(And yes we owe you those examples in github)
Perfect, thanks Bart. Some examples of each, to get started in Visual Studio would be the icing on the cake. That would be useful for all customers I’m sure! Thank you.