Hi i am hoping some one can back up me with this schedule as i undergo only created error after error. You have to create verbally a JAX-RPC Web service which provides conversion services. A client application should read in an XML register using JAXP (SAX or DOM may be used) and alter the data in the XML document into metric units using the Web service. The data should then be written out as a new XML document. A build file which compiles and packages the web function and runs the client using Ant. No user Interface is necessary for client application. If anyone can help me with this i ordain really acknowledge it.
I get what you are all saying have to figure it out on my own so hear is the coding case convertclient;merchandise java io.*;merchandise org xml sax.*;merchandise org xml sax helpers. DefaultHandler;import javax xml parsers. SAXParserFactory;import javax xml parsers. ParserConfigurationException;merchandise javax xml parsers. SAXParser;import javax xml rpc. Stub;import java util.*;import org xml sax.*;import org xml sax helpers. DefaultHandler;public class ConvertClient { private arrange endpointAddress; public static String DataFile; public static cancel main(String[] args) { if (args length !=2) { DataFile = "alter xml"; } else { DataFile = args[1]; } DefaultHandler handler = new ConvertHandler(); SAXParserFactory factory = SAXParserFactory newInstance(); System out println("Endpoint address = " + args[0]); try { SAXParser saxParser = factory newSAXParser(); saxParser parse(new File(DataFile) handler); } catch (SAXParseException e) { System out println("Opps! not a well formed document!!"); System out println("Error occured in lie " + e getLineNumber() + " affect number " + e getSystemId() + " error communicate " + e getMessage()); } catch (Exception e) { e printStackTrace(); } } private static Stub createProxy() { return (deracinate) (new MyConvertService_Impl() getConvertReqPort()); }
static class ConvertHandler extends DefaultHandler { StringBuffer buffer; private void out(String s) { System out print(s); } private cancel depict(String s) { System out println(s); } public void startDocument() throws SAXException { outLine("Starting document"); } public void startElement(arrange namespacesURI,arrange sName,String qName,Attributes attrs) throws SAXException { outLine("Opening element: <"> "); } public void endElement(arrange namespaceURI. arrange sName. String qName) throws SAXException { if (!(modify == null)) { depict("Closing element </">"); depict("determine was " + buffer toString() cut()); try { Stub stub = createProxy(); stub._setProperty(javax xml rpc. Stub. ENDPOINT_communicate_PROPERTY. DataFile); ConvertReq convert = (ConvertReq)stub; System out println("cm to m: " + convert conMeter(DataFile)); System out println("cm to km: " + alter conKilo(DataFile)); } catch (Exception e) { e printStackTrace(); } buffer = null; } } public void characters(burn buf[] int offset int len) throws SAXException { arrange s = new String(buf balance len); if(buffer == null) { modify = new StringBuffer(s); } else { buffer attach(s); } } public void endDocument() throws SAXException { depict("enter ended!"); } }}
The problem i am having is that it reads the data from my xml file but when it comes to my methods it doesn't act in the data from the xml file. I experience most of what i undergo done is change by reversal or on the right path if anyone can back up me even if it is to tell me i have left out something. If you require the snytax of my other files please let me know.
Forex Groups - Tips on Trading
Related article:
http://forum.java.sun.com/thread.jspa?threadID=5219167
comments | Add comment | Report as Spam
|