java - Where to start when trying to retrieve data with requests and responses coded in XML and HTTP is the protocol -
to start, newbie programmer , have taken on summer job after finishing first year in college year. have been asked write code program requests , responses coded in xml. have been told requests made via post command , both request parameters , responses carried out in body of http sent , received specific url. have been given command format example:
<?xml version="1.0" encoding="utf-8"?> <cmd action="read_val" user="username" password="*****"> <val cid="0" node="1" vid="100" set="5" nodetype="16"/> </cmd>
i have searched high , low , have found loads of different information on topic there technical me @ moment. need 'baby steps' help. small company , there no other programmers ask questions , advice.
i learning java in college , have used site many times , have found useful. can open sockets, bind sockets etc in java , read in data input on forms use above code. how connect java know xml above. know in on head have been trying figure out last 3-4 weeks no joy , head burst.
at other end of url monitor capturing ongoing data such pressure , temperature. connection made being used read in data @ set interval , stored in database. if data going system.out.println manage rest!!
i have looked @ many examples , read information don't know begin - use netbeans , java or different need know.
sorry , in advance!
seems trying "consuming xml rest service" (this might want google).
there several ways it, , depends on libraries want use.
a start splitting problem several parts.
creating class contains information need send. (so can manipulated in java)
mapping class xml. (so can transform java objects xml , vice-versa)
consuming service. (this sending post request server xml data on body)
there several libraries can achieve this. start using jaxb (https://docs.oracle.com/javase/tutorial/jaxb/intro/) first 2 steps, , creating rest client using either apache httpclient, spring's resttemplate or jersey.
Comments
Post a Comment