Debian Codegraph @

test/wsdl/uddiv2/InquiryServiceTestCase.java

raw
1 /**
2 * InquiryServiceTestCase.java
3 *
4 * This file was auto-generated from WSDL
5 * by the Apache Axis 1.2dev Nov 14, 2003 (04:44:28 EST) WSDL2Java emitter.
6 */
7
8 package test.wsdl.uddiv2;
9
10 import java.net.SocketException;
11
12 import org.apache.axis.AxisFault;
13
14 public class InquiryServiceTestCase extends junit.framework.TestCase {
15 public InquiryServiceTestCase(java.lang.String name) {
16 super(name);
17 }
18
19 public void test2InquiryService1Find_business() throws Exception {
20 test.wsdl.uddiv2.inquiry_v2.InquireSoapStub binding;
21 try {
22 binding = (test.wsdl.uddiv2.inquiry_v2.InquireSoapStub)
23 new test.wsdl.uddiv2.InquiryServiceLocator().getInquiryService1();
24 }
25 catch (javax.xml.rpc.ServiceException jre) {
26 if(jre.getLinkedCause()!=null)
27 jre.getLinkedCause().printStackTrace();
28 throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
29 }
30 assertNotNull("binding is null", binding);
31
32 // Time out after a minute
33 binding.setTimeout(60000);
34
35 test.wsdl.uddiv2.api_v2.Find_business find = new test.wsdl.uddiv2.api_v2.Find_business();
36 find.setGeneric("2.0");
37 find.setMaxRows(new Integer(100));
38 test.wsdl.uddiv2.api_v2.Name[] names = new test.wsdl.uddiv2.api_v2.Name[1];
39 names[0] = new test.wsdl.uddiv2.api_v2.Name();
40 names[0].set_value("IBM");
41 find.setName(names);
42
43 // Test operation
44 try {
45 test.wsdl.uddiv2.api_v2.BusinessList list = null;
46 list = binding.find_business(find);
47 test.wsdl.uddiv2.api_v2.BusinessInfos infos = list.getBusinessInfos();
48 test.wsdl.uddiv2.api_v2.BusinessInfo[] infos2 = infos.getBusinessInfo();
49 for(int i=0;i<infos2.length;i++){
50 System.out.println(infos2[i].getBusinessKey());
51 }
52 } catch (test.wsdl.uddiv2.api_v2.DispositionReport e1) {
53 throw new junit.framework.AssertionFailedError("error Exception caught: " + e1);
54 } catch (Exception e) {
55 e.printStackTrace();
56 if (e instanceof AxisFault) {
57 AxisFault af = (AxisFault) e;
58 if ((af.detail instanceof SocketException)
59 || (af.getFaultCode().getLocalPart().equals("HTTP"))) {
60 System.out.println("Connect failure caused testJWSFault to be skipped.");
61 return;
62 }
63 }
64 throw new Exception("Fault returned from test: " + e);
65 }
66 }
67 }