Problems creating DirectFlight.cs using wsdl


#1

Hey guys,

I am using C# ti create .NET apps using this webservice.

Even though I had problems locating wsdl.exe last time, once I did, creating DirectFlight.cs was pretty easy.

Tonight I tried creating a new one, in order to be able to access the new MapFlight_Beta, and I am not understanding what the comments in the processing of the wsdl are, so I am not sure I have a compiling problem or not.

Nonetheless, I do not get a DirectFlight.cs file after running this, which is what leads me to believe there is a problem.

I have attached a screenshot of the command window. Any ideas?

Thanks,

http://www.leadingedgesim.com/miguez/pics/DirectFlight/wsdl.png


#2

Hi miguez, the messages you are seeing from wsdl.exe are not errors but informational messages. It’s kind of hard to tell for sure from your screenshot, but at the time you captured that, it looks like the wsdl.exe program had not completed running. Once it has completed, you should see a message such as the following:


Writing file 'C:\src\flightaware\directflight\DirectFlight.cs'.

I get the same messages from wsdl.exe in my test environment, and a DirectFlight.cs file is successfully generated.


#3

Hey ghewgill,

I was pretyy sure, due to its context, that these messages were not necessarily errors, but notic the last one is MapFlight_Beta. WSDL is done with the file, it posts that informational message about Basic Profile, and I never get the message you mentioned, which I have seen before, about writing the .cs file.

Right after the last line you see here, this window closes. It did take me several tries to get this screenshot at the right time, but with the help of the Pause key, I was able too. But I tried also several times to see if the “Writing…” message would be there and no joy.

Do you thin the Warning on the fourth line indicates what could be a problem?

I have also tried to force an output using the /o: option and determining what the output file would be, but no change there.

ghewgill, in the meantime, could you send me a copy of the latest DirectFlight.cs, so I can keep working using MapFlight_Beta? Or that needs to be compiled in my computer to work properly?

Finally, the address I have, flightaware.com/commercial/direc … /wsdl1.xml is still correct, right? There is an xml file there, and it does have MapFlight_Beta, so I am fairly certain that’s not the problem.

Best regards,


#4

ghewgill,

I tried starting a new Solution in VS 2005, and addin the Web Service through the References, just to see what I got. Interestingly, I got two errors:

Error 1 Custom tool error: Unable to import WebService/Schema. Unable to import binding ‘DirectFlightSoap’ from namespace ‘http://directflight.flightaware.com/soap/DirectFlight’. Unable to import operation ‘AllAirports’. The datatype ‘http://directflight.flightaware.com/soap/DirectFlight:ArrayOfString’ is missing.

Error 2 Custom tool error: Unable to import WebService/Schema. Unable to import binding ‘DirectFlightSoap’ from namespace ‘http://directflight.flightaware.com/soap/DirectFlight’. Unable to import operation ‘AllAirports’. The datatype ‘http://directflight.flightaware.com/soap/DirectFlight:ArrayOfString’ is missing.

So I closed the solution, opened it up again, and tried to update the web service, at which point I got this:


Microsoft Visual Studio

The custom tool ‘MSDiscoCodeGenerator’ failed. Unable to import binding ‘DirectFlightSoap’ from namespace ‘http://directflight.flightaware.com/soap/DirectFlight’.

OK

Finally, I tried going to directflight.flightaware.com/soap, which seems to not exist. Are you sure the references in the wsdl1.xml file are correct?

Thanks,


#5

From your description of what’s happening, it sounds like you are running wsdl.exe directly from the Start->Run command. The problem with this method is twofold: (1) you can’t see the whole results of the command because the window closes immediately as it finishes, and (2) the DirectFlight.cs is written to whatever the current directory is at the time wsdl.exe is run. You did mention that you tried /o: to force a specific output file name, but you didn’t say whether you used that to place the output in a specific directory or not. If not, then your different file name would just be written to the same place as the default DirectFlight.cs.

I suspect that if you use the Windows Explorer “search” command and look for DirectFlight.cs everywhere on your hard drive, you’ll find them.

