• Post Reply Bookmark Topic Watch Topic
  • New Topic

Querying Raspberry Pi Server through XML API (ZigBee Gateway)  RSS feed

Henry Sellers
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm using a Raspberry Pi as ZigBee Gateway and I have an API from Smartenit which has simple XML queries which are not working for me...it worked yesterday but now......!

The port and IP address are definitely correct...any ideas please?!

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;

public class SimpleSocketServer {

public static void main(String args[]) throws Exception {

ServerSocket serverSocket;
int portNumber = 50333;
Socket socket = new Socket("", portNumber);
String str;

str = "<zbpPacket>";
str += "<Object>ZBP_System</Object>";
str += "<methodName>Sys_Authenticate</methodName>";
str += "<Arguments>";
str += "<Argument type='string'>Smartenit</Argument>";
str += "</Argument>";
str += "</Arguments>";
str += "</zbpPacket>";

serverSocket = new ServerSocket(portNumber);

System.out.println("Waiting for a connection on " + portNumber);

socket = serverSocket.accept();

InputStreamReader isr = new InputStreamReader(socket.getInputStream());
BufferedReader in = new BufferedReader(isr);

String line = "";
while ((line = in.readLine()) != null) {



  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!