[Mono-dev] WCF Deserialization Problem

monoUser cancomert at gmail.com
Tue Oct 25 11:45:44 EDT 2011


Hello,

I'm trying to fetch data from a web service which is under 
http://river.sdsc.edu/wateroneflow/NWIS/DailyValues.asmx

I used .Net generated classes for this web service it works fine under
Windows bu under Linux it fails.
I sniffed the packets by tcpdump and the response xml packet is correct.

The raw services which basicly makes the same thing as object oriented ones
are working correctly.
But in object oriented ones the response type is null..
My execution output from the linux machine is 

test:~/TestWaterML> mono WaterMLTest.exe
Before Service Call
RAW service call
After Service Call
WaterML Driver Test Outputs
WaterMLReference.Library.GetVariableInfoObjectResponse

Unhandled Exception: System.NullReferenceException: Object reference not set
to an instance of an object
  at WaterMLTest.Program.Main (System.String[] args) [0x00000] in <filename
unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object
reference not set to an instance of an object
  at WaterMLTest.Program.Main (System.String[] args) [0x00000] in <filename
unknown>:0

Running mono is

test:~/TestWaterML> mono --version
Mono JIT compiler version 2.10.5 (/ Fri Sep  2 12:26:51 CEST 2011)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors.
www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            Included Boehm (with typed GC and Parallel Mark)
test:~/TestWaterML>



My test program is as below 

  static void Main(string[] args)
        {
            GetVariableInfoObjectResponse resultVariable;            
            //GetValuesObjectResponse       resultValues;
              BasicHttpBinding binding = new BasicHttpBinding() {
                    MaxReceivedMessageSize = int.MaxValue,
                    MaxBufferSize = int.MaxValue,                    
                };

              ChannelFactory<IWaterOneFlow> channel_factory = new
ChannelFactory<IWaterOneFlow>(
                  binding,
             new
EndpointAddress("http://his09.umbc.edu/BaltGW/cuahsi_1_0.asmx"));
           
              IWaterOneFlow wof = channel_factory.CreateChannel();
                            
                Console.WriteLine("Before Service Call");
                          
               resultVariable = wof.GetVariableInfoObject(
               new WaterMLReference.Library.GetVariableInfoObject() {
variable = "", authToken = "" });

               Console.WriteLine("RAW service call");
                string result = wof.GetVariableInfo("","");

                Console.WriteLine("After Service Call");
                
                Console.WriteLine("WaterML Driver Test Outputs");

                Console.WriteLine(resultVariable.ToString());
                Console.WriteLine("Fetched Value Number {0}",
resultVariable.variablesResponse.variables.Length);

                Console.WriteLine("XML DATA");
                Console.WriteLine(result);
            

--
View this message in context: http://mono.1490590.n4.nabble.com/WCF-Deserialization-Problem-tp3937166p3937166.html
Sent from the Mono - Dev mailing list archive at Nabble.com.


More information about the Mono-devel-list mailing list