Hello,
I really need to know how to get the port number of JSM server which a session runs in order that making it easier to manage several JSM servers.
For example:
I use the script shown below.
--------------------------------------------------------------------
var ip = document.location.host.split(":")[0];
var id = FIELDS("G1001").getValue().trim();
if ( id === "" || id === null ){
alert("Enter the Product Code Please.");
}else{
var config =
{
serverUrl: "http://" + ip + ":5563/service/longreach.jsp",
credential: {user:"lansa", password:"lansa"}
};
LONGRANGE.FileTransfer.setDefaultConfig(config);
.......
--------------------------------------------------------------------
In this case, the port number "5563" in the above code has to be changed whenever it is changed in httpd.xml.
If the port number in the code becomes a variable, it would be much better.
Does anyone know that?
Thanks for your help.
Best Regards,
Hidekazu Tanaka
Can I get JSM's port number like "document.location.host"
Moderator: jeanmichel
-
Fairdinkum
- Posts: 128
- Joined: 24 Jul 2017, 17:02
-
Fairdinkum
- Posts: 128
- Joined: 24 Jul 2017, 17:02
Re: Can I get JSM's port number like "document.location.host"
Finally, I was able to get the JSM port number using the following code:
--------------------------------------------------------
$(function() {
$.ajax({
type:'GET',
url:'/jsm/axinfo.json',
dataType:'json',
async: false,
success: function(res){
console.log(JSON.stringify(res));
alert( "SFM Port=" + res.sfm.port);
},
error:function(){console.log("failed...");}
});
});
--------------------------------------------------------
Thank you so much Alick and Frank
--------------------------------------------------------
$(function() {
$.ajax({
type:'GET',
url:'/jsm/axinfo.json',
dataType:'json',
async: false,
success: function(res){
console.log(JSON.stringify(res));
alert( "SFM Port=" + res.sfm.port);
},
error:function(){console.log("failed...");}
});
});
--------------------------------------------------------
Thank you so much Alick and Frank
- Attachments
-
- getJsmPort.png (109.95 KiB) Viewed 4232 times