You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-commits@incubator.apache.org by ap...@apache.org on 2011/05/25 09:58:45 UTC
svn commit: r1127458 - in /incubator/npanday/trunk/dotnet/assemblies:
NPanday.Utils/src/main/csharp/NPanday/Utils/
NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/
NPanday.VisualStudio.Addin/src/test/csharp/NPanday.Utils-Test/ NPa...
Author: apadilla
Date: Wed May 25 09:58:44 2011
New Revision: 1127458
URL: http://svn.apache.org/viewvc?rev=1127458&view=rev
Log:
[NPANDAY-432]
- updated adding/removing/renaming of web reference by using thread synchronization
- added unit tests
Added:
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/csharp/NPanday.Utils-Test/AddWebReferenceTest.cs
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef/Reference.cs
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/Reference.cs
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/Reference.map
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/dilbert.disco
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/dilbert.wsdl
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/pom2.xml
Modified:
incubator/npanday/trunk/dotnet/assemblies/NPanday.Utils/src/main/csharp/NPanday/Utils/PomHelperUtility.cs
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/Connect.cs
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/FolderWatcher.cs
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/csharp/NPanday.Utils-Test/ConnectTest.csproj
Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.Utils/src/main/csharp/NPanday/Utils/PomHelperUtility.cs
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.Utils/src/main/csharp/NPanday/Utils/PomHelperUtility.cs?rev=1127458&r1=1127457&r2=1127458&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.Utils/src/main/csharp/NPanday/Utils/PomHelperUtility.cs (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.Utils/src/main/csharp/NPanday/Utils/PomHelperUtility.cs Wed May 25 09:58:44 2011
@@ -304,6 +304,11 @@ namespace NPanday.Utils
public static NPanday.Model.Pom.Model ReadPomAsModel(FileInfo pomfile)
{
+ return PomHelperUtility.ReadPomAsModel(pomfile, null);
+ }
+
+ public static NPanday.Model.Pom.Model ReadPomAsModel(FileInfo pomfile, NPanday.Logging.Logger logger)
+ {
if (!pomfile.Exists)
{
throw new Exception("Pom file not found: " + pomfile.FullName);
@@ -320,22 +325,47 @@ namespace NPanday.Utils
xmlDocument.Save(pomfile.FullName);
}
- XmlTextReader reader = new XmlTextReader(pomfile.FullName);
+ XmlTextReader reader = null;
+ NPanday.Model.Pom.Model model = null;
+ try
+ {
+ reader = new XmlTextReader(pomfile.FullName);
+ reader.WhitespaceHandling = WhitespaceHandling.Significant;
+ reader.Normalization = true;
+ reader.XmlResolver = null;
- reader.WhitespaceHandling = WhitespaceHandling.Significant;
- reader.Normalization = true;
- reader.XmlResolver = null;
+ XmlSerializer serializer = new XmlSerializer(typeof(NPanday.Model.Pom.Model));
- XmlSerializer serializer = new XmlSerializer(typeof(NPanday.Model.Pom.Model));
+ if (!serializer.CanDeserialize(reader))
+ {
+ throw new Exception(string.Format("Pom File ({0}) Reading Error, Pom File might contain invalid or deformed data", pomfile.FullName));
+ }
- if (!serializer.CanDeserialize(reader))
+ model = (NPanday.Model.Pom.Model)serializer.Deserialize(reader);
+ }
+ catch
{
- throw new Exception(string.Format("Pom File ({0}) Reading Error, Pom File might contain invalid or deformed data", pomfile.FullName));
+ throw;
}
+ finally
+ {
+ try
+ {
+ if (reader != null)
+ {
+ reader.Close();
+ ((IDisposable) reader).Dispose();
+ }
+ }
+ catch
+ {
+ if (logger != null)
+ {
+ logger.Log(NPanday.Logging.Level.WARNING, "Failed to close stream reader after accessing pom.xml.");
+ }
+ }
- NPanday.Model.Pom.Model model = (NPanday.Model.Pom.Model)serializer.Deserialize(reader);
- reader.Close();
-
+ }
return model;
}
@@ -384,6 +414,11 @@ namespace NPanday.Utils
public static void WriteModelToPom(FileInfo pomFile, NPanday.Model.Pom.Model model)
{
+ PomHelperUtility.WriteModelToPom(pomFile, model, null);
+ }
+
+ public static void WriteModelToPom(FileInfo pomFile, NPanday.Model.Pom.Model model, NPanday.Logging.Logger logger)
+ {
if (!pomFile.Directory.Exists)
{
pomFile.Directory.Create();
@@ -401,12 +436,37 @@ namespace NPanday.Utils
}
model.build.plugins = plugins.ToArray();
}
-
- TextWriter writer = new StreamWriter(pomFile.FullName);
- XmlSerializer serializer = new XmlSerializer(typeof(NPanday.Model.Pom.Model));
- serializer.Serialize(writer, model);
- writer.Close();
-
+ TextWriter writer = null;
+ XmlSerializer serializer = null;
+ try
+ {
+ writer = new StreamWriter(pomFile.FullName);
+ serializer =new XmlSerializer(typeof(NPanday.Model.Pom.Model));
+ serializer.Serialize(writer, model);
+ }
+ catch
+ {
+ throw;
+ }
+ finally
+ {
+ try
+ {
+ if (writer != null)
+ {
+ writer.Close();
+ writer.Dispose();
+ }
+ }
+ catch
+ {
+ if (logger != null)
+ {
+ logger.Log(NPanday.Logging.Level.WARNING, "Failed to close stream writer after writing to pom.xml.");
+ }
+ }
+
+ }
}
public void SetNPandayCompilerPluginConfigurationValue(string config, string value)
@@ -966,92 +1026,104 @@ namespace NPanday.Utils
}
#region AddWebReference
- public void AddWebReference(string name, string path, string output)
+ public void AddWebReference(string name, string path, string output, NPanday.Logging.Logger logger)
{
NPanday.Model.Pom.Model model = ReadPomAsModel();
- bool hasWSDLPlugin = false;
- if (model != null && model.build != null && model.build.plugins != null)
+
+ if (!isWebRefExistingInPom(path, model))
{
- foreach (Plugin plugin in model.build.plugins)
+ bool hasWSDLPlugin = false;
+ if (model != null && model.build != null && model.build.plugins != null)
{
- if (isWsdlPlugin(plugin))
+ foreach (Plugin plugin in model.build.plugins)
{
- hasWSDLPlugin = true;
- addPluginExecution(plugin, "wsdl", null);
+ if (isWsdlPlugin(plugin))
+ {
+ hasWSDLPlugin = true;
+ addPluginExecution(plugin, "wsdl", null);
- addWebConfiguration(plugin, "webreferences", name, path, output);
+ addWebConfiguration(plugin, "webreferences", name, path, output);
+ }
}
- }
- if (!hasWSDLPlugin)
- {
- Plugin webReferencePlugin = addPlugin(model,
- "org.apache.npanday.plugins",
- "maven-wsdl-plugin",
- null,
- false
- );
- addPluginExecution(webReferencePlugin, "wsdl", null);
+ if (!hasWSDLPlugin)
+ {
+ Plugin webReferencePlugin = addPlugin(model,
+ "org.apache.npanday.plugins",
+ "maven-wsdl-plugin",
+ null,
+ false
+ );
+ addPluginExecution(webReferencePlugin, "wsdl", null);
- addWebConfiguration(webReferencePlugin, "webreferences", name, path, output);
+ addWebConfiguration(webReferencePlugin, "webreferences", name, path, output);
+ }
}
- }
- foreach (Plugin plugin in model.build.plugins)
- {
- if ("org.apache.npanday.plugins".Equals(plugin.groupId.ToLower(), StringComparison.InvariantCultureIgnoreCase)
- && "maven-compile-plugin".Equals(plugin.artifactId.ToLower(), StringComparison.InvariantCultureIgnoreCase))
+ foreach (Plugin plugin in model.build.plugins)
{
- if (plugin.configuration == null && plugin.configuration.Any == null)
- {
- break;
- }
- XmlElement[] elems = ((XmlElement[])plugin.configuration.Any);
- for (int count = elems.Length; count-- > 0; )//(XmlElement elem in ((XmlElement[])plugin.configuration.Any))
+ if ("org.apache.npanday.plugins".Equals(plugin.groupId.ToLower(), StringComparison.InvariantCultureIgnoreCase)
+ && "maven-compile-plugin".Equals(plugin.artifactId.ToLower(), StringComparison.InvariantCultureIgnoreCase))
{
-
-
- if ("includeSources".Equals(elems[count].Name))
+ if (plugin.configuration == null && plugin.configuration.Any == null)
{
+ break;
+ }
+ XmlElement[] elems = ((XmlElement[])plugin.configuration.Any);
+ for (int count = elems.Length; count-- > 0; )
+ {
+ if ("includeSources".Equals(elems[count].Name))
+ {
- XmlDocument xmlDocument = new XmlDocument();
- XmlElement elem = xmlDocument.CreateElement("includeSources", @"http://maven.apache.org/POM/4.0.0");
+ XmlDocument xmlDocument = new XmlDocument();
+ XmlElement elem = xmlDocument.CreateElement("includeSources", @"http://maven.apache.org/POM/4.0.0");
- //LOOP THROUGH EXISTING AND ADD
- //GET .CS FILE AND ADD
- foreach (XmlNode n in elems[count].ChildNodes)
- {
- if ("includeSource".Equals(n.Name))
+ //LOOP THROUGH EXISTING AND ADD
+ //GET .CS FILE AND ADD
+ foreach (XmlNode n in elems[count].ChildNodes)
{
- XmlNode node = xmlDocument.CreateNode(XmlNodeType.Element, n.Name, @"http://maven.apache.org/POM/4.0.0");
+ if ("includeSource".Equals(n.Name))
+ {
+ XmlNode node = xmlDocument.CreateNode(XmlNodeType.Element, n.Name, @"http://maven.apache.org/POM/4.0.0");
- node.InnerText = n.InnerText;
- elem.AppendChild(node);
+ node.InnerText = n.InnerText;
+ if ((!elem.InnerXml.Contains(node.InnerText)) && (!node.InnerText.Contains(".disco")))
+ {
+ elem.AppendChild(node);
+ }
+ }
}
- }
- DirectoryInfo fullPath = new FileInfo(Path.Combine(pom.Directory.FullName, path.Trim('\r', ' ', '\n'))).Directory;
- foreach (FileInfo file in fullPath.GetFiles("*.cs"))
- {
- XmlNode node = xmlDocument.CreateNode(XmlNodeType.Element, "includeSource", @"http://maven.apache.org/POM/4.0.0");
+ DirectoryInfo fullPath = new FileInfo(Path.Combine(pom.Directory.FullName, path.Trim('\r', ' ', '\n'))).Directory;
+ foreach (FileInfo file in fullPath.GetFiles("*.cs"))
+ {
+ XmlNode node = xmlDocument.CreateNode(XmlNodeType.Element, "includeSource", @"http://maven.apache.org/POM/4.0.0");
- node.InnerText = GetRelativePath(pom.Directory, file);
- elem.AppendChild(node);
- }
- foreach (FileInfo file in fullPath.GetFiles("*.vb"))
- {
- XmlNode node = xmlDocument.CreateNode(XmlNodeType.Element, "includeSource", @"http://maven.apache.org/POM/4.0.0");
+ node.InnerText = GetRelativePath(pom.Directory, file);
+ node.InnerText = node.InnerText.Replace("\\", "/");
+ if (!elem.InnerText.Contains(node.InnerText))
+ {
+ elem.AppendChild(node);
+ }
+ }
+ foreach (FileInfo file in fullPath.GetFiles("*.vb"))
+ {
+ XmlNode node = xmlDocument.CreateNode(XmlNodeType.Element, "includeSource", @"http://maven.apache.org/POM/4.0.0");
- node.InnerText = GetRelativePath(pom.Directory, file);
- elem.AppendChild(node);
- }
- elems[count] = elem;
+ node.InnerText = GetRelativePath(pom.Directory, file);
+ node.InnerText = node.InnerText.Replace("\\", "/");
+ if (!elem.InnerText.Contains(node.InnerText))
+ {
+ elem.AppendChild(node);
+ }
+ }
+ elems[count] = elem;
- break;
+ break;
+ }
}
-
}
}
+ WriteModelToPom(model);
}
- WriteModelToPom(model);
}
Plugin addPlugin(NPanday.Model.Pom.Model model, string groupId, string artifactId, string version, bool extensions)
@@ -1108,15 +1180,18 @@ namespace NPanday.Utils
if (confProp.Equals(n.Name))
{
XmlNode node = xmlDocument.CreateNode(XmlNodeType.Element, n.Name, @"http://maven.apache.org/POM/4.0.0");
- node.InnerText = n.InnerText;
+ node.InnerText = n.InnerText.Replace("\\", "/");
elem.AppendChild(node);
}
}
XmlNode nodeAdded = xmlDocument.CreateNode(XmlNodeType.Element, confProp, @"http://maven.apache.org/POM/4.0.0");
- nodeAdded.InnerText = confPropVal;
- elem.AppendChild(nodeAdded);
+ nodeAdded.InnerText = confPropVal.Replace("\\", "/");
+ if (!elems[count].InnerXml.Contains(nodeAdded.InnerText))
+ {
+ elem.AppendChild(nodeAdded);
+ }
elems[count] = elem;
break;
@@ -1626,12 +1701,15 @@ namespace NPanday.Utils
{
if ("includeSource".Equals(n.Name))
{
- if (n.InnerText != null && !n.InnerText.Trim().StartsWith(compareStr))
+ if (n.InnerText != null && !n.InnerText.Trim().StartsWith(compareStr.Replace("\\","/")))
{
- XmlNode node = xmlDocument.CreateNode(XmlNodeType.Element, n.Name, @"http://maven.apache.org/POM/4.0.0");
+ if (!n.InnerText.Contains(name))
+ {
+ XmlNode node = xmlDocument.CreateNode(XmlNodeType.Element, n.Name, @"http://maven.apache.org/POM/4.0.0");
- node.InnerText = n.InnerText;
- elem.AppendChild(node);
+ node.InnerText = n.InnerText;
+ elem.AppendChild(node);
+ }
}
}
}
@@ -1709,7 +1787,7 @@ namespace NPanday.Utils
{
string compareStr = Path.Combine(fullpath.Substring(0, fullpath.LastIndexOf("\\")), oldName);
RemoveWebReference(compareStr, oldName);
- AddWebReference(newName, path, output);
+ AddWebReference(newName, path, output, null);
}
#endregion
@@ -1750,6 +1828,29 @@ namespace NPanday.Utils
return exists;
}
+
+ public bool isWebRefExistingInPom(string path, NPanday.Model.Pom.Model model)
+ {
+ bool exists = false;
+ List<NPanday.Model.Pom.Plugin> plugins = new List<NPanday.Model.Pom.Plugin>();
+ if (model.build.plugins != null)
+ {
+ foreach (Plugin item in model.build.plugins)
+ {
+ if (item.artifactId.Equals("maven-wsdl-plugin") && item.configuration != null)
+ {
+ List<XmlElement> elems = new List<XmlElement>();
+ elems.AddRange(item.configuration.Any);
+ XmlElement elem = getWebReferencesElement(elems.ToArray(), "webreferences");
+ if (elem.InnerXml.Contains(path.Replace("\\", "/")))
+ {
+ exists = true;
+ }
+ }
+ }
+ }
+ return exists;
+ }
}
}
Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/Connect.cs
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/Connect.cs?rev=1127458&r1=1127457&r2=1127458&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/Connect.cs (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/Connect.cs Wed May 25 09:58:44 2011
@@ -214,7 +214,7 @@ namespace NPanday.VisualStudio.Addin
if (projectItem.Name.Contains(".cs") || projectItem.Name.Contains(".vb"))
{
//change addpluginConfiguration to accept xmlElement instead
- pomUtil.AddMavenCompilePluginConfiguration("org.apache.npanday.plugins", "maven-compile-plugin", "includeSources", "includeSource", GetRelativePathToProject(projectItem, null));
+ pomUtil.AddMavenCompilePluginConfiguration("org.apache.npanday.plugins", "maven-compile-plugin", "includeSources", "includeSource", GetRelativePathToProject(projectItem, projectItem.Name));
}
if (projectItem.Name.Contains(".resx"))
@@ -336,7 +336,7 @@ namespace NPanday.VisualStudio.Addin
{
Uri fullPathUri = fileName == null ? new Uri(projectItem.get_FileNames(0)) : new Uri(Path.Combine(Path.GetDirectoryName(projectItem.get_FileNames(0)), fileName));
Uri projectUri = new Uri(Path.GetDirectoryName(projectItem.ContainingProject.FullName) + Path.DirectorySeparatorChar);
- return projectUri.MakeRelativeUri(fullPathUri).LocalPath;
+ return projectUri.MakeRelativeUri(fullPathUri).ToString().Replace("%20", " ");
}
return projectItem.Name;
}
@@ -924,11 +924,16 @@ namespace NPanday.VisualStudio.Addin
{
try
{
- System.Threading.Thread.Sleep(1500);
+ //wait for the files to be created
+ WebReferencesClasses wrc = new WebReferencesClasses(e.ReferenceDirectory);
+ wrc.WaitForClasses(e.Namespace);
+
e.Init(projectReferenceFolder(CurrentSelectedProject));
PomHelperUtility pomUtil = new PomHelperUtility(_applicationObject.Solution, CurrentSelectedProject);
- pomUtil.RenameWebReference(e.ReferenceDirectory, e.OldNamespace, e.Namespace, e.WsdlFile, string.Empty);
-
+ lock (typeof(PomHelperUtility))
+ {
+ pomUtil.RenameWebReference(e.ReferenceDirectory, e.OldNamespace, e.Namespace, e.WsdlFile, string.Empty);
+ }
}
catch (Exception ex)
{
@@ -942,8 +947,10 @@ namespace NPanday.VisualStudio.Addin
{
e.Init(projectReferenceFolder(CurrentSelectedProject));
PomHelperUtility pomUtil = new PomHelperUtility(_applicationObject.Solution, CurrentSelectedProject);
- pomUtil.RemoveWebReference(e.ReferenceDirectory, e.Namespace);
-
+ lock (typeof(PomHelperUtility))
+ {
+ pomUtil.RemoveWebReference(e.ReferenceDirectory, e.Namespace);
+ }
}
catch (Exception ex)
{
@@ -955,15 +962,20 @@ namespace NPanday.VisualStudio.Addin
{
try
{
- //wait for the files to be created
- System.Threading.Thread.Sleep(3500);
Solution2 solution = (Solution2)_applicationObject.Solution;
+
+ //wait for the files to be created
+ WebReferencesClasses wrc = new WebReferencesClasses(e.ReferenceDirectory);
+ wrc.WaitForClasses(e.Namespace);
+
e.Init(projectReferenceFolder(CurrentSelectedProject));
PomHelperUtility pomUtil = new PomHelperUtility(_applicationObject.Solution, CurrentSelectedProject);
+ lock (typeof(PomHelperUtility))
+ {
+ pomUtil.AddWebReference(e.Namespace, e.WsdlFile, string.Empty, logger);
+ }
- pomUtil.AddWebReference(e.Namespace, e.WsdlFile, string.Empty);
- //addWebReference(pomUtil, e.Namespace, e.WsdlFile, string.Empty);
}
catch (Exception ex)
@@ -1012,7 +1024,7 @@ namespace NPanday.VisualStudio.Addin
e.Init(path);
PomHelperUtility pomUtil = new PomHelperUtility(_applicationObject.Solution, CurrentSelectedProject);
- pomUtil.AddWebReference(e.Namespace, e.WsdlFile, string.Empty);
+ pomUtil.AddWebReference(e.Namespace, e.WsdlFile, string.Empty, logger);
}
catch (Exception ex)
{
@@ -1024,7 +1036,7 @@ namespace NPanday.VisualStudio.Addin
{
lock (typeof(PomHelperUtility))
{
- pomUtil.AddWebReference(name, path, output);
+ pomUtil.AddWebReference(name, path, output, logger);
}
}
Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/FolderWatcher.cs
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/FolderWatcher.cs?rev=1127458&r1=1127457&r2=1127458&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/FolderWatcher.cs (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/FolderWatcher.cs Wed May 25 09:58:44 2011
@@ -65,24 +65,28 @@ namespace NPanday.VisualStudio.Addin
public static string GetWsdlUrl(string referencePath)
{
- XPathDocument xDoc = new XPathDocument(referencePath);
- XPathNavigator xNav = xDoc.CreateNavigator();
- string xpathExpression;
- string url = "";
-
- if (referencePath.Contains(Messages.MSG_D_SERV_REF))
- {
- xpathExpression = @"ReferenceGroup/Metadata/MetadataFile[MetadataType='Wsdl']/@SourceUrl";
- }
- else
- {
- xpathExpression = @"DiscoveryClientResultsFile/Results/DiscoveryClientResult[@referenceType='System.Web.Services.Discovery.ContractReference']/@url";
- }
-
- System.Xml.XPath.XPathNodeIterator xIter = xNav.Select(xpathExpression);
- if (xIter.MoveNext())
+ string url = string.Empty;
+
+ if (!string.IsNullOrEmpty(referencePath))
{
- url = xIter.Current.TypedValue.ToString();
+ XPathDocument xDoc = new XPathDocument(referencePath);
+ XPathNavigator xNav = xDoc.CreateNavigator();
+ string xpathExpression;
+
+ if (referencePath.Contains(Messages.MSG_D_SERV_REF))
+ {
+ xpathExpression = @"ReferenceGroup/Metadata/MetadataFile[MetadataType='Wsdl']/@SourceUrl";
+ }
+ else
+ {
+ xpathExpression = @"DiscoveryClientResultsFile/Results/DiscoveryClientResult[@referenceType='System.Web.Services.Discovery.ContractReference']/@url";
+ }
+
+ System.Xml.XPath.XPathNodeIterator xIter = xNav.Select(xpathExpression);
+ if (xIter.MoveNext())
+ {
+ url = xIter.Current.TypedValue.ToString();
+ }
}
return url;
}
@@ -295,22 +299,62 @@ namespace NPanday.VisualStudio.Addin
public void Init(string wsPath)
{
- if (!this.referenceDirectory.Equals(Path.Combine(wsPath, this.Name), StringComparison.InvariantCultureIgnoreCase))
- {
- this.referenceDirectory = Path.Combine(wsPath, this.Name);
- }
- this.Namespace = this.Name;
- if (this.ChangeType != WatcherChangeTypes.Deleted)
+ if (!string.IsNullOrEmpty(wsPath))
{
- string projectPath = Path.GetDirectoryName(Path.GetDirectoryName(this.referenceDirectory));
-
- this.wsdlUrl = WebServicesReferenceUtils.GetWsdlUrl(WebServicesReferenceUtils.GetReferenceFile(this.referenceDirectory));
- this.wsdlFile = WebServicesReferenceUtils.GetWsdlFile(this.referenceDirectory);
- this.wsdlFile = this.wsdlFile.Substring(projectPath.Length+1);
+ if (!this.referenceDirectory.Equals(Path.Combine(wsPath, this.Name), StringComparison.InvariantCultureIgnoreCase))
+ {
+ this.referenceDirectory = Path.Combine(wsPath, this.Name);
+ }
+ this.Namespace = this.Name;
+ if (this.ChangeType != WatcherChangeTypes.Deleted)
+ {
+ string projectPath = Path.GetDirectoryName(Path.GetDirectoryName(this.referenceDirectory));
+
+ this.wsdlUrl = WebServicesReferenceUtils.GetWsdlUrl(WebServicesReferenceUtils.GetReferenceFile(this.referenceDirectory));
+ this.wsdlFile = WebServicesReferenceUtils.GetWsdlFile(this.referenceDirectory);
+ this.wsdlFile = this.wsdlFile.Substring(projectPath.Length+1);
+ }
}
}
}
+
+ public class WebReferencesClasses
+ {
+ private bool running;
+ private string webRefPath;
+
+ public WebReferencesClasses(string webRefPath)
+ {
+ this.webRefPath = webRefPath;
+ this.running = true;
+ }
+
+ public void WaitForClasses(string nSpace)
+ {
+ while (running)
+ {
+ //check if classes are generated
+ string[] files = Directory.GetFiles(this.webRefPath);
+ foreach (string file in files)
+ {
+ if (file.Contains(".cs") || file.Contains(".vb"))
+ {
+ if (!string.IsNullOrEmpty(nSpace) && file.Contains(nSpace))
+ {
+ running = false;
+ break;
+ }
+ else
+ {
+ running = false;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
}
Added: incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/csharp/NPanday.Utils-Test/AddWebReferenceTest.cs
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/csharp/NPanday.Utils-Test/AddWebReferenceTest.cs?rev=1127458&view=auto
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/csharp/NPanday.Utils-Test/AddWebReferenceTest.cs (added)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/csharp/NPanday.Utils-Test/AddWebReferenceTest.cs Wed May 25 09:58:44 2011
@@ -0,0 +1,150 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using NUnit.Framework;
+using System.IO;
+using NPanday.Utils;
+
+namespace ConnectTest.UtilsTest
+{
+ [TestFixture]
+ public class AddWebReferenceTest
+ {
+ private PomHelperUtility pomCopy;
+ private PomHelperUtility pomCopy2;
+ private String pomPath;
+ private String pomPath2;
+ private String pomCopyPath;
+ private String pomCopyPath2;
+ private String fullPath;
+ private String path;
+ private String testFullPath;
+ private String testPath;
+ private String output;
+ private StringBuilder strLine;
+
+ public AddWebReferenceTest()
+ {
+ pomPath = (new FileInfo(Directory.GetCurrentDirectory().Substring(0, Directory.GetCurrentDirectory().LastIndexOf("target")) + "\\src\\test\\resource\\ClassLibrary1\\ClassLibrary1\\pom.xml").FullName);
+ pomCopyPath = pomPath.Replace("pom.xml", "pomCopy.xml");
+
+ fullPath = (new FileInfo(Directory.GetCurrentDirectory().Substring(0, Directory.GetCurrentDirectory().LastIndexOf("target")) + "\\src\\test\\resource\\ClassLibrary1\\ClassLibrary1\\Web References\\WebRef").FullName);
+ path = "Web References\\WebRef\\demoService.wsdl";
+
+ testFullPath = (new FileInfo(Directory.GetCurrentDirectory().Substring(0, Directory.GetCurrentDirectory().LastIndexOf("target")) + "\\src\\test\\resource\\ClassLibrary1\\ClassLibrary1\\Web References\\WebRef2").FullName);
+ testPath = "Web References\\WebRef2\\dilbert.wsdl";
+
+ pomPath2 = (new FileInfo(Directory.GetCurrentDirectory().Substring(0, Directory.GetCurrentDirectory().LastIndexOf("target")) + "\\src\\test\\resource\\ClassLibrary1\\ClassLibrary1\\pom2.xml").FullName);
+ pomCopyPath2 = pomPath2.Replace("pom2.xml", "pomCopy2.xml");
+ }
+
+ [SetUp]
+ public void TestSetUp()
+ {
+ File.Copy(pomPath, pomCopyPath);
+ File.Copy(pomPath2, pomCopyPath2);
+
+ pomCopy = new PomHelperUtility(pomCopyPath);
+ pomCopy2 = new PomHelperUtility(pomCopyPath2);
+
+ }
+ [Test]
+ public void AddNewWebReferenceTest()
+ {
+ int ctr = 0;
+
+ ctr = GetWebReferenceCount(pomCopyPath);
+ Assert.AreEqual(0, ctr);
+ pomCopy.AddWebReference("WebRef", path, output, null);
+
+ ctr = GetWebReferenceCount(pomCopyPath);
+ Assert.AreEqual(1, ctr);
+ Assert.IsTrue(strLine.ToString().Contains("<path>Web References/WebRef/demoService.wsdl</path>"));
+ }
+
+ [Test]
+ public void AddDuplicateWebReferenceTest()
+ {
+ int ctr = 0;
+ ctr = GetWebReferenceCount(pomCopyPath);
+ Assert.AreEqual(0, ctr);
+
+ pomCopy.AddWebReference("WebRef", path, output, null);
+ pomCopy.AddWebReference("WebRef", path, output, null);
+
+ ctr = GetWebReferenceCount(pomCopyPath);
+ Assert.AreEqual(1, ctr);
+ }
+
+ [Test]
+ public void AddWithExistingWebReferenceTest()
+ {
+ int ctr = 0;
+
+ ctr = GetWebReferenceCount(pomCopyPath2);
+ Assert.AreEqual (1, ctr);
+
+ pomCopy2.AddWebReference("WebRef", path, output, null);
+
+ ctr = GetWebReferenceCount(pomCopyPath2);
+ Assert.AreEqual(2, ctr);
+ }
+
+ [Test]
+ public void CheckIncludeSourceWithDiscoFileTest()
+ {
+ pomCopy.AddWebReference("WebRef", testPath, output, null);
+ Assert.IsFalse(GetIncludeSource(pomCopyPath));
+ }
+
+ private bool GetIncludeSource(String pom_path)
+ {
+ bool exists = false;
+ String line;
+ StreamReader strm = new StreamReader(pom_path);
+ strLine = new StringBuilder();
+
+ while ((line = strm.ReadLine()) != null)
+ {
+ strLine.Append(line);
+
+ if (line.ToString().Contains(".disco"))
+ {
+ exists = true;
+ }
+ }
+
+ strm.Close();
+ return exists;
+ }
+
+ private int GetWebReferenceCount(String pom_path)
+ {
+ int ctr = 0;
+ String line;
+ StreamReader strm = new StreamReader(pom_path);
+ strLine = new StringBuilder();
+
+ while ((line = strm.ReadLine()) != null)
+ {
+ strLine.Append(line);
+
+ if (line.ToString().Contains("<webreference>"))
+ {
+ ctr++;
+ }
+ }
+
+ strm.Close();
+ return ctr;
+ }
+
+ [TearDown]
+ public void TestTearDown()
+ {
+ File.Delete(pomCopyPath);
+ File.Delete(pomCopyPath2);
+ }
+
+ }
+}
Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/csharp/NPanday.Utils-Test/ConnectTest.csproj
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/csharp/NPanday.Utils-Test/ConnectTest.csproj?rev=1127458&r1=1127457&r2=1127458&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/csharp/NPanday.Utils-Test/ConnectTest.csproj (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/csharp/NPanday.Utils-Test/ConnectTest.csproj Wed May 25 09:58:44 2011
@@ -73,6 +73,7 @@ under the License.
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="AddWebReferenceTest.cs" />
<Compile Include="MavenCompilePluginConfigurationTest.cs" />
<Compile Include="MavenResxPluginConfigurationTest.cs" />
<Compile Include="MavenSettingsConfigurationTest.cs" />
Added: incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef/Reference.cs
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web%20References/WebRef/Reference.cs?rev=1127458&view=auto
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef/Reference.cs (added)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef/Reference.cs Wed May 25 09:58:44 2011
@@ -0,0 +1,156 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.4952
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+//
+// This source code was auto-generated by Microsoft.VSDesigner, Version 2.0.50727.4952.
+//
+#pragma warning disable 1591
+
+namespace ClassLibrary5.net.webservicex.www {
+ using System.Diagnostics;
+ using System.Web.Services;
+ using System.ComponentModel;
+ using System.Web.Services.Protocols;
+ using System;
+ using System.Xml.Serialization;
+
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.4927")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ [System.Web.Services.WebServiceBindingAttribute(Name="SendSMSWorldSoap", Namespace="http://www.webserviceX.NET")]
+ public partial class SendSMSWorld : System.Web.Services.Protocols.SoapHttpClientProtocol {
+
+ private System.Threading.SendOrPostCallback sendSMSOperationCompleted;
+
+ private bool useDefaultCredentialsSetExplicitly;
+
+ /// <remarks/>
+ public SendSMSWorld() {
+ this.Url = global::ClassLibrary5.Properties.Settings.Default.ClassLibrary5_net_webservicex_www_SendSMSWorld;
+ if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
+ this.UseDefaultCredentials = true;
+ this.useDefaultCredentialsSetExplicitly = false;
+ }
+ else {
+ this.useDefaultCredentialsSetExplicitly = true;
+ }
+ }
+
+ public new string Url {
+ get {
+ return base.Url;
+ }
+ set {
+ if ((((this.IsLocalFileSystemWebService(base.Url) == true)
+ && (this.useDefaultCredentialsSetExplicitly == false))
+ && (this.IsLocalFileSystemWebService(value) == false))) {
+ base.UseDefaultCredentials = false;
+ }
+ base.Url = value;
+ }
+ }
+
+ public new bool UseDefaultCredentials {
+ get {
+ return base.UseDefaultCredentials;
+ }
+ set {
+ base.UseDefaultCredentials = value;
+ this.useDefaultCredentialsSetExplicitly = true;
+ }
+ }
+
+ /// <remarks/>
+ public event sendSMSCompletedEventHandler sendSMSCompleted;
+
+ /// <remarks/>
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.webserviceX.NET/sendSMS", RequestNamespace="http://www.webserviceX.NET", ResponseNamespace="http://www.webserviceX.NET", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ public string sendSMS(string FromEmailAddress, string CountryCode, string MobileNumber, string Message) {
+ object[] results = this.Invoke("sendSMS", new object[] {
+ FromEmailAddress,
+ CountryCode,
+ MobileNumber,
+ Message});
+ return ((string)(results[0]));
+ }
+
+ /// <remarks/>
+ public void sendSMSAsync(string FromEmailAddress, string CountryCode, string MobileNumber, string Message) {
+ this.sendSMSAsync(FromEmailAddress, CountryCode, MobileNumber, Message, null);
+ }
+
+ /// <remarks/>
+ public void sendSMSAsync(string FromEmailAddress, string CountryCode, string MobileNumber, string Message, object userState) {
+ if ((this.sendSMSOperationCompleted == null)) {
+ this.sendSMSOperationCompleted = new System.Threading.SendOrPostCallback(this.OnsendSMSOperationCompleted);
+ }
+ this.InvokeAsync("sendSMS", new object[] {
+ FromEmailAddress,
+ CountryCode,
+ MobileNumber,
+ Message}, this.sendSMSOperationCompleted, userState);
+ }
+
+ private void OnsendSMSOperationCompleted(object arg) {
+ if ((this.sendSMSCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.sendSMSCompleted(this, new sendSMSCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
+ /// <remarks/>
+ public new void CancelAsync(object userState) {
+ base.CancelAsync(userState);
+ }
+
+ private bool IsLocalFileSystemWebService(string url) {
+ if (((url == null)
+ || (url == string.Empty))) {
+ return false;
+ }
+ System.Uri wsUri = new System.Uri(url);
+ if (((wsUri.Port >= 1024)
+ && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
+ return true;
+ }
+ return false;
+ }
+ }
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.4927")]
+ public delegate void sendSMSCompletedEventHandler(object sender, sendSMSCompletedEventArgs e);
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.4927")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ public partial class sendSMSCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
+
+ private object[] results;
+
+ internal sendSMSCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
+ base(exception, cancelled, userState) {
+ this.results = results;
+ }
+
+ /// <remarks/>
+ public string Result {
+ get {
+ this.RaiseExceptionIfNecessary();
+ return ((string)(this.results[0]));
+ }
+ }
+ }
+}
+
+#pragma warning restore 1591
\ No newline at end of file
Added: incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/Reference.cs
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web%20References/WebRef2/Reference.cs?rev=1127458&view=auto
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/Reference.cs (added)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/Reference.cs Wed May 25 09:58:44 2011
@@ -0,0 +1,208 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.4959
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+//
+// This source code was auto-generated by Microsoft.VSDesigner, Version 2.0.50727.4959.
+//
+#pragma warning disable 1591
+
+namespace TestProject.net.gcomputer.www {
+ using System.Diagnostics;
+ using System.Web.Services;
+ using System.ComponentModel;
+ using System.Web.Services.Protocols;
+ using System;
+ using System.Xml.Serialization;
+
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.4927")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ [System.Web.Services.WebServiceBindingAttribute(Name="DilbertSoap", Namespace="http://gcomputer.net/webservices/")]
+ public partial class Dilbert : System.Web.Services.Protocols.SoapHttpClientProtocol {
+
+ private System.Threading.SendOrPostCallback TodaysDilbertOperationCompleted;
+
+ private System.Threading.SendOrPostCallback DailyDilbertOperationCompleted;
+
+ private bool useDefaultCredentialsSetExplicitly;
+
+ /// <remarks/>
+ public Dilbert() {
+ this.Url = global::TestProject.Properties.Settings.Default.TestProject_net_gcomputer_www_Dilbert;
+ if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
+ this.UseDefaultCredentials = true;
+ this.useDefaultCredentialsSetExplicitly = false;
+ }
+ else {
+ this.useDefaultCredentialsSetExplicitly = true;
+ }
+ }
+
+ public new string Url {
+ get {
+ return base.Url;
+ }
+ set {
+ if ((((this.IsLocalFileSystemWebService(base.Url) == true)
+ && (this.useDefaultCredentialsSetExplicitly == false))
+ && (this.IsLocalFileSystemWebService(value) == false))) {
+ base.UseDefaultCredentials = false;
+ }
+ base.Url = value;
+ }
+ }
+
+ public new bool UseDefaultCredentials {
+ get {
+ return base.UseDefaultCredentials;
+ }
+ set {
+ base.UseDefaultCredentials = value;
+ this.useDefaultCredentialsSetExplicitly = true;
+ }
+ }
+
+ /// <remarks/>
+ public event TodaysDilbertCompletedEventHandler TodaysDilbertCompleted;
+
+ /// <remarks/>
+ public event DailyDilbertCompletedEventHandler DailyDilbertCompleted;
+
+ /// <remarks/>
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://gcomputer.net/webservices/TodaysDilbert", RequestNamespace="http://gcomputer.net/webservices/", ResponseNamespace="http://gcomputer.net/webservices/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ public string TodaysDilbert() {
+ object[] results = this.Invoke("TodaysDilbert", new object[0]);
+ return ((string)(results[0]));
+ }
+
+ /// <remarks/>
+ public void TodaysDilbertAsync() {
+ this.TodaysDilbertAsync(null);
+ }
+
+ /// <remarks/>
+ public void TodaysDilbertAsync(object userState) {
+ if ((this.TodaysDilbertOperationCompleted == null)) {
+ this.TodaysDilbertOperationCompleted = new System.Threading.SendOrPostCallback(this.OnTodaysDilbertOperationCompleted);
+ }
+ this.InvokeAsync("TodaysDilbert", new object[0], this.TodaysDilbertOperationCompleted, userState);
+ }
+
+ private void OnTodaysDilbertOperationCompleted(object arg) {
+ if ((this.TodaysDilbertCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.TodaysDilbertCompleted(this, new TodaysDilbertCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
+ /// <remarks/>
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://gcomputer.net/webservices/DailyDilbert", RequestNamespace="http://gcomputer.net/webservices/", ResponseNamespace="http://gcomputer.net/webservices/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ public string DailyDilbert(System.DateTime ADate) {
+ object[] results = this.Invoke("DailyDilbert", new object[] {
+ ADate});
+ return ((string)(results[0]));
+ }
+
+ /// <remarks/>
+ public void DailyDilbertAsync(System.DateTime ADate) {
+ this.DailyDilbertAsync(ADate, null);
+ }
+
+ /// <remarks/>
+ public void DailyDilbertAsync(System.DateTime ADate, object userState) {
+ if ((this.DailyDilbertOperationCompleted == null)) {
+ this.DailyDilbertOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDailyDilbertOperationCompleted);
+ }
+ this.InvokeAsync("DailyDilbert", new object[] {
+ ADate}, this.DailyDilbertOperationCompleted, userState);
+ }
+
+ private void OnDailyDilbertOperationCompleted(object arg) {
+ if ((this.DailyDilbertCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.DailyDilbertCompleted(this, new DailyDilbertCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
+ /// <remarks/>
+ public new void CancelAsync(object userState) {
+ base.CancelAsync(userState);
+ }
+
+ private bool IsLocalFileSystemWebService(string url) {
+ if (((url == null)
+ || (url == string.Empty))) {
+ return false;
+ }
+ System.Uri wsUri = new System.Uri(url);
+ if (((wsUri.Port >= 1024)
+ && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
+ return true;
+ }
+ return false;
+ }
+ }
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.4927")]
+ public delegate void TodaysDilbertCompletedEventHandler(object sender, TodaysDilbertCompletedEventArgs e);
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.4927")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ public partial class TodaysDilbertCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
+
+ private object[] results;
+
+ internal TodaysDilbertCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
+ base(exception, cancelled, userState) {
+ this.results = results;
+ }
+
+ /// <remarks/>
+ public string Result {
+ get {
+ this.RaiseExceptionIfNecessary();
+ return ((string)(this.results[0]));
+ }
+ }
+ }
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.4927")]
+ public delegate void DailyDilbertCompletedEventHandler(object sender, DailyDilbertCompletedEventArgs e);
+
+ /// <remarks/>
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.4927")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ public partial class DailyDilbertCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
+
+ private object[] results;
+
+ internal DailyDilbertCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
+ base(exception, cancelled, userState) {
+ this.results = results;
+ }
+
+ /// <remarks/>
+ public string Result {
+ get {
+ this.RaiseExceptionIfNecessary();
+ return ((string)(this.results[0]));
+ }
+ }
+ }
+}
+
+#pragma warning restore 1591
\ No newline at end of file
Added: incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/Reference.map
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web%20References/WebRef2/Reference.map?rev=1127458&view=auto
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/Reference.map (added)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/Reference.map Wed May 25 09:58:44 2011
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<DiscoveryClientResultsFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <Results>
+ <DiscoveryClientResult referenceType="System.Web.Services.Discovery.DiscoveryDocumentReference" url="http://www.gcomputer.net/webservices/dilbert.asmx?disco" filename="dilbert.disco" />
+ <DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="http://www.gcomputer.net/webservices/dilbert.asmx?wsdl" filename="dilbert.wsdl" />
+ </Results>
+</DiscoveryClientResultsFile>
\ No newline at end of file
Added: incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/dilbert.disco
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web%20References/WebRef2/dilbert.disco?rev=1127458&view=auto
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/dilbert.disco (added)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/dilbert.disco Wed May 25 09:58:44 2011
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<discovery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/disco/">
+ <contractRef ref="http://www.gcomputer.net/webservices/dilbert.asmx?wsdl" docRef="http://www.gcomputer.net/webservices/dilbert.asmx" xmlns="http://schemas.xmlsoap.org/disco/scl/" />
+ <soap address="http://www.gcomputer.net/webservices/dilbert.asmx" xmlns:q1="http://gcomputer.net/webservices/" binding="q1:DilbertSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
+ <soap address="http://www.gcomputer.net/webservices/dilbert.asmx" xmlns:q2="http://gcomputer.net/webservices/" binding="q2:DilbertSoap12" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
+</discovery>
\ No newline at end of file
Added: incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/dilbert.wsdl
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web%20References/WebRef2/dilbert.wsdl?rev=1127458&view=auto
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/dilbert.wsdl (added)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/Web References/WebRef2/dilbert.wsdl Wed May 25 09:58:44 2011
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://gcomputer.net/webservices/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://gcomputer.net/webservices/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://gcomputer.net/webservices/">
+ <s:element name="TodaysDilbert">
+ <s:complexType />
+ </s:element>
+ <s:element name="TodaysDilbertResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="TodaysDilbertResult" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="DailyDilbert">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="1" maxOccurs="1" name="ADate" type="s:dateTime" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="DailyDilbertResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="DailyDilbertResult" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:schema>
+ </wsdl:types>
+ <wsdl:message name="TodaysDilbertSoapIn">
+ <wsdl:part name="parameters" element="tns:TodaysDilbert" />
+ </wsdl:message>
+ <wsdl:message name="TodaysDilbertSoapOut">
+ <wsdl:part name="parameters" element="tns:TodaysDilbertResponse" />
+ </wsdl:message>
+ <wsdl:message name="DailyDilbertSoapIn">
+ <wsdl:part name="parameters" element="tns:DailyDilbert" />
+ </wsdl:message>
+ <wsdl:message name="DailyDilbertSoapOut">
+ <wsdl:part name="parameters" element="tns:DailyDilbertResponse" />
+ </wsdl:message>
+ <wsdl:portType name="DilbertSoap">
+ <wsdl:operation name="TodaysDilbert">
+ <wsdl:input message="tns:TodaysDilbertSoapIn" />
+ <wsdl:output message="tns:TodaysDilbertSoapOut" />
+ </wsdl:operation>
+ <wsdl:operation name="DailyDilbert">
+ <wsdl:input message="tns:DailyDilbertSoapIn" />
+ <wsdl:output message="tns:DailyDilbertSoapOut" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="DilbertSoap" type="tns:DilbertSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="TodaysDilbert">
+ <soap:operation soapAction="http://gcomputer.net/webservices/TodaysDilbert" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="DailyDilbert">
+ <soap:operation soapAction="http://gcomputer.net/webservices/DailyDilbert" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="DilbertSoap12" type="tns:DilbertSoap">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="TodaysDilbert">
+ <soap12:operation soapAction="http://gcomputer.net/webservices/TodaysDilbert" style="document" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="DailyDilbert">
+ <soap12:operation soapAction="http://gcomputer.net/webservices/DailyDilbert" style="document" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="Dilbert">
+ <wsdl:port name="DilbertSoap" binding="tns:DilbertSoap">
+ <soap:address location="http://www.gcomputer.net/webservices/dilbert.asmx" />
+ </wsdl:port>
+ <wsdl:port name="DilbertSoap12" binding="tns:DilbertSoap12">
+ <soap12:address location="http://www.gcomputer.net/webservices/dilbert.asmx" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
Added: incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/pom2.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/pom2.xml?rev=1127458&view=auto
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/pom2.xml (added)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/test/resource/ClassLibrary1/ClassLibrary1/pom2.xml Wed May 25 09:58:44 2011
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ Copyright 2005 Exist Global
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://maven.apache.org/POM/4.0.0">
+ <parent>
+ <artifactId>ClassLibrary1-parent</artifactId>
+ <groupId>NPanday.ClassLibrary1</groupId>
+ <version>1.2.1-maestro-2.3.5.4-SNAPSHOT</version>
+ <relativePath>..\pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>ClassLibrary1</artifactId>
+ <packaging>library</packaging>
+ <name>NPanday.ClassLibrary1 : ClassLibrary1</name>
+ <build>
+ <sourceDirectory>./</sourceDirectory>
+ <plugins>
+ <plugin>
+ <groupId>npanday.plugin</groupId>
+ <artifactId>maven-compile-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <frameworkVersion>3.5</frameworkVersion>
+ <includeSources>
+ <includeSource>Properties\AssemblyInfo.cs</includeSource>
+ <includeSource>Resource1.Designer.cs</includeSource>
+ <includeSource>Settings.Designer.cs</includeSource>
+ <includeSource>Web References\net.webservicex.www\Reference.cs</includeSource>
+ </includeSources>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>npanday.plugin</groupId>
+ <artifactId>maven-resgen-plugin</artifactId>
+ <configuration>
+ <embeddedResources>
+ <embeddedResource>
+ <sourceFile>Resource1.resx</sourceFile>
+ <name>ClassLibrary1.Resource1</name>
+ </embeddedResource>
+ <embeddedResource>
+ <sourceFile>Resource2.resx</sourceFile>
+ <name>ClassLibrary1.Resource2</name>
+ </embeddedResource>
+ <embeddedResource>
+ <sourceFile>Resource4.resx</sourceFile>
+ <name>ClassLibrary1.Resource4</name>
+ </embeddedResource>
+ <embeddedResource>
+ <sourceFile>Resource3.resx</sourceFile>
+ <name>ClassLibrary1.Resource3</name>
+ </embeddedResource>
+ <embeddedResource>
+ <sourceFile>ToBeDeleted.resx</sourceFile>
+ <name>ClassLibrary1.ToBeDeleted</name>
+ </embeddedResource>
+ </embeddedResources>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>npanday.plugin</groupId>
+ <artifactId>maven-wsdl-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>wsdl</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <webreferences>
+ <webreference>
+ <namespace>net.webservicex.www</namespace>
+ <path>Web References/net.webservicex.www/sendsmsworld.wsdl</path>
+ <output>Web References/net.webservicex.www</output>
+ </webreference>
+ </webreferences>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file