package oracle.portal.sample.v2.devguide.webservices;
import oracle.soap.transport.http.OracleSOAPHTTPConnection;
import java.net.URL;
import java.io.StringBufferInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.ByteArrayOutputStream;
import org.apache.soap.Constants;
import org.apache.soap.Fault;
import org.apache.soap.SOAPException;
import org.apache.soap.rpc.Call;
import org.apache.soap.rpc.Parameter;
import org.apache.soap.rpc.Response;
import java.util.Properties;
import oracle.xml.parser.v2.XMLDocument;
import org.w3c.dom.Document;
import oracle.xml.parser.v2.DOMParser;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import oracle.xml.parser.v2.XSLProcessor;
import oracle.xml.parser.v2.XSLStylesheet;
import oracle.xml.parser.v2.XMLDocumentFragment;
/**
 * Generated by the Oracle9i JDeveloper Web Services Stub/Skeleton Generator.
 * Date Created: Mon Jul 29 15:47:45 IST 2002
 */

public class OTNNewsStub 
{
  public String endpoint = "http://otn.oracle.com/ws/oracle.otn.ws.news.OTNNews";
  private OracleSOAPHTTPConnection m_httpConnection = null;

  public OTNNewsStub()
  {
    m_httpConnection = new OracleSOAPHTTPConnection();
  }

  public String getRss() throws Exception
  {
    String returnVal = null;

    URL endpointURL = new URL(endpoint);
    Call call = new Call();
    call.setSOAPTransport(m_httpConnection);
    call.setTargetObjectURI("oracle.otn.ws.news.OTNNews");
    call.setMethodName("getRss");
    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

    Response response = call.invoke(endpointURL, "");

    if (!response.generatedFault())
    {
      Parameter result = response.getReturnValue();
      returnVal = (String)result.getValue();
    }
      else
      {
        Fault fault = response.getFault();
        throw new SOAPException(fault.getFaultCode(), fault.getFaultString());
      }

    return returnVal;
  }

  public void setMaintainSession(boolean maintainSession)
  {
    m_httpConnection.setMaintainSession(maintainSession);
  }

  public boolean getMaintainSession()
  {
    return m_httpConnection.getMaintainSession();
  }

  public void setTransportProperties(Properties props)
  {
    m_httpConnection.setProperties(props);
  }

  public Properties getTransportProperties()
  {
    return m_httpConnection.getProperties();
  }
}
