Bug 14562 - Web Service with int-array
Summary: Web Service with int-array
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: 6.9.4.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-09-09 11:58 UTC by tim
Modified: 2017-07-24 16:35 UTC (History)
3 users (show)

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


Attachments
The generated wsdl from the java webservice (2.72 KB, application/xml)
2013-09-14 09:42 UTC, tim
Details


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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description tim 2013-09-09 11:58:58 UTC
Hi,

I have a simple java based web service which use SOAP.

One method of this webservice has an int-array  (int[] para) as an parameter.

I included and parsed the wsdl with xamarin develop and all seems to be fine.

In the debug-mode there are no problems. But when I use the Ad-Hoc mode there is an exception if I create an instance of the interface-implementation (new WS_ImplService()):

The XCode console shows:
System.InvalidOperationException: IsNullable may not be 'true' for value type System.Int32 in member 'para'
	  at System.Xml.Serialization.XmlReflectionImporter.ImportElementInfo (System.Type cls, System.String defaultName, System.String defaultNamespace, System.Type defaultType, System.Xml.Serialization.XmlTypeMapMemberElement member, System.Xml.Serialization.XmlAttributes atts) [0x00000] in <filename unknown>:0 
	  at System.Xml.Serialization.XmlReflectionImporter.CreateMapMember (System.Type declaringType, System.Xml.Serialization.XmlReflectionMember rmember, System.String defaultNamespace) [0x00000] in <filename unknown>:0 
	  at System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping (System.String elementName, System.String ns, System.Xml.Serialization.XmlReflectionMember[] members, Boolean hasWrapperElement, Boolean rpc, Boolean openModel, XmlMappingAccess access) [0x00000] in <filename unknown>:0 
	  at System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping (System.String elementName, System.String ns, System.Xml.Serialization.XmlReflectionMember[] members, Boolean hasWrapperElement, Boolean rpc, Boolean openModel) [0x00000] in <filename unknown>:0 
	  at System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping (System.String elementName, System.String ns, System.Xml.Serialization.XmlReflectionMember[] members, Boolean hasWrapperElement, Boolean rpc) [0x00000] in <filename unknown>:0 
	  at System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping (System.String elementName, System.String ns, System.Xml.Serialization.XmlReflectionMember[] members, Boolean hasWrapperElement) [0x00000] in <filename unknown>:0 
	  at System.Web.Services.Protocols.SoapMethodStubInfo..ctor (System.Web.Services.Protocols.TypeStubInfo typeStub, System.Web.Services.Protocols.LogicalMethodInfo source, System.Object kind, System.Xml.Serialization.XmlReflectionImporter xmlImporter, System.Xml.Serialization.SoapReflectionImporter soapImporter) [0x00000] in <filename unknown>:0 
	  at System.Web.Services.Protocols.SoapTypeStubInfo.CreateMethodStubInfo (System.Web.Services.Protocols.TypeStubInfo parent, System.Web.Services.Protocols.LogicalMethodInfo lmi, Boolean isClientProxy) [0x00000] in <filename unknown>:0 
	  at System.Web.Services.Protocols.TypeStubInfo.BuildTypeMethods () [0x00000] in <filename unknown>:0 
	  at System.Web.Services.Protocols.TypeStubInfo.Initialize () [0x00000] in <filename unknown>:0 
	  at System.Web.Services.Protocols.LogicalTypeInfo.GetTypeStub (System.String protocolName) [0x00000] in <filename unknown>:0 
	  at System.Web.Services.Protocols.TypeStubManager.GetTypeStub (System.Type t, System.String protocolName) [0x00000] in <filename unknown>:0 
	  at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor () [0x00000] in <filename unknown>:0 



My workaround is that I search manually inside the Reference.cs for:
[System.Xml.Serialization.XmlElementAttribute("para", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true, DataType="int")] int[] para

and change the IsNullable to false

After that it works fine.


I hope you understand my problem. This is my first bug-report and english is not my native language ;)
Comment 1 Sebastien Pouliot 2013-09-13 08:59:03 UTC
There should not be any (managed) compile-time difference between Debug and Adhoc. IOW you should get the same results.

Could you attach a small, self-contained, test case that shows this ?

i.e. a test case that works on Debug and fails on Adhoc
Comment 4 tim 2013-09-14 09:42:17 UTC
Created attachment 4884 [details]
The generated wsdl from the java webservice
Comment 5 tim 2013-09-14 09:44:49 UTC
Okay. I created a simple example.

A java project for the webservice.

Then I added the wsdl to my ios-project.
If I know call the constructor of the webservice in my ios-project it crashes.

It is not neccessary to start the webserivce.



Know the app crashes under DEBUG and ADHOC. There is know difference anymore (I dont know why...)
Comment 6 Dominic N [MSFT] 2017-07-24 16:35:47 UTC
Thanks you very much for taking the time to submit this report! We've come across this bug as part of a greater effort of cleaning up Bugzilla. Based on the attached sample (the project was written with the Classic API which is no longer supported) and the age of the bug, I'll be closing this. If this issue still occurs with the latest Xamarin.iOS version, please reopen this report and attach a new reproduction case.