com.oakgrovesystems.net
Class XMLClient

java.lang.Object
  |
  +--com.oakgrovesystems.net.XMLClient

public class XMLClient
extends java.lang.Object

This class is meant for connecting to a URL, sending an XML request as an HTTP POST, and receiving an XML response. Only XML over HTTP is supported.

      URL url = ...
      String requestString = "


Field Summary
protected  java.net.URLConnection connection
           
protected  java.net.URL url
           
 
Constructor Summary
XMLClient(java.net.URL newURL)
           
 
Method Summary
 java.lang.String getResponse()
           
static void main(java.lang.String[] args)
          Connects to a URL, sends the contents of an XML file, prints the XML response to standard output.
protected static java.lang.String readRequestFile(java.lang.String filename)
           
 void sendRequest(java.lang.String request)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

protected java.net.URL url

connection

protected java.net.URLConnection connection
Constructor Detail

XMLClient

public XMLClient(java.net.URL newURL)
          throws java.io.IOException
Method Detail

sendRequest

public void sendRequest(java.lang.String request)
                 throws java.io.IOException
java.io.IOException

getResponse

public java.lang.String getResponse()
                             throws java.io.IOException
java.io.IOException

readRequestFile

protected static java.lang.String readRequestFile(java.lang.String filename)
                                           throws java.io.IOException
java.io.IOException

main

public static void main(java.lang.String[] args)
Connects to a URL, sends the contents of an XML file, prints the XML response to standard output. Usage: java com.oakgrovesystems.net.XMLClient URL RequestFile



Copyright (c) 1999-2004 Oak Grove Systems. All Rights Reserved.