1 6 7 package org.enhydra.shark.asap.test; 8 9 import java.net.URL ; 10 11 import org.apache.axis.types.URI; 12 import org.enhydra.shark.asap.AsapFactoryBindingStub; 13 import org.enhydra.shark.asap.SharkWebServiceLocator; 14 import org.enhydra.shark.asap.types.FactoryPropertiesGroup; 15 import org.enhydra.shark.asap.types.Request; 16 import org.enhydra.shark.asap.types.holders.GetPropertiesRsHolder; 17 import org.enhydra.shark.asap.types.holders.ResponseHolder; 18 19 24 public class ForeignWebServiceTestCase extends junit.framework.TestCase { 25 static private URI ik; 26 27 public ForeignWebServiceTestCase(java.lang.String name) { 28 super(name); 29 } 30 31 116 public void test9asapFactoryBindingGetProperties() throws Exception { 117 AsapFactoryBindingStub binding; 118 String uriString; 119 uriString = "http://www.staffware.co.za:8080/ASAPServer/FactoryService.asmx"; 121 124 try { 125 binding = (AsapFactoryBindingStub) new SharkWebServiceLocator() 126 .getasapFactoryBinding(new URL (uriString)); 128 } catch (javax.xml.rpc.ServiceException jre) { 130 if (jre.getLinkedCause() != null) 131 jre.getLinkedCause().printStackTrace(); 132 throw new junit.framework.AssertionFailedError( 133 "JAX-RPC ServiceException caught: " + jre); 134 } 135 assertNotNull("binding is null", binding); 136 137 binding.setTimeout(60000); 139 Request rqHead = new Request(); 140 String rqBody = ""; ResponseHolder rsHead = new ResponseHolder(); 142 GetPropertiesRsHolder rsBody = new GetPropertiesRsHolder(); 143 rqHead.setReceiverKey(new URI(uriString)); 144 145 try { 147 binding.getProperties(rqHead, rqBody, rsHead, rsBody); 148 } catch (Throwable t) { 149 System.err.println("Throwable "+t.getClass().getName()+"("+t.getMessage()+")"); 150 } 151 Object []oo = binding.getResponseHeaders(); 152 for (int n = 0; n < oo.length; ++n) { 153 System.err.println(""+n+"#"+binding.getResponseHeaders()[n].toString()); 154 } 155 System.err.println("res"+rsBody.value); 157 FactoryPropertiesGroup fpg=rsBody.value.getFactoryPropertiesGroup(); 158 System.err.println("Key="+fpg.getKey()); 159 System.err.println("Name="+fpg.getName()); 160 System.err.println("Subj="+fpg.getSubject()); 161 System.err.println("desc="+fpg.getDescription()); 162 System.err.println("cds="+fpg.getContextDataSchema().get_any()[0].toString()); 163 System.err.println("rds="+fpg.getResultDataSchema().get_any()[0].toString()); 164 } 165 404 } 405 | Popular Tags |