KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > wsm > axis > tools > Wsdl2AJava


1 package org.apache.beehive.wsm.axis.tools;
2
3 import java.io.IOException JavaDoc;
4 import java.io.InputStream JavaDoc;
5 import java.net.MalformedURLException JavaDoc;
6
7 import org.apache.beehive.wsm.axis.databinding.SystemTypeLookupService;
8 import org.apache.beehive.wsm.model.BeehiveWsTypeMetadata;
9 import org.apache.beehive.wsm.model.wsdl.XmlBeanWSDLProcessor;
10 import org.apache.beehive.wsm.wsdl.AbstractWsdl2AJava;
11 import org.apache.xmlbeans.XmlException;
12
13 /*
14  * Wsld2AJava.java
15  *
16  * Copyright 2001-2004 The Apache Software Foundation.
17  *
18  *
19  * Licensed under the Apache License, Version 2.0 (the "License");
20  * you may not use this file except in compliance with the License.
21  * You may obtain a copy of the License at
22  *
23  * http://www.apache.org/licenses/LICENSE-2.0
24  *
25  * Unless required by applicable law or agreed to in writing, software
26  * distributed under the License is distributed on an "AS IS" BASIS,
27  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28  * See the License for the specific language governing permissions and
29  * limitations under the License.
30  */

31 public class Wsdl2AJava extends AbstractWsdl2AJava{
32
33     
34
35     public Wsdl2AJava() throws Exception JavaDoc {
36         super();
37         // TODO Auto-generated constructor stub
38
}
39
40
41     protected BeehiveWsTypeMetadata getWSObjectModel(InputStream JavaDoc wsdl) throws Exception JavaDoc {
42         XmlBeanWSDLProcessor processor = new XmlBeanWSDLProcessor(wsdl);
43         SystemTypeLookupService lookupService = new SystemTypeLookupService();
44         return processor.getObjectModel(lookupService);
45
46     }
47     
48     
49     public static int main(String JavaDoc args[]) throws Exception JavaDoc {
50         if (args.length < 2) {
51             System.out
52                     .println("Usage: Wsdl2AJava <wsdlFileName> <base source dir>");
53             return (-1);
54         }
55         Wsdl2AJava processor = new Wsdl2AJava();
56         processor.init();
57         processor.generateAnnotatedJavaFromWSDL(args[0], args[1]);
58         return 0;
59
60     }
61 }
62
Popular Tags