org.ksoap2.transport
Interface ServiceConnection


public interface ServiceConnection

Interface to allow the abstraction of the raw transport information


Method Summary
 void connect()
          Make an outgoing connection.
 void disconnect()
          Disconnect from the outgoing connection
 InputStream getErrorStream()
           
 String getHost()
          Return the name of the host that is specified as the web service target
 String getPath()
          Return the path to the web service target
 int getPort()
          Return the port number of the host that is specified as the web service target
 List getResponseProperties()
          Returns to the caller all of the headers that were returned with the response to the SOAP request.
 InputStream openInputStream()
          Opens and returns the inputstream from which to parse the result of the soap call.
 OutputStream openOutputStream()
          Open and return the outputStream to the endpoint.
 void setRequestMethod(String requestMethodType)
          Sets how to make the requests.
 void setRequestProperty(String propertyName, String value)
          Set properties on the outgoing connection.
 

Method Detail

connect

void connect()
             throws IOException
Make an outgoing connection.

Throws:
IOException

disconnect

void disconnect()
                throws IOException
Disconnect from the outgoing connection

Throws:
IOException

getResponseProperties

List getResponseProperties()
                           throws IOException
Returns to the caller all of the headers that were returned with the response to the SOAP request. Primarily this gives the caller an opportunity to save the cookies for later use.

Returns:
List of HeaderProperty instances that were returned as part of the http response as http header properties
Throws:
IOException

setRequestProperty

void setRequestProperty(String propertyName,
                        String value)
                        throws IOException
Set properties on the outgoing connection.

Parameters:
propertyName - the name of the property to set. For HTTP connections these are the request properties in the HTTP Header.
value - the string to set the property header to.
Throws:
IOException

setRequestMethod

void setRequestMethod(String requestMethodType)
                      throws IOException
Sets how to make the requests. For HTTP this is typically POST or GET.

Parameters:
requestMethodType - the type of request method to make the soap call with.
Throws:
IOException

openOutputStream

OutputStream openOutputStream()
                              throws IOException
Open and return the outputStream to the endpoint.

Returns:
the output stream to write the soap message to.
Throws:
IOException

openInputStream

InputStream openInputStream()
                            throws IOException
Opens and returns the inputstream from which to parse the result of the soap call.

Returns:
the inputstream containing the xml to parse the result from the call from.
Throws:
IOException

getErrorStream

InputStream getErrorStream()
Returns:
the error stream for the call.

getHost

String getHost()
Return the name of the host that is specified as the web service target

Returns:
Host name

getPort

int getPort()
Return the port number of the host that is specified as the web service target

Returns:
Port number

getPath

String getPath()
Return the path to the web service target

Returns:
The URL's path


Copyright © 2002-2011. All Rights Reserved.