KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > wsdl > uddiv2 > InquiryServiceTestCase


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 public class InquiryServiceTestCase extends junit.framework.TestCase {
11     public InquiryServiceTestCase(java.lang.String JavaDoc name) {
12         super(name);
13     }
14
15     public void test2InquiryService1Find_business() throws Exception JavaDoc {
16         test.wsdl.uddiv2.inquiry_v2.InquireSoapStub binding;
17         try {
18             binding = (test.wsdl.uddiv2.inquiry_v2.InquireSoapStub)
19                           new test.wsdl.uddiv2.InquiryServiceLocator().getInquiryService1();
20         }
21         catch (javax.xml.rpc.ServiceException JavaDoc jre) {
22             if(jre.getLinkedCause()!=null)
23                 jre.getLinkedCause().printStackTrace();
24             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
25         }
26         assertNotNull("binding is null", binding);
27
28         // Time out after a minute
29
binding.setTimeout(60000);
30
31         test.wsdl.uddiv2.api_v2.Find_business find = new test.wsdl.uddiv2.api_v2.Find_business();
32         find.setGeneric("2.0");
33         find.setMaxRows(100);
34         test.wsdl.uddiv2.api_v2.Name[] names = new test.wsdl.uddiv2.api_v2.Name[1];
35         names[0] = new test.wsdl.uddiv2.api_v2.Name();
36         names[0].set_value("IBM");
37         find.setName(names);
38         
39         // Test operation
40
try {
41             test.wsdl.uddiv2.api_v2.BusinessList list = null;
42             list = binding.find_business(find);
43             test.wsdl.uddiv2.api_v2.BusinessInfos infos = list.getBusinessInfos();
44             test.wsdl.uddiv2.api_v2.BusinessInfo[] infos2 = infos.getBusinessInfo();
45             for(int i=0;i<infos2.length;i++){
46                 System.out.println(infos2[i].getBusinessKey());
47             }
48         }
49         catch (test.wsdl.uddiv2.api_v2.DispositionReport e1) {
50             throw new junit.framework.AssertionFailedError("error Exception caught: " + e1);
51         }
52     }
53 }
54
Popular Tags