Source Code Cross Referenced for DotNetWsdlAction.java in  » Web-Services » soapui-1.7.5 » com » eviware » soapui » impl » wsdl » actions » iface » tools » dotnet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Services » soapui 1.7.5 » com.eviware.soapui.impl.wsdl.actions.iface.tools.dotnet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  soapUI, copyright (C) 2004-2007 eviware.com 
003:         *
004:         *  soapUI is free software; you can redistribute it and/or modify it under the 
005:         *  terms of version 2.1 of the GNU Lesser General Public License as published by 
006:         *  the Free Software Foundation.
007:         *
008:         *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
009:         *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
010:         *  See the GNU Lesser General Public License for more details at gnu.org.
011:         */
012:
013:        package com.eviware.soapui.impl.wsdl.actions.iface.tools.dotnet;
014:
015:        import java.io.File;
016:
017:        import com.eviware.soapui.SoapUI;
018:        import com.eviware.soapui.impl.wsdl.actions.iface.tools.support.AbstractToolsAction;
019:        import com.eviware.soapui.impl.wsdl.actions.iface.tools.support.ArgumentBuilder;
020:        import com.eviware.soapui.impl.wsdl.actions.iface.tools.support.ProcessToolRunner;
021:        import com.eviware.soapui.impl.wsdl.actions.iface.tools.support.ToolHost;
022:        import com.eviware.soapui.impl.wsdl.support.HelpUrls;
023:        import com.eviware.soapui.model.iface.Interface;
024:        import com.eviware.soapui.settings.ToolsSettings;
025:        import com.eviware.soapui.support.Tools;
026:        import com.eviware.soapui.support.UISupport;
027:        import com.eviware.soapui.support.types.StringToStringMap;
028:        import com.eviware.x.form.XForm;
029:        import com.eviware.x.form.XFormDialog;
030:        import com.eviware.x.form.XFormDialogBuilder;
031:        import com.eviware.x.form.XFormFactory;
032:
033:        /**
034:         * Invokes .NET wsdl.exe
035:         * 
036:         * @author Ole.Matzura
037:         */
038:
039:        public class DotNetWsdlAction extends AbstractToolsAction<Interface> {
040:            private static final String OUTPUT = "output directory";
041:            private static final String LANGUAGE = "language";
042:            private static final String SERVER = "serverInterface";
043:            private static final String NAMESPACE = "namespace";
044:            private static final String PROTOCOL = "protocol";
045:
046:            private static final String SHARETYPES = "sharetypes";
047:            private static final String FIELDS = "fields";
048:            private static final String ORDER = "order";
049:            private static final String ENABLEDATABINDING = "enableDataBinding";
050:            private static final String URLKEY = "url key";
051:            private static final String BASEURL = "base url";
052:
053:            private static final String USERNAME = "username";
054:            private static final String PASSWORD = "password";
055:            private static final String DOMAIN = "domain";
056:            private static final String PROXY = "proxy";
057:            private static final String PROXYUSERNAME = "proxy username";
058:            private static final String PROXYPASSWORD = "proxy password";
059:            private static final String PROXYDOMAIN = "proxy domain";
060:            public static final String SOAPUI_ACTION_ID = "DotNetWsdlAction";
061:
062:            public DotNetWsdlAction() {
063:                super (".NET 2.0 Artifacts",
064:                        "Generates .NET 2.0 artifacts using wsdl.exe");
065:            }
066:
067:            protected StringToStringMap initValues(Interface modelItem) {
068:                StringToStringMap values = super .initValues(modelItem);
069:                values.putIfMissing(LANGUAGE, "CS");
070:                return values;
071:            }
072:
073:            protected XFormDialog buildDialog(Interface modelItem) {
074:                XFormDialogBuilder builder = XFormFactory
075:                        .createDialogBuilder(".NET 2.0 artifacts");
076:
077:                XForm mainForm = builder.createForm("Basic");
078:                addWSDLFields(mainForm, modelItem);
079:
080:                mainForm.addTextField(OUTPUT,
081:                        "root directory for generated files.",
082:                        XForm.FieldType.PROJECT_FOLDER);
083:                mainForm.addTextField(NAMESPACE,
084:                        "The namespace for the generated proxy or template",
085:                        XForm.FieldType.TEXT);
086:
087:                mainForm
088:                        .addCheckBox(
089:                                SERVER,
090:                                "(Generates interfaces for server-side implementation of an ASP.Net Web Service)");
091:                mainForm.addComboBox(LANGUAGE, new String[] { "CS", "VB", "JS",
092:                        "VJS", "CPP" }, "add scope to deploy.wsdd");
093:
094:                mainForm.addComboBox(PROTOCOL, new String[] { "SOAP", "SOAP12",
095:                        "HttpGet", "HttpPost" },
096:                        "override the default protocol to implement");
097:
098:                XForm advForm = builder.createForm("Advanced");
099:
100:                advForm.addCheckBox(SHARETYPES,
101:                        "(turns on type sharing feature)");
102:                advForm.addCheckBox(FIELDS,
103:                        "(generate fields instead of properties)");
104:                advForm
105:                        .addCheckBox(ORDER,
106:                                "(generate explicit order identifiers on particle members)");
107:                advForm
108:                        .addCheckBox(ENABLEDATABINDING,
109:                                "(implement INotifyPropertyChanged interface on all generated types)");
110:                advForm
111:                        .addTextField(
112:                                URLKEY,
113:                                "configuration key to use in the code generation to read the default URL value",
114:                                XForm.FieldType.URL);
115:                advForm.addTextField(BASEURL,
116:                        "base url to use when calculating the url fragment",
117:                        XForm.FieldType.URL);
118:
119:                XForm httpForm = builder.createForm("HTTP settings");
120:                httpForm
121:                        .addTextField(USERNAME,
122:                                "username to access the WSDL-URI",
123:                                XForm.FieldType.TEXT);
124:                httpForm
125:                        .addTextField(PASSWORD,
126:                                "password to access the WSDL-URI",
127:                                XForm.FieldType.TEXT);
128:                httpForm.addTextField(DOMAIN, "domain to access the WSDL-URI",
129:                        XForm.FieldType.TEXT);
130:                httpForm.addTextField(PROXY, "username to access the WSDL-URI",
131:                        XForm.FieldType.TEXT);
132:                httpForm.addTextField(PROXYUSERNAME,
133:                        "proxy username to access the WSDL-URI",
134:                        XForm.FieldType.TEXT);
135:                httpForm.addTextField(PROXYPASSWORD,
136:                        "proxy password to access the WSDL-URI",
137:                        XForm.FieldType.TEXT);
138:                httpForm.addTextField(PROXYDOMAIN,
139:                        "proxy domain to access the WSDL-URI",
140:                        XForm.FieldType.TEXT);
141:
142:                buildArgsForm(builder, false, "wsdl.exe");
143:
144:                return builder.buildDialog(buildDefaultActions(
145:                        HelpUrls.DOTNET_HELP_URL, modelItem),
146:                        "Specify arguments for .NET 2 wsdl.exe",
147:                        UISupport.TOOL_ICON);
148:            }
149:
150:            protected void generate(StringToStringMap values,
151:                    ToolHost toolHost, Interface modelItem) throws Exception {
152:                String dotnetDir = SoapUI.getSettings().getString(
153:                        ToolsSettings.DOTNET_WSDL_LOCATION, null);
154:                if (Tools.isEmpty(dotnetDir)) {
155:                    UISupport
156:                            .showErrorMessage(".NET 2.0 wsdl.exe directory must be set in global preferences");
157:                    return;
158:                }
159:
160:                ProcessBuilder builder = new ProcessBuilder();
161:                ArgumentBuilder args = buildArgs(values, modelItem);
162:                builder.command(args.getArgs());
163:                builder.directory(new File(dotnetDir));
164:
165:                toolHost.run(new ProcessToolRunner(builder, ".NET wsdl.exe",
166:                        modelItem));
167:            }
168:
169:            private ArgumentBuilder buildArgs(StringToStringMap values,
170:                    Interface modelItem) {
171:                values.put(OUTPUT, Tools.ensureDir(values.get(OUTPUT), ""));
172:
173:                ArgumentBuilder builder = new ArgumentBuilder(values);
174:                builder.addArgs("cmd.exe", "/C", "wsdl.exe", "/nologo",
175:                        "/verbose");
176:
177:                builder.addString(NAMESPACE, "/namespace", ":");
178:                builder.addString(OUTPUT, "/out", ":");
179:                builder.addString(PROTOCOL, "/protocol", ":");
180:                builder.addString(LANGUAGE, "/language", ":");
181:
182:                builder.addBoolean(SERVER, "/serverInterface");
183:                builder.addBoolean(SHARETYPES, "/sharetypes");
184:                builder.addBoolean(FIELDS, "/fields");
185:                builder.addBoolean(ORDER, "/order");
186:                builder.addBoolean(ENABLEDATABINDING, "/enableDataBinding");
187:
188:                builder.addString(URLKEY, "/appsettingurlkey", ":");
189:                builder.addString(BASEURL, "/appsettingbaseurl", ":");
190:
191:                builder.addString(USERNAME, "/username", ":");
192:                builder.addString(PASSWORD, "/password", ":");
193:                builder.addString(DOMAIN, "/domain", ":");
194:                builder.addString(PROXY, "/proxy", ":");
195:                builder.addString(PROXYUSERNAME, "/proxyusername", ":");
196:                builder.addString(PROXYPASSWORD, "/proxypassword", ":");
197:                builder.addString(PROXYDOMAIN, "/proxydomain", ":");
198:
199:                addToolArgs(values, builder);
200:
201:                builder.addArgs(getWsdlUrl(values, modelItem));
202:
203:                return builder;
204:            }
205:        }
w___w___w__.__j__av_a___2__s___.___co_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.