-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error - rfc.Client is not a function #10
Comments
The code looks correct. Which nodejs version are you using and on which platform (Linux/Windows) ? |
I am using node 5.2 on Windows 10 |
I have a dot there in the statement ...rfc.Client On Tue, Dec 15, 2015 at 6:10 AM, heri16 [email protected] wrote:
|
node 5.2 was not supported and I just pushed the fix, in the master branch, tested on Linux only. To test on Windows the node-rfc binary must be built from source, following the "Build from source" section of the documentation. Did you build the binary from source, from the current master ? |
I did not... I will try it out and let you know the results. Thanks for On Wed, Dec 16, 2015 at 6:24 AM, Srdjan Boskovic [email protected]
|
Ok, need a bit more clarity on how to compile from source to create the .node file for Windows. Where do i download the source to? Where do I execute node-gyp build from? Thanks and sorry for the inconvenience |
No inconveniences at all, no worries. The build from source is described here. Basically, you need to clone this repository and cd to root folder, default node-rfc. Then check the prerequisites and follow the steps in the documentation: git clone https://github.com/SAP/node-rfc.git
cd node-rfc
node-gyp configure --msvs_version=2013
node-gyp build Visual Studio 2015 worked with nodejs 4.2.0 and I suppose it should work with nodejs 5.2.0 as well, but did not test that combination. Before you start building, the path to Visual Studio shall be configured in binding.gyp. You also need SAP NW RFC Library installed, as described in the documentation. SAP NW RFC Library is available as 32 bit and 64 bit and Windows platforms today are usually 64 bit. If you use 64 bit platform and 64 bit RFC lib, the nodejs shall run in 64 bit mode as well. That is unfortunately not always the default and If you use node version manager Hope this helps, to start at least. |
Thank you for all your help!! I am getting a connection refused so now I can start to address that. Thanks!! LOCATION CPIC (TCP/IP) on local host PWKSRV29 with Unicode |
'partner not reached' looks like network issue. In your connection parameters the client is set to '11', should be three digits, you can also send me the connection params to check. |
WIll do... thank you for all your great help!! On Fri, Dec 18, 2015 at 12:31 AM, Srdjan Boskovic [email protected]
|
Windows 64 bit builds published in branches 4.2.3 and 5.3.0 |
Hello @donaldhook I've followed the instruction of @bsrdjan but still i'm getting error. Were you able to connect to SAP system using node-rfc? I'm new to SAP and I'm having a really hard time on setting up. Thanks for your help. |
George There are 2 dll's that you need to install in the c:\windows\system32 directory ... sapjco3.dll and sapnwrfc.dll This was a pain to setup, so you are not alone. I ended up going to Spring Boot to implement my project.... |
@GeorgeMacintoshJr, |
I seem to recall there was an option as to which VStools version to use... vs2015 vs2013 ... did you see that anywhere? |
Hello @donaldhook Thank you. I'm so glad to hear from you since you were so involved on this. |
Hello @bsrdjan After that when executing node-gyp configure --msvs_version=2015 I was getting this error what I did to get rid of the error Next I execute node-gyp build,the output is 1 warning and 1 error
So after that I was getting this output Now I don't know how to proceed. I'm afraid the warning: MSB8012 can cause incorrect behavior. Do I execute the mocha demo inside the node-rfc/demo folder? Thanks and sorry for the inconvenience. I'd really appreciate any help. |
just a small hint, the env variable SAPNWRFC_HOME should point to the root folder of SAPNWRFC lib, thus without mocha tests are executed against one SAP internal test system and some RFMs (Remote Function Modules) used in these tests may not exist in your test system. I would recommend starting from the simple test, like in README Getting Started, just adapt connection parameters. Mocha tests can be used as examples to build own tests, in similar manner. Regarding question which connection method to use from non-SAP to SAP system, it depends on system release and mostly on use-case and application. With SAP systems with HANA, the node-hdb can be used for the integration at table level. In landscapes with SAP NW GATEWAY and ODATA services, that method can be used as well. RFM (node-rfc) integration works with any system, new or old and still the fastest way for executing SAP business logic from nodejs. There are also other methods, like WS-SOAP or IDocs and it depends on use-case which one to use. |
Thanks @bsrdjan I removed the \lib suffix, after that I don't have to specify the path under rfc.vcxproj.
Do I have to create another folder and create a js file then paste this code Or I can just use the demo.js? Sorry, I'm really confuse on how to perform a connection on SAP. |
Now I see, the naming and comments in this source could be better, will enhance. Once compiled, It is enough to copy and run the |
Oh thanks @bsrdjan, the naming are fine I just enumerate what I have done for each item. So after executing the node-gyp build I just change directory to the demo folder C:\Users\Owner\Desktop\Sample\node-rfc> cd demo and run node demo. But before that I have to add these line of code on demo.js var should = require("should"); otherwise I will get an error of node-rfc module not found. Thank you @bsrdjan, I just need to clarify things for the benefits also of other developers. Because I can see that this module has great potentials. |
I am receiving the following error trying to create the client. Not sure what I have defined incorrectly.
Thanks for your help
Code
....
// Define the SAP Configuration
var SAPconfig = {
user: 'xxx',
passwd: 'xxx',
ashost: 'xxx',
sysnr: '010',
client: '11'
};
var rfc = require('node-rfc');
var client = new rfc.Client(SAPconfig, true);
console.log('** RFC Client Lib Version: ' + client.getVersion());
Console Log
var client = new rfc.Client(SAPconfig, true);
^
TypeError: rfc.Client is not a function
at Object. (c:\Boelter Applications\BoelterIntegrationServer\server.js:57:14)
at Module._compile (module.js:399:26)
at Object.Module._extensions..js (module.js:406:10)
at Module.load (module.js:345:32)
at Function.Module._load (module.js:302:12)
at Module.runMain as _onTimeout
at Timer.listOnTimeout (timers.js:93:15)
The text was updated successfully, but these errors were encountered: