// This class was generated by the JAXRPC SI, do not edit.
// Contents subject to change without notice.
// JAX-RPC Standard Implementation (1.1, build EA-R39)

package com.agiledeveloper.ws;

import com.sun.xml.rpc.server.http.MessageContextProperties;
import com.sun.xml.rpc.streaming.*;
import com.sun.xml.rpc.encoding.*;
import com.sun.xml.rpc.encoding.soap.SOAPConstants;
import com.sun.xml.rpc.encoding.soap.SOAP12Constants;
import com.sun.xml.rpc.encoding.literal.*;
import com.sun.xml.rpc.soap.streaming.*;
import com.sun.xml.rpc.soap.message.*;
import com.sun.xml.rpc.soap.SOAPVersion;
import com.sun.xml.rpc.soap.SOAPEncodingConstants;
import com.sun.xml.rpc.wsdl.document.schema.SchemaConstants;
import javax.xml.namespace.QName;
import java.rmi.RemoteException;
import java.util.Iterator;
import java.lang.reflect.*;
import java.lang.Class;
import com.sun.xml.rpc.client.SenderException;
import com.sun.xml.rpc.client.*;
import com.sun.xml.rpc.client.http.*;
import javax.xml.rpc.handler.*;
import javax.xml.rpc.JAXRPCException;
import javax.xml.rpc.soap.SOAPFaultException;

