001: package customfactory.client;
002:
003: import org.apache.wsif.WSIFServiceFactory;
004: import org.apache.wsif.WSIFService;
005: import org.apache.wsif.WSIFException;
006: import javax.wsdl.*;
007:
008: public class CustomServiceFactoryImpl extends WSIFServiceFactory {
009: public CustomServiceFactoryImpl() {
010: System.out.println("Using custom factory");
011: }
012:
013: /**
014: * Create a WSIFService from WSDL document URL.
015: * <br> If serviceName or serviceNS is null,
016: * then WSDL document must have exactly one service in it.
017: * <br> If portTypeName or portTypeNS is null,
018: * then WSDL document must have exactly one portType in it
019: * and all ports of the selected service must
020: * implement the same portType.
021: * @param wsdlLoc The URL for the wsdl's location
022: * @param serviceNS The namespace of the service
023: * @param serviceName The name of the service
024: * @param portTypeNS The namespace of the port type
025: * @param portTypeName The name of the port type
026: * @return The service
027: * @exception A WSIFException if an error occurs when creating the service
028: */
029: public WSIFService getService(String wsdlLoc, String serviceNS,
030: String serviceName, String portTypeNS, String portTypeName)
031: throws WSIFException {
032: CustomServiceImpl wsi = new CustomServiceImpl(wsdlLoc,
033: serviceNS, serviceName, portTypeNS, portTypeName);
034: return wsi;
035: }
036:
037: /**
038: * Create a WSIF service instance from WSDL document URL
039: * using a ClassLoader to find local resources.
040: * <br> If serviceName or serviceNS is null,
041: * then WSDL document must have exactly one service in it.
042: * <br> If portTypeName or portTypeNS is null,
043: * then WSDL document must have exactly one portType in it
044: * and all ports of the selected service must
045: * implement the same portType.
046: * @param wsdlLoc The URL for the wsdl's location
047: * @param cl A ClassLoader to use in locating the wsdl
048: * @param serviceNS The namespace of the service
049: * @param serviceName The name of the service
050: * @param portTypeNS The namespace of the port type
051: * @param portTypeName The name of the port type
052: * @return The service
053: * @exception A WSIFException if an error occurs when creating the service
054: */
055: public WSIFService getService(String wsdlLoc, ClassLoader cl,
056: String serviceNS, String serviceName, String portTypeNS,
057: String portTypeName) throws WSIFException {
058: CustomServiceImpl wsi = new CustomServiceImpl(wsdlLoc, cl,
059: serviceNS, serviceName, portTypeNS, portTypeName);
060: return wsi;
061: }
062:
063: /**
064: * Returns a new WSIFService.
065: * @param def The Definition object representing the wsdl
066: * @return The service
067: * @exception A WSIFException if an error occurs when creating the service
068: */
069: public WSIFService getService(Definition def) throws WSIFException {
070: CustomServiceImpl wsi = new CustomServiceImpl(def);
071: return wsi;
072: }
073:
074: /**
075: * Returns a new WSIFService.
076: * @param def The Definition object representing the wsdl
077: * @param service The Service object representing the service to use
078: * @return The service
079: * @exception A WSIFException if an error occurs when creating the service
080: */
081: public WSIFService getService(Definition def, Service service)
082: throws WSIFException {
083: CustomServiceImpl wsi = new CustomServiceImpl(def, service);
084: return wsi;
085: }
086:
087: /**
088: * Returns a new WSIFService.
089: * @param def The Definition object representing the wsdl
090: * @param service The Service object representing the service to use
091: * @param portType The PortType object representing the port type to use
092: * @return The service
093: * @exception A WSIFException if an error occurs when creating the service
094: */
095: public WSIFService getService(Definition def, Service service,
096: PortType portType) throws WSIFException {
097: CustomServiceImpl wsi = new CustomServiceImpl(def, service,
098: portType);
099: return wsi;
100: }
101:
102: /**
103: * Returns a new WSIFService.
104: * @param def The Definition object representing the wsdl
105: * @param serviceNS The namespace of the service
106: * @param serviceName The name of the service
107: * @param portTypeNS The namespace of the port type
108: * @param portTypeName The name of the port type
109: * @return The service
110: * @exception A WSIFException if an error occurs when creating the service
111: */
112: public WSIFService getService(Definition def, String serviceNS,
113: String serviceName, String portTypeNS, String portTypeName)
114: throws WSIFException {
115: CustomServiceImpl wsi = new CustomServiceImpl(def, serviceNS,
116: serviceName, portTypeNS, portTypeName);
117: return wsi;
118: }
119: }
|