Mercurial > repos > ganjoo > webservice_toolsuite
annotate WebServiceToolWorkflow/WodenWSDLParser/src/lsdis/WSDLParserDriver.java @ 0:d5cd409b8a18 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 18:00:50 -0400 | 
| parents | |
| children | 
| rev | line source | 
|---|---|
| 0 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 1 package lsdis; | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 2 | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 7 | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 28 | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 30 | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 32 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 33 public class WSDLParserDriver { | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 34 | 
| 
d5cd409b8a18
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>(); | 
| 
d5cd409b8a18
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>(); | 
| 
d5cd409b8a18
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>(); | 
| 
d5cd409b8a18
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>(); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 39 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 40 | 
| 
d5cd409b8a18
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() { | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 42 return completeMethodList; | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 43 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 44 | 
| 
d5cd409b8a18
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() { | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 46 return url; | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 47 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 48 | 
| 
d5cd409b8a18
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() { | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 50 return paramList; | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 51 } | 
| 
d5cd409b8a18
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() { | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 53 return paramTypeList; | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 54 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 55 | 
| 
d5cd409b8a18
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) { | 
| 
d5cd409b8a18
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); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 58 | 
| 
d5cd409b8a18
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: "); | 
| 
d5cd409b8a18
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();*/ | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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"); | 
| 
d5cd409b8a18
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()){ | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 64 a.getParameters(oper); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 65 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 66 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 67 | 
| 
d5cd409b8a18
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){ | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 69 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 70 try { | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 71 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 72 WSDLFactory factory; | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 73 factory = WSDLFactory.newInstance(); | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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); | 
| 
d5cd409b8a18
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); | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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++){ | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 80 boolean foundRestBinding = false; | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 81 int count=0; | 
| 
d5cd409b8a18
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){ | 
| 
d5cd409b8a18
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")); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 84 count++; | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 85 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 86 if(foundRestBinding){ | 
| 
d5cd409b8a18
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--------------"); | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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); | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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++){ | 
| 
d5cd409b8a18
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]; | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 97 completeMethodList.add(oper); | 
| 
d5cd409b8a18
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()); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 99 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 100 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 101 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 102 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 103 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 104 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 105 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 106 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 107 } catch (Exception e) { | 
| 
d5cd409b8a18
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 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 109 e.printStackTrace(); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 110 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 111 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 112 | 
| 
d5cd409b8a18
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){ | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 114 try{ | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 115 InterfaceOperation oper = null; | 
| 
d5cd409b8a18
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()){ | 
| 
d5cd409b8a18
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)) | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 118 { | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 119 oper = oper1; | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 120 break; | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 121 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 122 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 123 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 124 if(oper==null){ | 
| 
d5cd409b8a18
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"); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 126 System.exit(0); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 127 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 128 | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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++){ | 
| 
d5cd409b8a18
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")){ | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 132 | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 135 | 
| 
d5cd409b8a18
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")){ | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 138 if(element.hasChildNodes()){ | 
| 
d5cd409b8a18
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"); | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 141 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 142 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 143 if(element.hasAttributes()){ | 
| 
d5cd409b8a18
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"); | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 146 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 147 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 148 } | 
| 
d5cd409b8a18
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")){ | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 152 if(element != null){ | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 154 QName bodyFirstChildQName; | 
| 
d5cd409b8a18
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)) { | 
| 
d5cd409b8a18
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()); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 157 } else { | 
| 
d5cd409b8a18
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()); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 159 } | 
| 
d5cd409b8a18
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"))){ | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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) { | 
| 
d5cd409b8a18
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); | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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) { | 
| 
d5cd409b8a18
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; | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 168 while (iterator.hasNext()) { | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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)) { | 
| 
d5cd409b8a18
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"); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 173 break; | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 174 } | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 177 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 178 String name = | 
| 
d5cd409b8a18
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(); | 
| 
d5cd409b8a18
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); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 181 paramList.add(name); | 
| 
d5cd409b8a18
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"); | 
| 
d5cd409b8a18
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()); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 184 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 185 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 186 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 187 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 188 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 189 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 190 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 191 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 192 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 193 }else{ | 
| 
d5cd409b8a18
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"); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 195 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 196 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 197 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 198 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 199 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 200 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 201 } catch (Exception e) { | 
| 
d5cd409b8a18
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 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 203 e.printStackTrace(); | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 204 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 205 } | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 206 | 
| 
d5cd409b8a18
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 ganjoo parents: diff
changeset | 207 } | 
