05-31-2007 12:01 AM - edited 03-13-2019 04:10 PM
To avoid using the extra classes coming with the axltoolkit I am trying to do the connection to the AXL server without the SOAP factory, which means I can?t use the URLendpoint definition. The creation of the socket looks like this:
X509TrustManager xtm = new MyTrustManager();
TrustManager[] mytm = { xtm };
SSLContext ctx = SSLContext.getInstance("SSL");
ctx.init(null, mytm, null);
SSLSocketFactory sf = ctx.getSocketFactory();
HttpsURLConnection.setDefaultSSLSocketFactory(sf);
HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
public boolean verify(String hostname,SSLSession session) {
return true;
}
});
Socket socket = sf.createSocket(host,port);
First question, which port number should this be? Using 8443 I get a handshake error.
I am also a bit confused of the message header I should build then. Should it look like this?
POST :8443/axl
Host: ccm:80
Authorization: Basic wuiuiuqzezzq
Accept: text/*
Content-type: text/xml
Content-length:
Again I am a bit confused of the port numbers? Did anybody tried it like this? I also gave it a try using a normal socket, with no SSLContext and then I got no answer at all from the server, and no error.
Thanks!
alej
05-31-2007 04:02 AM
The documentation is indeed very confusing....
I didn't have any problems opening a regular HttpsURLConnection to a ccm 5.x so forget about port 8443.. only the axlsqltoolkit uses it but you can do axl by connecting to the standard https port. And there's no need for the special post header either.
05-31-2007 10:39 PM
oh yes, confusing indeed! I managed it now, thanks a lot for your feedback!!!!!
cheers,
alej
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide