Click here to Skip to main content
15,913,669 members
Home / Discussions / C#
   

C#

 
AnswerRe: Wait until user finish typing Pin
AmitGajjar20-Aug-12 18:39
professionalAmitGajjar20-Aug-12 18:39 
AnswerRe: Wait until user finish typing Pin
Paul Conrad20-Aug-12 19:32
professionalPaul Conrad20-Aug-12 19:32 
AnswerRe: Wait until user finish typing Pin
Shameel20-Aug-12 20:12
professionalShameel20-Aug-12 20:12 
AnswerRe: Wait until user finish typing Pin
jschell21-Aug-12 8:30
jschell21-Aug-12 8:30 
AnswerRe: Wait until user finish typing Pin
Pete O'Hanlon21-Aug-12 9:10
mvePete O'Hanlon21-Aug-12 9:10 
AnswerRe: Wait until user finish typing Pin
biop.codeproject22-Aug-12 23:27
biop.codeproject22-Aug-12 23:27 
QuestionC# accessing a web service Pin
classy_dog20-Aug-12 15:16
classy_dog20-Aug-12 15:16 
AnswerRe: C# accessing a web service Pin
AspDotNetDev20-Aug-12 16:03
protectorAspDotNetDev20-Aug-12 16:03 
classy_dog wrote:
How to connect a C# console, desktop, and/or web app to the web service?


It depends on the type of web service, but if it's a Microsoft SOAP web service, you should be able to get info about it by visiting the WSDL page for it. So, if the web service is:
site.com/SomeService.asmx

You can view the WSDL at:
site.com/SomeService.asmx?wsdl

Also, it mostly doesn't matter what type of app you are making... they all connect to web services the same way. However, if you are connecting via JavaScript, that is different and introduces some security considerations.

In general, you connect to a web service using a proxy class. There are a couple ways to generate one. For one, you can "add a service reference" in Visual Studio, and that will create the proxy class for you. I prefer to use a the WSDL.exe command line tool. To use it, you must first open the Visual Studio command prompt:
Start... All Programs... Microsoft Visual Studio 2010... Visual Studio Tools... Visual Studio Command Prompt (2010)

You then type "wsdl.exe /?" to see how to use it. However, taking our example, you could type this:
wsdl.exe /langauge:cs /namespace:Whatevs /out:C:\SomeServiceProxy.cs http://www.site.com/SomeService.asmx?wsdl

I forget if you actually need to type in the "?wsdl" or not. If it works, you should see a file on your C: drive called SomeServiceProxy.cs. It should be a C# class in the "Whatevs" namespace. Bring this file into your Visual Studio project, create an instance of the class, and you should be able to call methods on it just like any normal method (e.g., SomeServiceProxy.GetCustomerIDs()). The proxy class hides the web service details... instances of classes are returned, so you never need to mess with the icky details like serialization and deserialization. .Net web service proxy classes handle this for you.

classy_dog wrote:
How can I obtain the xsd file from the web service and transverse the xsd file to obtain the data I am looking for?


I forget what the difference is between XSD and WSDL, but I think XSD is the old version or something like that (or maybe an alternative format). If you create a proxy class, however, you shouldn't have to worry about XSDs and WSDLs.

classy_dog wrote:
How can I download the word document, pdf, and/or tiff file from the web service?


Files will probably be returned from a web service as a byte array. Other info, like the filename, may also be returned (in the case of a filename, it would be returned as a string). Save the byte array to a file and you are good to go. If you are returning the file from a webpage, that's a little different, but not much (e.g., you'll have to add some HTTP headers and such).

By the way, if this is all overwhelming, I recommend buying a book that describes how to use web services. I read one that was called something like "SOA in .Net" (SOA meaning Service Oriented Architecture). If you consider things like security and alternative architectures (e.g., REST), it can get complicated.

GeneralRe: C# accessing a web service Pin
classy_dog21-Aug-12 17:44
classy_dog21-Aug-12 17:44 
GeneralRe: C# accessing a web service Pin
AspDotNetDev21-Aug-12 18:49
protectorAspDotNetDev21-Aug-12 18:49 
AnswerRe: C# accessing a web service Pin
Pete O'Hanlon20-Aug-12 22:28
mvePete O'Hanlon20-Aug-12 22:28 
AnswerRe: C# accessing a web service Pin
jschell21-Aug-12 8:32
jschell21-Aug-12 8:32 
QuestionTOP-SECRET LDAP Pin
SFORavi20-Aug-12 11:41
SFORavi20-Aug-12 11:41 
AnswerRe: TOP-SECRET LDAP Pin
Dave Kreskowiak20-Aug-12 12:50
mveDave Kreskowiak20-Aug-12 12:50 
QuestionConvert dateTime components to hex then byte[] Pin
MichCl20-Aug-12 5:05
MichCl20-Aug-12 5:05 
AnswerRe: Convert dateTime components to hex then byte[] Pin
Pete O'Hanlon20-Aug-12 5:32
mvePete O'Hanlon20-Aug-12 5:32 
GeneralRe: Convert dateTime components to hex then byte[] Pin
MichCl20-Aug-12 5:55
MichCl20-Aug-12 5:55 
GeneralRe: Convert dateTime components to hex then byte[] Pin
Pete O'Hanlon20-Aug-12 6:06
mvePete O'Hanlon20-Aug-12 6:06 
GeneralRe: Convert dateTime components to hex then byte[] Pin
MichCl20-Aug-12 7:04
MichCl20-Aug-12 7:04 
AnswerRe: Convert dateTime components to hex then byte[] Pin
SledgeHammer0120-Aug-12 6:42
SledgeHammer0120-Aug-12 6:42 
GeneralRe: Convert dateTime components to hex then byte[] Pin
MichCl20-Aug-12 7:37
MichCl20-Aug-12 7:37 
GeneralRe: Convert dateTime components to hex then byte[] Pin
DaveyM6920-Aug-12 11:12
professionalDaveyM6920-Aug-12 11:12 
GeneralRe: Convert dateTime components to hex then byte[] Pin
MichCl21-Aug-12 1:52
MichCl21-Aug-12 1:52 
GeneralRe: Convert dateTime components to hex then byte[] Pin
DaveyM6921-Aug-12 7:55
professionalDaveyM6921-Aug-12 7:55 
GeneralRe: Convert dateTime components to hex then byte[] Pin
MichCl21-Aug-12 8:47
MichCl21-Aug-12 8:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.