Bug 5391 - SOAP call fails with "Object reference not set to an instance of an object" when xsi:type="soapenc:string" is present in the response soap envelop
Summary: SOAP call fails with "Object reference not set to an instance of an object" w...
Status: RESOLVED NORESPONSE
Alias: None
Product: iOS
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 5.3.x
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-05-29 07:53 UTC by Ali Özgür
Modified: 2016-02-15 16:16 UTC (History)
4 users (show)

Tags:
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 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 NORESPONSE

Description Ali Özgür 2012-05-29 07:53:50 UTC
Our app issues a soap call to an AXIS Server (specifically Jira) and the server returns proper soap envelop. But on MonoTouch side the call fails with "Object reference not set to an instance of an object". Here is the call stack
-----
System.NullReferenceException: Object reference not set to an instance of an object
  at System.Xml.Serialization.XmlSerializationReader.ReadList (System.Object& resultList) [0x000f7] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs:570
  at System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement (System.String name, System.String ns, Boolean elementCanBeType, System.String& fixupReference) [0x000c0] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs:694
  at System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement (System.String& fixupReference) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs:660
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMembers (System.Xml.Serialization.ClassMap map, System.Object ob, Boolean isValueList, Boolean readBySoapOrder) [0x00389] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:393
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstanceMembers (System.Xml.Serialization.XmlTypeMapping typeMap, System.Object ob) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:240
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadClassInstance (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) [0x000d5] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:230
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadObject (System.Xml.Serialization.XmlTypeMapping typeMap, Boolean isNullable, Boolean checkType) [0x00031] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:193
  at System.Xml.Serialization.XmlSerializationReaderInterpreter+ReaderCallbackInfo.ReadObject () [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:872
  at System.Xml.Serialization.XmlSerializationReader.ReadReferencedElement (System.String name, System.String ns) [0x00111] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs:542
  at System.Xml.Serialization.XmlSerializationReader.ReadReferencedElement () [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs:487
  at System.Xml.Serialization.XmlSerializationReader.ReadReferencedElements () [0x00039] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReader.cs:612
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadMessage (System.Xml.Serialization.XmlMembersMapping typeMap) [0x001db] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:168
  at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot () [0x0004c] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:92
  at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x0001c] in /Developer/MonoTouch/Source/mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs:361
Comment 1 Ali Özgür 2012-05-29 07:54:20 UTC
This response is process without any errors
----
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<soapenv:Body>
		<ns1:getIssueResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://soap.rpc.jira.atlassian.com">
			<getIssueReturn href="#id0"/>
		</ns1:getIssueResponse>
		<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:RemoteIssue" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://beans.soap.rpc.jira.atlassian.com">
			<affectsVersions soapenc:arrayType="ns2:RemoteVersion[0]" xsi:type="soapenc:Array"/>
			<assignee xsi:type="xsd:string">ahmet</assignee>
			<attachmentNames soapenc:arrayType="xsd:string[0]" xsi:type="soapenc:Array"/>
			<components soapenc:arrayType="ns2:RemoteComponent[0]" xsi:type="soapenc:Array"/>
			<created xsi:type="xsd:dateTime">2012-05-29T11:27:00.523Z</created>
			<customFieldValues soapenc:arrayType="ns2:RemoteCustomFieldValue[1]" xsi:type="soapenc:Array">
				<customFieldValues href="#id1"/>
			</customFieldValues>
			<description xsi:type="xsd:string" xsi:nil="true"/>
			<duedate xsi:type="xsd:dateTime" xsi:nil="true"/>
			<environment xsi:type="xsd:string" xsi:nil="true"/>
			<fixVersions soapenc:arrayType="ns2:RemoteVersion[0]" xsi:type="soapenc:Array"/>
			<id xsi:type="xsd:string">22832</id>
			<key xsi:type="xsd:string">TST-23</key>
			<priority xsi:type="xsd:string">3</priority>
			<project xsi:type="xsd:string">TST</project>
			<reporter xsi:type="xsd:string">ali</reporter>
			<resolution xsi:type="xsd:string" xsi:nil="true"/>
			<status xsi:type="xsd:string">1</status>
			<summary xsi:type="xsd:string">Jira test</summary>
			<type xsi:type="xsd:string">3</type>
			<updated xsi:type="xsd:dateTime">2012-05-29T11:27:00.523Z</updated>
			<votes xsi:type="xsd:long">0</votes>
		</multiRef>
		<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:RemoteCustomFieldValue" xmlns:ns3="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
			<customfieldId xsi:type="xsd:string">customfield_10160</customfieldId>
			<key xsi:type="xsd:string" xsi:nil="true"/>
			<values soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array">
				<values xsi:type="xsd:string">2145</values>
			</values>
		</multiRef>
	</soapenv:Body>
</soapenv:Envelope>
Comment 2 Ali Özgür 2012-05-29 07:54:52 UTC
This response fails with "Object reference not set to an instance of an object error"
----
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<soapenv:Body>
		<ns1:getIssueResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://soap.rpc.jira.atlassian.com">
			<getIssueReturn href="#id0"/>
		</ns1:getIssueResponse>
		<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:RemoteIssue" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://beans.soap.rpc.jira.atlassian.com">
			<affectsVersions soapenc:arrayType="ns2:RemoteVersion[0]" xsi:type="soapenc:Array"/>
			<assignee xsi:type="soapenc:string" xsi:nil="true"/>
			<attachmentNames soapenc:arrayType="soapenc:string[0]" xsi:type="soapenc:Array"/>
			<components soapenc:arrayType="ns2:RemoteComponent[0]" xsi:type="soapenc:Array"/>
			<created xsi:type="xsd:dateTime">2012-05-28T13:24:15.000Z</created>
			<description xsi:type="soapenc:string">test</description>
			<duedate xsi:type="xsd:dateTime" xsi:nil="true"/>
			<environment xsi:type="soapenc:string" xsi:nil="true"/>
			<fixVersions soapenc:arrayType="ns2:RemoteVersion[0]" xsi:type="soapenc:Array"/>
			<id xsi:type="soapenc:string">238360</id>
			<key xsi:type="soapenc:string">INFO-469</key>
			<priority xsi:type="soapenc:string" xsi:nil="true"/>
			<project xsi:type="soapenc:string">INFO</project>
			<reporter xsi:type="soapenc:string">jiratouch</reporter>
			<resolution xsi:type="soapenc:string" xsi:nil="true"/>
			<status xsi:type="soapenc:string">1</status>
			<summary xsi:type="soapenc:string">Test</summary>
			<type xsi:type="soapenc:string">3</type>
			<updated xsi:type="xsd:dateTime">2012-05-28T13:24:15.000Z</updated>
			<votes href="#id1"/>
		</multiRef>
		<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="soapenc:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef>
	</soapenv:Body>
</soapenv:Envelope>
Comment 3 Ali Özgür 2012-05-29 07:56:18 UTC
The only difference between the two responses commented above is the usage of xsi:type="soapenc:string" instead of xsi:type="xsd:string"
Comment 4 Sebastien Pouliot 2016-01-15 14:40:54 UTC
Our recent move to adopt MS RS code should have fixed a lot of mono specific issues.

If this issue still exists please provide a self-contained test case that we can use to reproduce the issue.
Comment 5 Rolf Bjarne Kvinge [MSFT] 2016-02-15 16:16:59 UTC
Closing according to comment #4; please reopen (and attach a self-contained test case) if you can still reproduce.