|
|
-
Which host to use for Fix Demo?
Hi there,
I am using the JavaFixTrader sample code located here (the link to the sample code is at the bottom of the page):
Java API Example
and am having trouble getting the right host to connect to.
The program requires "username", "password" and "terminal" and I believe it uses the "terminal" to select which host to use in http://www.fxcorporate.com/Hosts.jsp. There is a whole list of hosts in that jsp file and I have tried a couple of them but got the following stacktrace when trying to login
Logging in
03/02/2012 12:36:42 AM com.fxcm.messaging.util.pdas.communicator.Communicator request
SEVERE: Unexpected end of file from server
com.fxcm.messaging.util.CommunicationException: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.communicator.http.HttpCommunicator.httpSend(HttpCommunicator.java:304)
at com.fxcm.messaging.util.pdas.communicator.http.HttpCommunicator.trnSend(HttpCommunicator.java:125)
at com.fxcm.messaging.util.pdas.communicator.Communicator.trnSend(Communicator.java:153)
at com.fxcm.messaging.util.pdas.communicator.Communicator.request(Communicator.java:461)
at com.fxcm.messaging.util.pdas.communicator.Communicator.run(Communicator.java:350)
at java.lang.Thread.run(Unknown Source)
03/02/2012 12:36:42 AM com.fxcm.messaging.util.pdas.communicator.Communicator request
SEVERE: Unexpected end of file from server: Message type=BE
SID=null
112=NewSession-19--64579915-main
625=MT4USDDEMO
554=6aecdb967ad559f5dc0f6c23220575f6
336=
923=NewSession-19--64579915-main
924=5
553=2048265609
03/02/2012 12:36:42 AM com.fxcm.messaging.util.pdas.session.PDasTransportSession retrieveTradingSessions
SEVERE: problem on communication request: Unexpected end of file from server
com.fxcm.messaging.util.AuthenticationException: problem on communication request: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.session.PDasTransportSession.retrieveTradingSessions(PDasTransportSession.java:318)
at com.fxcm.messaging.util.UniversalUserSession.retrieveTradingSessions(UniversalUserSession.java:632)
at com.fxcm.internal.transport.FXCMGateway.getTradingSessionDescs(FXCMGateway.java:269)
at com.fxcm.internal.transport.FXCMGateway.login(FXCMGateway.java:352)
at JavaFixTrader.login(JavaFixTrader.java:139)
at JavaFixTrader.login(JavaFixTrader.java:112)
at JavaFixTrader.main(JavaFixTrader.java:549)
Request failed.
com.fxcm.GenericException: problem on communication request: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.session.PDasTransportSession.retrieveTradingSessions(PDasTransportSession.java:329)
at com.fxcm.messaging.util.UniversalUserSession.retrieveTradingSessions(UniversalUserSession.java:632)
at com.fxcm.internal.transport.FXCMGateway.getTradingSessionDescs(FXCMGateway.java:269)
at com.fxcm.internal.transport.FXCMGateway.login(FXCMGateway.java:352)
at JavaFixTrader.login(JavaFixTrader.java:139)
at JavaFixTrader.login(JavaFixTrader.java:112)
at JavaFixTrader.main(JavaFixTrader.java:549)
Caused by: com.fxcm.messaging.util.AuthenticationException: problem on communication request: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.session.PDasTransportSession.retrieveTradingSessions(PDasTransportSession.java:318)
... 6 more
Done
Can someone please tell me which host to use? I am using the same username and password that I use to login in MetaTrader 4 to a demo server.
Thanks.
-
The terminal in your case would be "Demo" and the server is the url "http://www.fxcorporate.com/Hosts.jsp"
Please let us know if you have any other questions.
-
Thanks for your response, I am still getting the same error, I am using the same username and password that I use to login in MetaTrader 4 to a demo server (e.g. "FXCM-GBPDemo01"). My username is "2048265609". Can someone please tell me what I am missing?
Logging in
03/02/2012 6:14:23 PM com.fxcm.messaging.util.pdas.communicator.Communicator request
SEVERE: Unexpected end of file from server
com.fxcm.messaging.util.CommunicationException: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.communicator.http.HttpCommunicator.httpSend(HttpCommunicator.java:304)
at com.fxcm.messaging.util.pdas.communicator.http.HttpCommunicator.trnSend(HttpCommunicator.java:125)
at com.fxcm.messaging.util.pdas.communicator.Communicator.trnSend(Communicator.java:153)
at com.fxcm.messaging.util.pdas.communicator.Communicator.request(Communicator.java:461)
at com.fxcm.messaging.util.pdas.communicator.Communicator.run(Communicator.java:350)
at java.lang.Thread.run(Unknown Source)
03/02/2012 6:14:23 PM com.fxcm.messaging.util.pdas.communicator.Communicator request
SEVERE: Unexpected end of file from server: Message type=BE
SID=null
112=NewSession-16--131627239-main
625=Demo
554=6aecdb967ad559f5dc0f6c23220575f6
336=
923=NewSession-16--131627239-main
924=5
553=2048265609
03/02/2012 6:14:24 PM com.fxcm.messaging.util.pdas.session.PDasTransportSession retrieveTradingSessions
SEVERE: problem on communication request: Unexpected end of file from server
com.fxcm.messaging.util.AuthenticationException: problem on communication request: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.session.PDasTransportSession.retrieveTradingSessions(PDasTransportSession.java:318)
at com.fxcm.messaging.util.UniversalUserSession.retrieveTradingSessions(UniversalUserSession.java:632)
at com.fxcm.internal.transport.FXCMGateway.getTradingSessionDescs(FXCMGateway.java:269)
at com.fxcm.internal.transport.FXCMGateway.login(FXCMGateway.java:352)
at JavaFixTrader.login(JavaFixTrader.java:139)
at JavaFixTrader.login(JavaFixTrader.java:112)
at JavaFixTrader.main(JavaFixTrader.java:549)
Request failed.
com.fxcm.GenericException: problem on communication request: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.session.PDasTransportSession.retrieveTradingSessions(PDasTransportSession.java:329)
at com.fxcm.messaging.util.UniversalUserSession.retrieveTradingSessions(UniversalUserSession.java:632)
at com.fxcm.internal.transport.FXCMGateway.getTradingSessionDescs(FXCMGateway.java:269)
at com.fxcm.internal.transport.FXCMGateway.login(FXCMGateway.java:352)
at JavaFixTrader.login(JavaFixTrader.java:139)
at JavaFixTrader.login(JavaFixTrader.java:112)
at JavaFixTrader.main(JavaFixTrader.java:549)
Caused by: com.fxcm.messaging.util.AuthenticationException: problem on communication request: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.session.PDasTransportSession.retrieveTradingSessions(PDasTransportSession.java:318)
... 6 more
Done
-
I believe that was the case with some of our older MT4 demos. Please try the credentials of a new demo account below and let me know if this helps.
User ID: 80002226
Password: 7955
-
Hi, thanks for your response but I am still getting the same error as shown below:
As you can see by the highlighted sections, I have changed the login to the above and the terminal to be "Demo"
Is there anything else I need to change?
Logging in
06/02/2012 8:05:20 PM com.fxcm.messaging.util.pdas.communicator.Communicator request
SEVERE: Unexpected end of file from server
com.fxcm.messaging.util.CommunicationException: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.communicator.http.HttpCommunicator.httpSend(HttpCommunicator.java:304)
at com.fxcm.messaging.util.pdas.communicator.http.HttpCommunicator.trnSend(HttpCommunicator.java:125)
at com.fxcm.messaging.util.pdas.communicator.Communicator.trnSend(Communicator.java:153)
at com.fxcm.messaging.util.pdas.communicator.Communicator.request(Communicator.java:461)
at com.fxcm.messaging.util.pdas.communicator.Communicator.run(Communicator.java:350)
at java.lang.Thread.run(Unknown Source)
06/02/2012 8:05:20 PM com.fxcm.messaging.util.pdas.communicator.Communicator request
SEVERE: Unexpected end of file from server: Message type=BE
SID=null
112=NewSession-39-445942141-main
625=Demo
554=867d42480d4b75283e28efad3f3d0d61
336=
923=NewSession-39-445942141-main
924=5
553=80002226
06/02/2012 8:05:20 PM com.fxcm.messaging.util.pdas.session.PDasTransportSession retrieveTradingSessions
SEVERE: problem on communication request: Unexpected end of file from server
com.fxcm.messaging.util.AuthenticationException: problem on communication request: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.session.PDasTransportSession.retrieveTradingSessions(PDasTransportSession.java:318)
at com.fxcm.messaging.util.UniversalUserSession.retrieveTradingSessions(UniversalUserSession.java:632)
at com.fxcm.internal.transport.FXCMGateway.getTradingSessionDescs(FXCMGateway.java:269)
at com.fxcm.internal.transport.FXCMGateway.login(FXCMGateway.java:352)
at JavaFixTrader.login(JavaFixTrader.java:139)
at JavaFixTrader.login(JavaFixTrader.java:112)
at JavaFixTrader.main(JavaFixTrader.java:549)
Request failed.
com.fxcm.GenericException: problem on communication request: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.session.PDasTransportSession.retrieveTradingSessions(PDasTransportSession.java:329)
at com.fxcm.messaging.util.UniversalUserSession.retrieveTradingSessions(UniversalUserSession.java:632)
at com.fxcm.internal.transport.FXCMGateway.getTradingSessionDescs(FXCMGateway.java:269)
at com.fxcm.internal.transport.FXCMGateway.login(FXCMGateway.java:352)
at JavaFixTrader.login(JavaFixTrader.java:139)
at JavaFixTrader.login(JavaFixTrader.java:112)
at JavaFixTrader.main(JavaFixTrader.java:549)
Caused by: com.fxcm.messaging.util.AuthenticationException: problem on communication request: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.session.PDasTransportSession.retrieveTradingSessions(PDasTransportSession.java:318)
... 6 more
Done
-
Please make sure you are using the latest build of the API. Seems that it might be using an older connecting model that we had.
Java Trading API Builds - Subscribe for Updates
Below is also a snippet of the code I use to login with the login credentials which I provided to you. This seems to work and it lets me get into the system.
String username = "80002226";
String password = "7955";
String terminal = "Demo";
String server = "http://www.fxcorporate.com/Hosts.jsp";
String file = null;
FXCMLoginProperties properties;
if (file == null) {
properties = new FXCMLoginProperties(username, password, terminal, server);
} else {
properties = new FXCMLoginProperties(username, password, terminal, server, file);
}
fxcmGateway.login(properties);
-
Hi, I was already using build 242. Below is my entire code(very simple, just trying to do a login):
========================================================
import com.fxcm.external.api.transport.FXCMLoginProperties;
import com.fxcm.external.api.transport.GatewayFactory;
import com.fxcm.external.api.transport.IGateway;
public class Test {
public static void main(String[] args) throws Exception {
String username = "80002226";
String password = "7955";
String terminal = "Demo";
String server = "http://www.fxcorporate.com/Hosts.jsp";
String file = null;
System.out.println("here 1");
IGateway fxcmGateway = GatewayFactory.createGateway();
System.out.println("here 2");
FXCMLoginProperties properties;
if (file == null) {
properties = new FXCMLoginProperties(username, password, terminal,
server);
} else {
properties = new FXCMLoginProperties(username, password, terminal,server, file);
}
System.out.println("here 3");
fxcmGateway.login(properties);
System.out.println("here 4");
}
}
========================================================
As you can see from the output below, "here 1","here 2","here 3" were printed and the error was encountered at the login phase. I have looked at
QATest.java supplied in the sdk and its the same in terms of how it logs in. I have also switched off any firewalls and antivirus software.
The only 2 libraries I am using is fxcm-api and fxmsg.jar. I have also included commons-logging.properties, fxmsg.properties, simplelog.properties in my working directory
Do you have any more leads?
Output
=====
here 1
here 2
here 3
08/02/2012 12:15:15 AM com.fxcm.messaging.util.pdas.communicator.Communicator request
SEVERE: Unexpected end of file from server
com.fxcm.messaging.util.CommunicationException: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.communicator.http.HttpCommunicator.httpSend(HttpCommunicator.java:304)
at com.fxcm.messaging.util.pdas.communicator.http.HttpCommunicator.trnSend(HttpCommunicator.java:125)
at com.fxcm.messaging.util.pdas.communicator.Communicator.trnSend(Communicator.java:153)
at com.fxcm.messaging.util.pdas.communicator.Communicator.request(Communicator.java:461)
at com.fxcm.messaging.util.pdas.communicator.Communicator.run(Communicator.java:350)
at java.lang.Thread.run(Unknown Source)
08/02/2012 12:15:15 AM com.fxcm.messaging.util.pdas.communicator.Communicator request
SEVERE: Unexpected end of file from server: Message type=BE
SID=null
112=NewSession-18-1349513248-main
625=Demo
554=867d42480d4b75283e28efad3f3d0d61
336=
923=NewSession-18-1349513248-main
924=5
553=80002226
08/02/2012 12:15:15 AM com.fxcm.messaging.util.pdas.session.PDasTransportSession retrieveTradingSessions
SEVERE: problem on communication request: Unexpected end of file from server
com.fxcm.messaging.util.AuthenticationException: problem on communication request: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.session.PDasTransportSession.retrieveTradingSessions(PDasTransportSession.java:318)
at com.fxcm.messaging.util.UniversalUserSession.retrieveTradingSessions(UniversalUserSession.java:632)
at com.fxcm.internal.transport.FXCMGateway.getTradingSessionDescs(FXCMGateway.java:269)
at com.fxcm.internal.transport.FXCMGateway.login(FXCMGateway.java:352)
at Test.main(Test.java:26)
Exception in thread "main" com.fxcm.GenericException: problem on communication request: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.session.PDasTransportSession.retrieveTradingSessions(PDasTransportSession.java:329)
at com.fxcm.messaging.util.UniversalUserSession.retrieveTradingSessions(UniversalUserSession.java:632)
at com.fxcm.internal.transport.FXCMGateway.getTradingSessionDescs(FXCMGateway.java:269)
at com.fxcm.internal.transport.FXCMGateway.login(FXCMGateway.java:352)
at Test.main(Test.java:26)
Caused by: com.fxcm.messaging.util.AuthenticationException: problem on communication request: Unexpected end of file from server
at com.fxcm.messaging.util.pdas.session.PDasTransportSession.retrieveTradingSessions(PDasTransportSession.java:318)
... 4 more
Last edited by drmack; 02-07-2012 at 07:33 AM.
-
We have checked the logs and it seems the only connections this week have been from FXCM and no other source. It does not seem like your connection attempts are reaching our servers. Can you please check your firewall to make sure that ports 80 and 443 are both open to allow the API to connect.
|