简体   繁体   中英

How to generate a WSDL file?

i have created a webservice [.asmx] file. This web service will actually get a string as Input and insert the values to database.

Now this webservice will be called by another application, so they are asking wsdl file from me to access consume this webservice.

I know that, wsdl can be created via cmd to generate a .cs or .vb or .dll files And there is also a xml generated when i user ?wsdl along with my URL

But i am confused which one to provide ??!!!

The ?wsdl on your URL is what you should provide however that means that it exists as an XML file somewhere in your project. I'm not a .net developer (java) but I do know that if ?wsdl gives it to you on the end of your url then it exists somewhere, you can just use the browser save as to save the file as a wsdl for your consumers for the time being.

For a .asmx service running in IIS & ASP.NET, wsdl is automatically generated by using ?wsdl along with the service url. If the consumers have access to the deployed web service, then ?wsdl is the best way to provide them with service wsdl.

Otherwise, you can use WSDL.exe to generate wsdl and then pass it across.

(Regarding, your question to Thomas, for consuming a web serivce from wsdl, you need to generate client/stubs from wsdl and then using this client, you can directly make calls to the web service.

If the consumers are .NET application, then just add the service url as a web reference in the project, this should generate client/stubs from you. For Java, you can use some tools like wsdltojava to generate the client.)

  • Goto IIS
  • Goto Content Veiw
  • Browse the .asmx file
  • In Browser at the end of the url add "?wsdl" and hit Enter
  • This should now give you the wsdl of it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM