Forum Discussion
dpeterson157
13 years agoContributor
So, what you're saying is that SmartBear has effectively broken any meaningful form of JScript inheritance, and that's just tough? That's ridiculous!
Sigh....
So what do you mean/how do you do:
1. Place the code to a string variable and share the variable between units.
2. In the global scope of each unit, call the eval function to execute the shared code - this should make the additional functions available in each of the units.
I'm trying to configure JScript code for WebService testing. We use a couple different web service API's. Things like the target test server, port # etc. are common to both types of API requests, but the attributes for the soap envelope are different. I was trying to construct a JScript library like such:
fw_WebService
fw_WebService_EIM //ws library for the EIM API
fw_WebService_MSP //ws library for the MSP API.
Both the API libraries should inherit functions like "targetServer", "port", etc. from the base "class". The base module also contains functions like "POST", so I don't have to rewrite them in each API. The "//USEUNIT" directive was supposed to make it unnecessary for me to have to copy the contents of fw_WebService into each of the API libraries, but apparently that is no longer a practical idea.
So is there a relatively painless way to accomplish what I'm trying to do?
Sigh....
So what do you mean/how do you do:
1. Place the code to a string variable and share the variable between units.
2. In the global scope of each unit, call the eval function to execute the shared code - this should make the additional functions available in each of the units.
I'm trying to configure JScript code for WebService testing. We use a couple different web service API's. Things like the target test server, port # etc. are common to both types of API requests, but the attributes for the soap envelope are different. I was trying to construct a JScript library like such:
fw_WebService
fw_WebService_EIM //ws library for the EIM API
fw_WebService_MSP //ws library for the MSP API.
Both the API libraries should inherit functions like "targetServer", "port", etc. from the base "class". The base module also contains functions like "POST", so I don't have to rewrite them in each API. The "//USEUNIT" directive was supposed to make it unnecessary for me to have to copy the contents of fw_WebService into each of the API libraries, but apparently that is no longer a practical idea.
So is there a relatively painless way to accomplish what I'm trying to do?
Related Content
- 4 years ago
- 12 years ago
- 6 years ago
- 3 years ago
Recent Discussions
- 16 hours ago
- 19 hours ago