on 12-01-2015 9:53 AM
Hi
I have this P4-HTTP example
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.Properties;
public class ExampleTransportTypesSwitching {
private static InitialContext ctx = null;
public static void main(String[] args) {
init ("P4HTTP://", "172.16.10.65", "50004", "administrator", "123QWEasd", "httptunneling");
}
public static void init(String schema, String host, String port, String user, String pass, String transportType) {
try {
Properties p = new Properties();
if (schema == null) {
schema = "P4://";
}
p.put("java.naming.factory.initial", "com.sap.engine.services.jndi.InitialContextFactoryImpl");
p.put("java.naming.provider.url", host+":"+port);
p.put("java.naming.security.principal", user);
p.put("java.naming.security.credentials", pass);
// Parameter transportType for Transport Layer Queue has value
// "None", "ssl", "httptunneling_ssl" or "httptunneling".
p.put("TransportLayerQueue", transportType);
ctx = new InitialContext(p);
System.out.println("NamingClient context: " + ctx);
} catch(NamingException e) {
e.printStackTrace();
}
}
on my server SAP NW 7.4 listen 50004,50007,50008 ports. I can send and receive successfully RMI requests, but over HTTP don't can. I got this exception
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.net.SocketInputStream.read(SocketInputStream.java:223)
at com.sap.engine.services.httptunneling.HttpLib.readLine(HttpLib.java:159)
at com.sap.engine.services.httptunneling.HttpLib.readHeader(HttpLib.java:182)
at com.sap.engine.services.httptunneling.HttpTunnelingSocket.createConnection(HttpTunnelingSocket.java:208)
at com.sap.engine.services.httptunneling.HttpTunnelingSocket.<init>(HttpTunnelingSocket.java:113)
at com.sap.engine.services.httptunneling.HttpTunnelingTransportFactory.getSocket
Please help, what I do wrong?
tnx
For P4HTTP default port number is 5NN05 (NN - instance number). Moreover, you need to add schema to java.naming.provider.url.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for reply.
But in my servers don't open 5NN05 port, need enable manually ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Open listen to a port using java code
import java.net.*;
import java.io.*;
public class PortMonitor {
/**
* JavaProgrammingForums.com
*/
public static void main(String[] args) throws Exception {
//Port to monitor
final int myPort = 50008;
ServerSocket ssock = new ServerSocket(myPort);
System.out.println("port " + myPort + " opened");
Socket sock = ssock.accept();
System.out.println("Someone has made socket connection");
OneConnection client = new OneConnection(sock);
String s = client.getRequest();
}
}
Please check this document. it may be useful document 1 and document 2
Kindly let me know if you need any more information
As stated in documentation: "When using HTTP(S) tunneling, the client has to specify the HTTP(S) port of the server in the java.naming.provider.url". For SAP NetWeaver 7.4: AS Java Ports - SAP NetWeaver Application Server for Java Security Guide - SAP Library. For server X with instance number nn it should be 50000+100*nn+20+X*5+0. Also try to check ports via SAP MMC/MC.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.