Howto create code from wsdl and separated Xsd - c#

i got a local wsdl file referencing two separate Xsd files.
how can I create the relate [c#] classes to that service ?
I tried to use wsdl.exe , but it ignores the Xsd files located in the same folder

solved by a hint of #rene
running " svcutil *.wsdl *.xsd /language:C#" from Developer Command Prompt

Related

How can I get a proto file to reference a message defined in another proto?

I am working with a gRPC service project that was generated by Visual Studio. I have two proto files located in the same "Protos" directory. I have one proto the has an import for the other proto file. It appears to find the file but I am not able to reference any of the messages from the other. When I do I get a "blahblah" is not defined error. I have taken some screenshots of the situation. Any help would be very much appreciated!
They are in different package spaces; try thing.ThingRequest, or .thing.ThingRequest (the leading . means "absolute", like a uri starting with /)

Create WSDL from C# Project

Im am currenty working on some changes to a webservice (written in C# and VS).
Now that most changes are done I need to generate myself a WSDL from the webservice so I can Import the WSDL on my other application to make the changes there.
The problem is that I have no clue how to generate the WSDL.
Hope someone can help me out.
Run the webservice and open it in a browser. Append "?wsdl" to the url, eg.:
http://localhost:524123/MyWebServeice?wsdl
You now have the wsdl document in your webbrowser. Now you can copy / paste.
"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\wsdl.exe" /language:CS /namespace:YourNameSpace /out:"G:\Work\YourFileName.cs" http://localhost/Service.asmx?wsdl
This should generate .cs (c#) file if you need to devlop "offline"

How to apply SOAP in FedEx sample code?

I downloaded both sample code and WSDL files on the website.
I checked that there are some text documents inside of WSDL folder.
It was based on SOAP, but I don't know how to apply.
How do I apply for SOAP file in the sample code?
It seems like the example queries.
Could you tell me how to do?
you actually do not want to think about the other files in that same folder where your WSDL is located. Just add a Web Reference to your project and direct it to your WSDL. This should add a reference to your project under which you will see all these other files. WSDL will automatically refer those files when needed.

How do I reference a WSDL file with a relative path?

I have a WSDL file on disk and loaded as a web reference. The problem is that the web reference itself is looking for the WSDL on my machine (using an absolute path), which obviously won't work on teammates' machines.
Is it possible to have the web reference look for the WSDL with a relative path, or from the Resources file? The WSDL is for a third-party service that we've modified to add some extra fields (per their recommendation).
When you add a service reference to the WSDL file on your machine, it gets copied into your "Service References" folder in your project. At that point, the API for your service is determined. There is a "Reference.svcmap" (XML) that is created that holds the location of the original location of the WSDL file. This is so that you can update the service reference in your project if the API changes. But, even without having that original WSDL file you can check in the code and your team can use it without issue. But, if you want them to be able to update the service if the API changes, then you need to actually host that WSDL file in a publicly accessible place. Usually, the web service itself provides the WSDL file and you wouldn't have it on your file system. If you plan to update and change the web service, you should connect to the WSDL hosted on a development web server. That's really where it belongs, and not a local file. But, there's no reason your local file reference wouldn't work just fine until someone tried to update it. If your web service never changes, you've got no problem. If it could change, then host it somewhere and reference a real URL.
My initial testing of tweaking the XML in Reference.svcmap file to try for relative path references did not work, but if you decide you really want to get this to work as your question describes, this is the place to make your attempt.
My suggestion would be to create a programmatic proxy using the cmd line tool wsdl.exe or svcutil.exe to create the .cs or .vb proxy that you could then add to the solution.
This allows for not needing the wsdl file at all. See more information on how here for .NET 2.0 http://msdn.microsoft.com/en-us/library/7h3ystb6(v=vs.80).aspx
for .NET 3.5 or later and svcutil look here: http://msdn.microsoft.com/en-us/library/aa751905.aspx

How do I include xsd Schema files in a visual c# project?

I'm working on a library with a couple of webparts for Sharepoint 2010. One of them needs to contact Lombardi BPM to get information. The RESTful API returns xml data, which seem to need a schema. I've found where the xsd files are located within my Lombardi installation, but how do I include them in my C# library to use them when reading the XML data?
Probably you should copy those .xsd files to \Xml\Schemas
(or to your solution)

Categories

Resources