// This source file is generated by Oracle tools and is subject to change
// It is a utility client for invoking the operations of the Web service port.
// For reporting problems, use the following
// Version = Oracle WebServices (10.1.3.3.0, build 070610.1800.23513)

package xqueryws.proxy;

import javax.xml.soap.SOAPElement;

import oracle.webservices.transport.ClientTransport;
import oracle.webservices.OracleStub;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.Stub;

public class ORAWSVPortClient {
    private xqueryws.proxy.ORAWSVPortType _port;
    
    public ORAWSVPortClient() throws Exception {
        ServiceFactory factory = ServiceFactory.newInstance();
        _port = ((xqueryws.proxy.ORAWSVService)factory.loadService(xqueryws.proxy.ORAWSVService.class)).getORAWSVPort();
    }
    
    /**
     * @param args
     */
    public static void main(String[] args) {
        try {
            xqueryws.proxy.ORAWSVPortClient myPort = new xqueryws.proxy.ORAWSVPortClient();
            System.out.println("calling " + myPort.getEndpoint());
            // Add your own code here
             myPort.setUsername("oe"); 
             myPort.setPassword("oe"); 
             String endPoint = myPort.getEndpoint(); 
             xqueryws.proxy.Query_text xq_text = new Query_text();
             xqueryws.proxy.Query xq = new Query(); 
             xq_text.setType(xqueryws.proxy.Query_textType.XQUERY); 
             xq_text.set_value("ora:view(\"PO_SL_BIX_TABLE\")/PurchaseOrder/Reference"); 
             xq.setQuery_text(xq_text); 
             System.out.println("Invoking the web service"); 
             SOAPElement res = myPort.XMLFromQuery(xq); 
             System.out.println("Done. You can now check your result with HTTP Analyzer.");
        
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
    /**
     * delegate all operations to the underlying implementation class.
     */
    
    public javax.xml.soap.SOAPElement XMLFromQuery(Query body) throws java.rmi.RemoteException {
        return _port.XMLFromQuery(body);
    }
    
    
    /**
     * used to access the JAX-RPC level APIs
     * returns the interface of the port instance
     */
    public xqueryws.proxy.ORAWSVPortType getPort() {
        return _port;
    }
    
    public String getEndpoint() {
        return (String) ((Stub) _port)._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY);
    }
    
    public void setEndpoint(String endpoint) {
        ((Stub) _port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, endpoint);
    }
    
    public String getPassword() {
        return (String) ((Stub) _port)._getProperty(Stub.PASSWORD_PROPERTY);
    }
    
    public void setPassword(String password) {
        ((Stub) _port)._setProperty(Stub.PASSWORD_PROPERTY, password);
    }
    
    public String getUsername() {
        return (String) ((Stub) _port)._getProperty(Stub.USERNAME_PROPERTY);
    }
    
    public void setUsername(String username) {
        ((Stub) _port)._setProperty(Stub.USERNAME_PROPERTY, username);
    }
    
    public void setMaintainSession(boolean maintainSession) {
        ((Stub) _port)._setProperty(Stub.SESSION_MAINTAIN_PROPERTY, Boolean.valueOf(maintainSession));
    }
    
    public boolean getMaintainSession() {
        return ((Boolean) ((Stub) _port)._getProperty(Stub.SESSION_MAINTAIN_PROPERTY)).booleanValue();
    }
    
    /**
     * returns the transport context
     */
    public ClientTransport getClientTransport() {
        return ((OracleStub) _port).getClientTransport();
    }
    
}