public class LifetimeIF_Stub
    extends com.sun.xml.rpc.client.StubBase
    implements com.agiledeveloper.ws.LifetimeIF {
    
    
    /*
     *  public constructor
     */
    public LifetimeIF_Stub(HandlerChain handlerChain) {
        super(handlerChain);
        _setProperty(ENDPOINT_ADDRESS_PROPERTY, "http://localhost:8080/Lifetime/Lifetime");
    }
    
    
    /*
     *  implementation of getInfo
     */
    public java.lang.String getInfo()
        throws java.rmi.RemoteException {
        
        try {
            
            StreamingSenderState _state = _start(_handlerChain);
            
            InternalSOAPMessage _request = _state.getRequest();
            _request.setOperationCode(getInfo_OPCODE);
            com.agiledeveloper.ws.LifetimeIF_getInfo_RequestStruct _myLifetimeIF_getInfo_RequestStruct =
                new com.agiledeveloper.ws.LifetimeIF_getInfo_RequestStruct();
            
            
            SOAPBlockInfo _bodyBlock = new SOAPBlockInfo(ns1_getInfo_getInfo_QNAME);
            _bodyBlock.setValue(_myLifetimeIF_getInfo_RequestStruct);
            _bodyBlock.setSerializer(ns1_myLifetimeIF_getInfo_RequestStruct_SOAPSerializer);
            _request.setBody(_bodyBlock);
            
            _state.getMessageContext().setProperty(HttpClientTransport.HTTP_SOAPACTION_PROPERTY, "");
            
            _send((String) _getProperty(ENDPOINT_ADDRESS_PROPERTY), _state);
            
            com.agiledeveloper.ws.LifetimeIF_getInfo_ResponseStruct _myLifetimeIF_getInfo_ResponseStruct = null;
            Object _responseObj = _state.getResponse().getBody().getValue();
            if (_responseObj instanceof SOAPDeserializationState) {
                _myLifetimeIF_getInfo_ResponseStruct =
                    (com.agiledeveloper.ws.LifetimeIF_getInfo_ResponseStruct)((SOAPDeserializationState)_responseObj).getInstance();
            } else {
                _myLifetimeIF_getInfo_ResponseStruct =
                    (com.agiledeveloper.ws.LifetimeIF_getInfo_ResponseStruct)_responseObj;
            }
            
            return _myLifetimeIF_getInfo_ResponseStruct.getResult();
        } catch (RemoteException e) {
            // let this one through unchanged
            throw e;
        } catch (JAXRPCException e) {
            throw new RemoteException(e.getMessage(), e);
        } catch (Exception e) {
            if (e instanceof RuntimeException) {
                throw (RuntimeException)e;
            } else {
                throw new RemoteException(e.getMessage(), e);
            }
        }
    }
    
    
    /*
     *  this method deserializes the request/response structure in the body
     */
    protected void _readFirstBodyElement(XMLReader bodyReader, SOAPDeserializationContext deserializationContext, StreamingSenderState  state) throws Exception {
        int opcode = state.getRequest().getOperationCode();
        switch (opcode) {
            case getInfo_OPCODE:
                _deserialize_getInfo(bodyReader, deserializationContext, state);
                break;
            default:
                throw new SenderException("sender.response.unrecognizedOperation", Integer.toString(opcode));
        }
    }
    
    
    
    /*
     * This method deserializes the body of the getInfo operation.
     */
    private void _deserialize_getInfo(XMLReader bodyReader, SOAPDeserializationContext deserializationContext, StreamingSenderState state) throws Exception {
        Object myLifetimeIF_getInfo_ResponseStructObj =
            ns1_myLifetimeIF_getInfo_ResponseStruct_SOAPSerializer.deserialize(ns1_getInfo_getInfoResponse_QNAME,
                bodyReader, deserializationContext);
        
        SOAPBlockInfo bodyBlock = new SOAPBlockInfo(ns1_getInfo_getInfoResponse_QNAME);
        bodyBlock.setValue(myLifetimeIF_getInfo_ResponseStructObj);
        state.getResponse().setBody(bodyBlock);
    }
    
    
    
    
    public String _getDefaultEnvelopeEncodingStyle() {
        return null;
    }
    
    public String _getImplicitEnvelopeEncodingStyle() {
        return "";
    }
    
    public String _getEncodingStyle() {
        return SOAPNamespaceConstants.ENCODING;
    }
    
    public void _setEncodingStyle(String encodingStyle) {
        throw new UnsupportedOperationException("cannot set encoding style");
    }
    
    
    
    
    
    /*
     * This method returns an array containing (prefix, nsURI) pairs.
     */
    protected String[] _getNamespaceDeclarations() {
        return myNamespace_declarations;
    }
    
    /*
     * This method returns an array containing the names of the headers we understand.
     */
    public QName[] _getUnderstoodHeaders() {
        return understoodHeaderNames;
    }
    
    public void _initialize(InternalTypeMappingRegistry registry) throws Exception {
        super._initialize(registry);
        ns1_myLifetimeIF_getInfo_ResponseStruct_SOAPSerializer = (CombinedSerializer)registry.getSerializer(SOAPConstants.NS_SOAP_ENCODING, com.agiledeveloper.ws.LifetimeIF_getInfo_ResponseStruct.class, ns1_getInfoResponse_TYPE_QNAME);
        ns1_myLifetimeIF_getInfo_RequestStruct_SOAPSerializer = (CombinedSerializer)registry.getSerializer(SOAPConstants.NS_SOAP_ENCODING, com.agiledeveloper.ws.LifetimeIF_getInfo_RequestStruct.class, ns1_getInfo_TYPE_QNAME);
    }
    
    private static final QName _portName = new QName("http://www.agiledeveloper.com/wsdl/Lifetime", "LifetimeIFPort");
    private static final int getInfo_OPCODE = 0;
    private static final QName ns1_getInfo_getInfo_QNAME = new QName("http://www.agiledeveloper.com/wsdl/Lifetime", "getInfo");
    private static final QName ns1_getInfo_TYPE_QNAME = new QName("http://www.agiledeveloper.com/wsdl/Lifetime", "getInfo");
    private CombinedSerializer ns1_myLifetimeIF_getInfo_RequestStruct_SOAPSerializer;
    private static final QName ns1_getInfo_getInfoResponse_QNAME = new QName("http://www.agiledeveloper.com/wsdl/Lifetime", "getInfoResponse");
    private static final QName ns1_getInfoResponse_TYPE_QNAME = new QName("http://www.agiledeveloper.com/wsdl/Lifetime", "getInfoResponse");
    private CombinedSerializer ns1_myLifetimeIF_getInfo_ResponseStruct_SOAPSerializer;
    private static final String[] myNamespace_declarations =
                                        new String[] {
                                            "ns0", "http://www.agiledeveloper.com/wsdl/Lifetime"
                                        };
    
    private static final QName[] understoodHeaderNames = new QName[] {  };
}
