Bug 977 - Behavior change in web reference code generation.
Summary: Behavior change in web reference code generation.
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Web Services ()
Version: Trunk
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Lluis Sanchez
Depends on:
Reported: 2011-09-21 19:35 UTC by JohanO
Modified: 2013-12-11 04:39 UTC (History)
6 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 977 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description JohanO 2011-09-21 19:35:46 UTC
In the latest build, MonoTouch 4.2.1, MonoDevelop 2.6, Mono Framework 2.10.5 there is a definite behavior change when generating web references which makes existing code break. The web references are not WCF references but rather old school .Net 2.0 style web references. 

We have quite a lot of Web Methods that uses "XmlNode" as parameter types and there is a good reason for this.

Original Code Output:
public XmlNode GetEvents(XmlNode credentials, XmlNode eventTemplate) {
            object[] results = this.Invoke("GetEvents", new object[] {
            return ((XmlNode)(results[0]));
New Code Output:
public GetEventsResponseGetEventsResult GetEvents(GetEventsCredentials credentials, GetEventsEventTemplate eventTemplate) {
            object[] results = this.Invoke("GetEvents", new object[] {
            return ((GetEventsResponseGetEventsResult)(results[0]));

It also generated classes for each of the parameters, this makes the web reference file EXPLODE my application with hundreds of classes:

/// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    public partial class GetEventsResponseGetEventsResult {
        /// <remarks/>
        public System.Xml.XmlNode Any;
Comment 1 Sebastien Pouliot 2011-09-22 16:05:49 UTC
MonoTouch itself does not generates web references. Did you generate them manually (using which tool?) or using MonoDevelop ?
Comment 2 JohanO 2011-09-26 14:38:35 UTC
I generated them using MonoDevelop. I managed to work around the problem by doing it in Visual Studio instead. Still, behavior change in web reference generation might be a biggy...
Comment 3 Sebastien Pouliot 2011-09-26 15:07:01 UTC
-> monodevelop (but it could be mono too, not sure)
Comment 4 Miguel de Icaza [MSFT] 2011-09-27 11:21:44 UTC
This is generated by Mono Tooling.

Atsushi, do you think that this is caused by one of the recent changes to the Mono toolchain?
Comment 5 Atsushi Eno 2011-09-27 13:18:10 UTC
We need some wsdl input as reproducible case to inspect the issue and determine whether or not you used to have *wrong* generated code. For example, there used to be wrong XmlElement[] member output while it should be rather a strongly typed member, to be compatible with .NET.
Comment 7 JohanO 2011-10-31 18:57:34 UTC
See my comments above
Comment 8 Jeffrey Stedfast 2011-11-08 17:56:56 UTC
Atsushi: *ping*
Comment 9 Atsushi Eno 2011-11-08 23:55:07 UTC
My wild guess is that the relevant change was introduced to comply with .NET outputs.
There is even a test case for that, so I rather believe this asserted changes is correct.

If there are still different pieces from .NET, anyone with Windows should verify that and create minimum reproducible test case that asserts the issue.

BTW how long will people think I am the Sys.Web.Services maintainer?
Comment 10 Jeffrey Stedfast 2012-01-31 15:32:37 UTC
I have a Windows VM up and running now, so I guess I can take a look at this...

Unfortunately, I have no clue what web references even are, how to generate them, or... well, anything about them, really.

Can someone walk me through how to go from having a WSDL url to a generated web references file in both VS and MD?