Have you had a look at whats happening using Fiddler? (or other suitable traffic monitoring tool) Might give you a hint as to whats being sent/returned. might even show you an error rather than just empty result
On Thu, Jan 20, 2011 at 11:23 AM, Peter Maddin <[email protected]> wrote: > I am re-learning WCF and am trying a simple web service client to the US Geo > Coordinate service at http://geocoder.us/ > > WSDL is at http://rpc.geocoder.us/dist/eg/clients/GeoCoder.wsdl > > There is a C# Client at > http://www.c-sharpcorner.com/uploadfile/scottlysle/geocoderuswebservice01232008035119am/geocoderuswebservice.aspx > > but it does not work. It keeps saying that the address given is invalid. > > I have used the sample addresses at http://geocoder.us/ and while they work > in the web site they don't in the c# demo. > > I have a demo Delphi application that also works against this site. > > So the site is working!! > > I wrote a extremely basic web service client. I added a service reference > using the WSDL and created a simple winForm application > > Code > > using System; > using System.Collections.Generic; > using System.ComponentModel; > using System.Data; > using System.Drawing; > using System.Linq; > using System.Text; > using System.Windows.Forms; > using System.ServiceModel; > using GeoCodeTest.ServiceReference1; > > namespace GeoCodeTest > { > public partial class Form1 : Form > { > public Form1() > { > InitializeComponent(); > } > > private GeocoderResult[] LocationResult = null; > private GeoCode_PortTypeClient proxy = null; > > private void btnGo_Click(object sender, EventArgs e) > { > LocationResult = proxy.geocode(txtLocation.Text); // always returns a null !!! > geocoderResultBindingSource.DataSource = LocationResult; > } > > private void Form1_Load(object sender, EventArgs e) > { > proxy = new GeoCode_PortTypeClient("GeoCode_Port"); > } > } > } > > No matter what address I put in, the result returned is always null. > In the C# demo from > http://www.c-sharpcorner.com/uploadfile/scottlysle/geocoderuswebservice01232008035119am/geocoderuswebservice.aspx > the location returned was also null. > > This is the app.config file that was generated. > > <?xml version="1.0" encoding="utf-8" ?> > <configuration> > <system.serviceModel> > <bindings> > <basicHttpBinding> > <binding name="GeoCode_Binding" closeTimeout="00:01:00" openTimeout="00:01:00" > receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" > bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" > maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" > messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" > useDefaultWebProxy="true"> > <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" > maxBytesPerRead="4096" maxNameTableCharCount="16384" /> > <security mode="None"> > <transport clientCredentialType="None" proxyCredentialType="None" > realm="" /> > <message clientCredentialType="UserName" algorithmSuite="Default" /> > </security> > </binding> > </basicHttpBinding> > </bindings> > <client> > <endpoint address="http://rpc.geocoder.us/service/soap/" binding="basicHttpBinding" > bindingConfiguration="GeoCode_Binding" contract="ServiceReference1.GeoCode_PortType" > name="GeoCode_Port" /> > </client> > </system.serviceModel> > </configuration> > > > There is a link to passing credentials here to fix an issue > http://geocoder.us/help/msxml.shtml. > But I don't think that has anything to do with this (could be wrong). I am > using the free service. > > Can anyone tell me why the C# solution won't work where as other solutions > do? > Is there something else one needs to do (apart from tearing one's hair out). > > Regards Peter > > > > > > >
