Link to home
Start Free TrialLog in
Avatar of scripter78
scripter78

asked on

Windows Phone 7 Consuming Webservice WSDL

Ok I have written some basic generic webservices before but I have never tried to consume a 3rd party one.
The one I am trying to consume is
http://opendap.co-ops.nos.noaa.gov/axis/webservices/predictions/wsdl/Predictions.wsdl

I am not getting any results back from this what so ever and cannot figure out why.
More odd is it is not even reaching PredictionsClient_getPredictionsCompleted  or even PredictionsClient_OpenCompleted when I put a break point in the code it doesn't even reach it.
Any suggestions would be greatly appreciated

            PredictionService.getPredictionsRequest pr = new PredictionService.getPredictionsRequest(new PredictionService.Parameters
            {
                beginDate = DateTime.Now.ToString("yyyyMMdd"),
                endDate = DateTime.Now.AddDays(1.0).ToString("yyyyMMdd"),
                dataInterval = 6,
                timeZone = 0,
                unit = 1,
                stationId = "8726724",
                datum = 0
            });

            PredictionsClient.getPredictionsAsync(pr);

        void PredictionsClient_OpenCompleted(object sender, AsyncCompletedEventArgs e)
        {
            throw new NotImplementedException();
        }

        void PredictionsClient_getPredictionsCompleted(object sender, PredictionService.getPredictionsCompletedEventArgs e)
        {
            throw new NotImplementedException();
        }

Open in new window

Avatar of Mikal613
Mikal613
Flag of United States of America image

What Type is getting returned from the WEb Service? Only primitive types can be returned from a WS.
Avatar of scripter78
scripter78

ASKER

it should be returning XML

I don't know if this may help but you can see where I am getting from and do tests on it here
http://opendap.co-ops.nos.noaa.gov/axis/
it is the Tide Predictions WSDL

That did not work
also I have found many suggested option like the one in this link
http://stackoverflow.com/questions/5396671/how-to-send-receive-soap-request-and-response-using-c-sharp

the only problem I have found so far with this suggestion is
httpRequest.Headers.Add("SOAPAction: http://tempuri.org/" + methodName);

WP7 does not allow for the option of Header.Add
Going back to my original code I ran it a few times and through in a break in the code with a test loop.
I noticed if giving the soap request long enough it would infact pull results but the problem with this is how to get the code to wait on the soap request to complete before going on to the next part of the code.
ASKER CERTIFIED SOLUTION
Avatar of Mikal613
Mikal613
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial