1 package org.controlhaus.xfire.client; 2 3 import org.apache.xmlbeans.XmlObject; 4 import org.codehaus.xfire.fault.XFireFault; 5 6 import org.apache.beehive.controls.api.bean.ControlInterface; 7 import org.apache.beehive.controls.api.properties.PropertySet; 8 9 import java.io.IOException; 10 import java.lang.annotation.Retention; 11 import java.lang.annotation.RetentionPolicy; 12 import java.lang.annotation.Target; 13 import java.lang.annotation.ElementType; 14 15 /*** 16 * An XFire client control. Included are two annotations which 17 * can be used to configure the control. Encoding, which will specify 18 * the encoding. It defaults to UTF-8. Also the ServiceUrl annotation 19 * will specify which url to invoke for the service. 20 * <p> 21 * A typical usage would look like so: 22 * <pre> 23 * {@literal @}Encoding("UTF-8") 24 * {@literal @}ServiceUrl("http://some.service.com") 25 * {@literal @}Control XFireClientControl client; 26 * </pre> 27 * 28 * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a> 29 * @since Nov 5, 2004 30 */ 31 @ControlInterface 32 public interface XFireClientControl 33 { 34 /*** 35 * Invoke a SOAP service. 36 * 37 * @param request The request as XMLBeans. 38 * @return The response as XMLBeans. 39 * @throws XFireFault 40 */ 41 XmlObject[] invoke( XmlObject[] request ) throws IOException, XFireFault; 42 43 @PropertySet(prefix="Encoding") 44 @Target( {ElementType.TYPE, ElementType.FIELD, ElementType.METHOD} ) 45 @Retention(RetentionPolicy.RUNTIME) 46 public @interface Encoding 47 { 48 String value() default "UTF-8"; 49 } 50 51 @PropertySet(prefix="ServiceUrl") 52 @Target( {ElementType.TYPE, ElementType.FIELD, ElementType.METHOD} ) 53 @Retention(RetentionPolicy.RUNTIME) 54 public @interface ServiceUrl 55 { 56 String value(); 57 } 58 }