• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1161
  • Last Modified:

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

0
scripter78
Asked:
scripter78
  • 3
  • 3
1 Solution
 
Mikal613Commented:
What Type is getting returned from the WEb Service? Only primitive types can be returned from a WS.
0
 
scripter78Author Commented:
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

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
scripter78Author Commented:
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
0
 
scripter78Author Commented:
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.
0
 
Mikal613Commented:
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.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now