I am looking for a way to have this return the correct data type with the data, instead of getting an XmlNode[].
I used test code similar to the following:
Expand|Select|Wrap|Line Numbers
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Xml.Serialization;
- namespace MewtV2.SystemFrameworks.Data.Device
- {
- [Serializable()]
- [System.ComponentModel.DesignerCategoryAttribute( "code" )]
- [System.Diagnostics.DebuggerStepThrough()]
- [System.ComponentModel.ToolboxItem( true )]
- [XmlInclude( typeof( TestObject ) )]
- public class TestObject
- {
- public object Test = 69;
- public TestObject (int arg)
- {
- Test = arg;
- }
- }
- }
- In the service, I did the following:
- TestObject ob = new TestObject(new TestData(72, "test string"));
- SoapEnvelope replyEnvelope = MakeSoapEnvelope( DeviceServiceLiterals.DataReceivedResponseAction );
- replyEnvelope.SetBodyObject( data );
- replyEnvelope.Context.Addressing.To = new To( filter.Listener() );
- SoapSender soapSender = new SoapSender( filter.Listener() );
- soapSender.Send( replyEnvelope );
- In the proxy, I have the following:
- TestObject cmd = (TestObject)env.GetBodyObject(typeof(TestObject));
- object ob = cmd.Test;
- At this point, ob is an XmlNode[] instead of an integer.