Clicky

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

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
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();
        }

asked 10/16/2011 10:46

scripter78's gravatar image

scripter78 ♦♦


6 Answers:
What Type is getting returned from the WEb Service? Only primitive types can be returned from a WS.
link
Mikal613's gravatar image

Mikal613

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

link
scripter78's gravatar image

scripter78

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
link
scripter78's gravatar image

scripter78

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.
link
scripter78's gravatar image

scripter78

Windows Phone 7 only supports Async methods so the UI wont freeze up. You can disable your screen until the data comes back, otherwise you have to wait for the completed method.
link
Mikal613's gravatar image

Mikal613

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×18
×3

Asked: 10/16/2011 10:46

Seen: 610 times

Last updated: 11/02/2011 05:02