Using SlSvcUtil, I'm trying to consume this web service:
https://www.vectren.com/webservices/cxf/contentService?wsdl
Here is the SlSvcUtil command I'm using to generate the proxy:
SlSvcUtil.exe https://www.vectren.com/webservices/cxf/contentService?wsdl /directory:c:\users\cschulte\desktop\temp /n:*,Vectren.Mobile.Shared.Services.Content /o:ContentService.cs
And here is the code I'm using to call the service:
static void CallService()
{
ContentServicePortTypeClient service = new ContentServicePortTypeClient(GetBinding(), new EndpointAddress("https://www.vectren.com/webservices/cxf/contentService"));
service.getContentListCompleted += service_getContentListCompleted;
service.getContentListAsync(new getContentRequest() { appTokenString = "test_app_token", deviceTarget = deviceTargets.ALL, deviceTargetSpecified = true });
}
static void service_getContentListCompleted(object sender, getContentListCompletedEventArgs e)
{
var result = e.Result;
//Content List is null, but it should contain 15 entries
//Soap message from received server looks ok to me
}
static BasicHttpBinding GetBinding()
{
var binding = new BasicHttpBinding();
binding.Name = "ContentServiceSoapBinding";
binding.MaxReceivedMessageSize = int.MaxValue;
binding.MaxBufferSize = int.MaxValue;
binding.Security.Mode = BasicHttpSecurityMode.Transport;
return binding;
}
The code is calling the service successfully, but not all of the fields are being populated. It seems to be related to inheritance - the fields in BaseResponse are being populated but the other fields are not. For example, the field called contentList should contain a list of 15 items but instead it is null (see screenshots below). If I copy the same code outside of Xamarin into a normal Visual Studio Console project then it all works fine. Please help - I'm stumped! Thanks :)
The SOAP Request looks like this:
<soapenv:Header/> test_app_token ALL
And the SOAP Response looks like this:
2014-03-08T13:55:55.590-06:00 true content/ 2013-09-10T09:45:49-05:00 ContactUs 2013-03-22T14:22:06-05:00 file ANDROID IOS contactus_index.html text/html true ContactUs 37 <stringValue/> 2013-11-04T15:16:57-06:00 2013-03-22T14:22:06-05:00 CurrentOutagesRefreshInterval 2013-03-22T14:22:06-05:00 string ANDROID IOS <locationValue/> text/plain true CurrentOutagesRefreshInterval 64 60000 2013-03-22T14:22:06-05:00 2013-03-22T14:22:06-05:00 GasLeakPhone 2013-03-22T14:22:06-05:00 string ANDROID IOS <locationValue/> text/plain true GasLeakPhone 86 1-800-227-1376 2013-03-22T14:22:06-05:00 2013-03-22T14:22:06-05:00 GeneratorSafety 2013-03-22T14:22:06-05:00 file ANDROID IOS generatorsafety_index.html text/html true GeneratorSafety 43 <stringValue/> 2013-10-04T14:27:45-05:00 2013-03-22T14:22:06-05:00 OutageCauses 2013-03-22T14:22:06-05:00 file ANDROID IOS outagecauses_index.html text/html true OutageCauses 84 <stringValue/> 2013-03-22T14:22:06-05:00 2013-03-22T14:22:06-05:00 PrivacyPolicy 2013-03-22T14:22:06-05:00 file ANDROID IOS privacypolicy_index.html text/html true PrivacyPolicy 36 <stringValue/> 2013-03-22T14:22:06-05:00 2013-03-22T14:22:06-05:00 ReportOutage 2013-03-22T14:22:06-05:00 file ANDROID IOS reportoutage_index.html text/html true ReportOutage 85 <stringValue/> 2013-03-22T14:22:06-05:00 2013-03-22T14:22:06-05:00 RestorationProcess 2013-03-22T14:22:06-05:00 file ANDROID IOS restorationprocess_index.html text/html true RestorationProcess 39 <stringValue/> 2013-03-22T14:22:06-05:00 2013-03-22T14:22:06-05:00 RssUrl 2013-03-22T14:22:06-05:00 string ANDROID IOS <locationValue/> text/plain true RssUrl 34 http://feeds.feedburner.com/vectren/BmIY 2013-03-22T14:22:06-05:00 2013-03-22T14:22:06-05:00 StormTips 2013-03-22T14:22:06-05:00 file ANDROID IOS stormtips_index.html text/html true StormTips 42 <stringValue/> 2013-03-22T14:22:06-05:00 2013-03-22T14:22:06-05:00 TermsAndConditions 2013-03-22T14:22:06-05:00 file ANDROID IOS termsandconditions_index.html text/html true TermsAndConditions 35 <stringValue/> 2014-02-25T11:01:31-06:00 2013-03-22T14:22:06-05:00 TreeProblem 2013-03-22T14:22:06-05:00 file ANDROID IOS treeproblem_index.html text/html true TreeProblem 38 <stringValue/> 2013-03-22T14:22:06-05:00 2013-03-22T14:22:06-05:00 TroubleshootingEmail 2013-03-22T14:22:06-05:00 string ANDROID IOS <locationValue/> text/plain true TroubleshootingEmail 44 eMobileSupport@vectren.com 2013-03-22T14:22:06-05:00 2013-03-22T14:22:06-05:00 Weatherhead 2013-03-22T14:22:06-05:00 file ANDROID IOS weatherhead_index.html text/html true Weatherhead 40 <stringValue/> 2013-03-22T14:22:06-05:00 2013-03-22T14:22:06-05:00 WeatherheadImage 2013-03-22T14:22:06-05:00 file ANDROID IOS images/weatherhead_image.jpg image/jpeg true Weatherhead 41 <stringValue/> 2013-03-22T14:22:06-05:00