Mercurial > repos > ganjoo > webservice_toolsuite
annotate WebServiceToolWorkflow/WodenWSDLParser/src/lsdis/WSDLParserDriver.java @ 0:e7482c82796e default tip
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
author | ganjoo |
---|---|
date | Tue, 07 Jun 2011 17:34:26 -0400 |
parents | |
children |
rev | line source |
---|---|
0
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
1 package lsdis; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
2 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
3 import java.util.ArrayList; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
4 import java.util.Iterator; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
5 import java.util.List; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
6 import java.util.Scanner; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
7 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
8 import org.apache.woden.WSDLException; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
9 import org.apache.woden.WSDLFactory; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
10 import org.apache.woden.WSDLReader; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
11 import org.apache.woden.wsdl20.Description; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
12 import org.apache.woden.wsdl20.ElementDeclaration; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
13 import org.apache.woden.wsdl20.Endpoint; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
14 import org.apache.woden.wsdl20.InterfaceMessageReference; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
15 import org.apache.woden.wsdl20.InterfaceOperation; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
16 import org.apache.woden.wsdl20.Service; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
17 import org.apache.woden.wsdl20.Interface; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
18 import org.apache.woden.wsdl20.extensions.rpc.Direction; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
19 import org.apache.woden.wsdl20.xml.DescriptionElement; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
20 import org.apache.ws.commons.schema.XmlSchemaAll; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
21 import org.apache.ws.commons.schema.XmlSchemaComplexType; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
22 import org.apache.ws.commons.schema.XmlSchemaElement; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
23 import org.apache.ws.commons.schema.XmlSchemaGroupBase; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
24 import org.apache.ws.commons.schema.XmlSchemaParticle; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
25 import org.apache.ws.commons.schema.XmlSchemaSequence; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
26 import org.apache.ws.commons.schema.XmlSchemaType; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
27 import org.w3c.dom.NamedNodeMap; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
28 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
29 import java.net.URI; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
30 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
31 import javax.xml.namespace.QName; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
32 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
33 public class WSDLParserDriver { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
34 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
35 private List<InterfaceOperation> completeMethodList = new ArrayList<InterfaceOperation>(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
36 private List<String> url = new ArrayList<String>(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
37 private List<String> paramList = new ArrayList<String>(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
38 private List<String> paramTypeList = new ArrayList<String>(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
39 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
40 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
41 public List<InterfaceOperation> getCompleteMethodList() { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
42 return completeMethodList; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
43 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
44 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
45 public List<String> getUrl() { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
46 return url; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
47 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
48 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
49 public List<String> getParamList() { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
50 return paramList; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
51 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
52 public List<String> getParamTypeList() { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
53 return paramTypeList; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
54 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
55 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
56 public static void main(String[] args) { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
57 /*Scanner keyboard = new Scanner(System.in); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
58 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
59 System.out.println("Enter the wsdl url: "); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
60 String wsdlurl = keyboard.next();*/ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
61 WSDLParserDriver a = new WSDLParserDriver(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
62 a.parse("/home/ganjoo/parser/bookstore-sample/booklist.wsdl"); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
63 for(InterfaceOperation oper:a.getCompleteMethodList()){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
64 a.getParameters(oper); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
65 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
66 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
67 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
68 public void parse(String wsdlurl){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
69 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
70 try { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
71 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
72 WSDLFactory factory; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
73 factory = WSDLFactory.newInstance(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
74 WSDLReader reader = factory.newWSDLReader(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
75 reader.setFeature(WSDLReader.FEATURE_VALIDATION, true); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
76 Description desc = reader.readWSDL(wsdlurl); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
77 Service[] services = desc.getServices(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
78 for(int i=0;i<services.length;i++){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
79 Endpoint[] endpoints = services[i].getEndpoints(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
80 boolean foundRestBinding = false; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
81 int count=0; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
82 while(count<endpoints.length){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
83 foundRestBinding = endpoints[count].getBinding().getType().equals(new URI("http://www.w3.org/ns/wsdl/http")); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
84 count++; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
85 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
86 if(foundRestBinding){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
87 System.out.println("-----------------REST Web services--------------"); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
88 URI address = endpoints[count-1].getAddress(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
89 String serviceName = services[i].getName().getLocalPart(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
90 System.out.println("Service Name : " + serviceName + "\t address : " + address); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
91 Interface intrfce = services[i].getInterface(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
92 InterfaceOperation[] intrfceOpers = intrfce.getAllInterfaceOperations(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
93 for(int j=0;j<intrfceOpers.length;j++){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
94 InterfaceOperation oper = intrfceOpers[j]; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
95 String operName = oper.getName().getLocalPart(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
96 System.out.println("\t operation name " + j + ": " + operName); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
97 completeMethodList.add(oper); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
98 url.add(address.toString()); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
99 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
100 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
101 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
102 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
103 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
104 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
105 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
106 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
107 } catch (Exception e) { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
108 // TODO Auto-generated catch block |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
109 e.printStackTrace(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
110 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
111 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
112 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
113 public void getParameters(String operName){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
114 try{ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
115 InterfaceOperation oper = null; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
116 for(InterfaceOperation oper1 :getCompleteMethodList()){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
117 if(oper1.getName().getLocalPart().equals(operName)) |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
118 { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
119 oper = oper1; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
120 break; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
121 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
122 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
123 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
124 if(oper==null){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
125 System.out.println("Wrong method name passed in getParameters() method"); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
126 System.exit(0); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
127 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
128 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
129 InterfaceMessageReference[] messageRefs = oper.getInterfaceMessageReferences(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
130 for(int k=0;k<messageRefs.length;k++){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
131 if(messageRefs[k].getDirection().toString().equals("in")){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
132 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
133 ElementDeclaration ed = messageRefs[k].getElementDeclaration(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
134 String inputMessageName = ed.getName().getLocalPart(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
135 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
136 if(ed.getContentModel().equalsIgnoreCase("org.w3c.dom")){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
137 org.w3c.dom.Element element = (org.w3c.dom.Element) ed.getContent(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
138 if(element.hasChildNodes()){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
139 System.out.println("Element has child nodes"); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
140 org.w3c.dom.NodeList nl = element.getChildNodes(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
141 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
142 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
143 if(element.hasAttributes()){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
144 System.out.println("Element has attributes"); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
145 NamedNodeMap nodeMap = element.getAttributes(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
146 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
147 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
148 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
149 else if(ed.getContentModel().equalsIgnoreCase("org.apache.ws.commons.schema")){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
150 org.apache.ws.commons.schema.XmlSchemaElement element = (org.apache.ws.commons.schema.XmlSchemaElement ) ed.getContent(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
151 System.out.println("element: " + element); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
152 if(element != null){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
153 String targetNamespace = element.getQName().getNamespaceURI(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
154 QName bodyFirstChildQName; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
155 if (targetNamespace != null && !"".equals(targetNamespace)) { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
156 bodyFirstChildQName = new QName(targetNamespace, element.getName()); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
157 } else { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
158 bodyFirstChildQName = new QName(element.getName()); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
159 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
160 if(oper.getStyle()[0].equals(new URI("http://www.w3.org/ns/wsdl/style/iri"))){ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
161 XmlSchemaType schemaType = element.getSchemaType(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
162 if (schemaType instanceof XmlSchemaComplexType) { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
163 XmlSchemaComplexType complexType = ((XmlSchemaComplexType) schemaType); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
164 XmlSchemaParticle particle = complexType.getParticle(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
165 if (particle instanceof XmlSchemaSequence || particle instanceof XmlSchemaAll) { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
166 XmlSchemaGroupBase xmlSchemaGroupBase = (XmlSchemaGroupBase) particle; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
167 Iterator iterator = xmlSchemaGroupBase.getItems().getIterator(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
168 while (iterator.hasNext()) { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
169 XmlSchemaElement innerElement = (XmlSchemaElement) iterator.next(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
170 QName qName = innerElement.getQName(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
171 if (qName ==null && innerElement.getSchemaTypeName().equals(org.apache.ws.commons.schema.constants.Constants.XSD_ANYTYPE)) { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
172 System.out.println("create soap message without schema and break"); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
173 break; |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
174 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
175 long minOccurs = innerElement.getMinOccurs(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
176 boolean nillable = innerElement.isNillable(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
177 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
178 String name = |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
179 qName != null ? qName.getLocalPart() : innerElement.getName(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
180 System.out.println("Name of parameter is :" + name); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
181 paramList.add(name); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
182 System.out.println("Type of Parameter is :"+innerElement.getSchemaTypeName().getLocalPart()+"\n"); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
183 paramTypeList.add(innerElement.getSchemaTypeName().getLocalPart()); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
184 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
185 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
186 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
187 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
188 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
189 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
190 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
191 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
192 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
193 }else{ |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
194 System.out.println("element is null"); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
195 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
196 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
197 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
198 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
199 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
200 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
201 } catch (Exception e) { |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
202 // TODO Auto-generated catch block |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
203 e.printStackTrace(); |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
204 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
205 } |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
206 |
e7482c82796e
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
ganjoo
parents:
diff
changeset
|
207 } |