A better way to run this would be to open a Visual Studio command prompt window like I described when you first had a question about getting the WSDL working. That has several benefits:

  1. You can change to the specific directory where you want DirectFlight.cs to be placed, before running the wsdl.exe command
  2. The window won’t close after the command is done, so you can see the results
  3. You can see (using “dir”) that the DirectFlight.cs has been created successfully

Let me know if this helps.


#6

Hey ghewgill,

Thanks for the reply.

I am running the wsdl.exe command from the Visual Studio command prompt, as you had advised me to. It still opens a separate window, that still closes after running. But, after several dozen attempts at creating the new DirectFlight.cs, I am sure it never has the “Writing…” at the end, so the file is not being created.

Yes, I did specify a directory with the /o: option, but nothing was created. I also searched the entire computer several times fo directflight.cs, and the only instance found is the one I am currently used, which was created back when I started dealing with this.

ghewgill, you did not answer if it was possible for you to email me the latest version of DirectFlight.cs. I am still not sure if that is possible, or if there are parameters in there that would be unique to my machine, therefore requiring me to compile this from my machine.

Thanks again, and best regards,


#7

I don’t understand why, when you run wsdl.exe, it runs in a separate window. If it runs in a separate window, then there is no way you’re going to be able to catch the “Writing…” message at the end before the window is closed (or any other message that might indicate a reason for failure). It will just close too quickly.

When I run wsdl.exe from a command prompt window, the output is sent to the same window where I type the command line.

I can give you a DirectFlight.cs to download, I don’t think there are any machine-specific parameters in there that might prevent it from working for you. You can download it from here: hewgill.com/~greg/DirectFlight.cs

I recommend that you find out why your wsdl.exe is not behaving as expected, as there will undoubtedly be future changes to the WSDL interface file and you will need be able to generate DirectFlight.cs yourself.

Hope this helps.


#8

Hello ghewgill,

Thanks for the link to DirectFlight.cs, I have downloaded it, you may remove it from your website if you wish.

You are right, this is not an accetpable situation, I have to be able to compile a .cs file using wsdl myself. I did pay very close attention, and using the Pause key and a lot of patience, have confirmed nothing else (no errors, warnings, anything) is posted in that pop-up command window, that shows up after running wsdl, after what I have in my screenshot above.

I have googled it to death, and have found nothing, either on wsdl not creating a file without giving any warnings, or on opening a separate cmd window to compile, which you report as being abnormal.

As I said previously, I am running Vista, so perhaps it has something dto do with that. Have you tried this in Vista?

Is there an alternative way to compile a .cs file without runnign wsdl? What about compiling a .cs in Visual Studio itself, the IDE, is that possible? I also saw you can add a Web Reference to a solution, in which case I was able to type the web address of your wsdl1.xml file, and it recognized it as a web service, but I don’t know if that is enough, without having a freshly compiled .cs

I am left wondering why this worked at first, and not anymore.

Finally, can you point me to a good reference to learn more about web services? I have found several on the web, but there are so many, so varied, that I am affraid I’ll confuse rather than educate myself.

Thanks once again,


#9

Unfortunately, since I don’t use the Visual Studio IDE, I don’t really know whether there is a way to generate the SOAP stub file from within the IDE. As for wsdl.exe opening a separate window, it’s possible that it could be a Vista-specific behaviour but that seems strange to me. I am not using Vista so I can’t try it here.

As for references for web services, again I don’t really know what might be an appropriate introduction for somebody who doesn’t yet have a lot of experience with the technology. As you noticed, the web is full of references to web services, and I’m confident that you’ll be able to find something that relates to what you’re doing. The key information to look for is that you want to access a web service from C#, and you’re starting with a WSDL file. There are undoubtedly people who have done this before and have written about it.


#10

Morning ghewgill,

Thanks for the info. Yeah, I know there’s a lot of info out there, but I was hoping you’d know one or two references that you could say are the ones that got you going, or something of the sort.

Anyhow, I am learning more and more. I got MapBeta to work last night, after I got the latest .cs from you, and am having fun creating this app.

Thanks again,