How to apply SOAP in FedEx sample code? - c#

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.

Related

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"

Importing WSDL file gives Error

I have a list of .wsdl files provided by the client. I have tried to import them as described here.
But when I do that, it gives an error. This error is shown as below.
The document was understood, but it could not be processed.
- The WSDL document contains links that could not be resolved.
- There was an error downloading 'file:///[path]/WebServices_8_0_2_0/WebServices/wsdl/common.xsd'.
- Could not find file '[path]\WebServices_8_0_2_0\WebServices\wsdl\common.xsd'.
- Could not find file '[path]\WebServices_8_0_2_0\WebServices\wsdl\common.xsd'.
- Could not find file '[path]\WebServices_8_0_2_0\WebServices\wsdl\common.xsd'.
If the service is defined in the current solution, try building the solution and adding the service reference again.
I have no idea of what this common.xsd file is . Can some one atleast tell me the reason of this happening and a possible solution.
The common.xsd file probably contains type definitions used in the WSDL. Try to download the file manually (the URL should be in the WSDL) and save the file next to the WSDL file.

creating web service proxy and deleting WSDL file issue

i just need to know that after creating web service proxy if i delete wsdl file then is there will be any problem for creating web service class related instance?
so guide what i need to do after deleting wsdl file from VS2010 IDE as a result there will be no problem to call web service.
my first question was about web service(ASMX) file. so my question is still same but what i need to do in case WCF service. because there is also wsdl file generate after creating proxy. if i delete wsdl file in this case also so how could i make a call to wcf service.
please explain in details.
WSDL file is describes your service operations. In order to generate client Proxies, WSDL file is used.
After you finished creating client proxy, you do not need WSDL file anymore. In fact, it is a good practice to delete or restricting access to WSDL file is a good practice in terms of security.
So you will not need WSDL file, unless you make changes to the service, such as adding a new operation or deleting an existing one. In this case, WSDL file is need to update the client again.
When you add a Service Reference, Visual Studio creates a file called Reference.svcmap inside the Service References/<service name>/ folder, which describes your service. It contains links to the various metadata sources and the configuration options that you used when creating the Service Reference ("Configure Service Reference" from the context menu).
This Reference.svcmap is the only file that you must not delete. When you right-click your Service Reference and select "Update Service Reference" from the context menu, Visual Studio will re-download all the required metadata from their upstream sources, re-create the client proxy and update your app.config file.
From the Service References/<service name> directory, the client proxy Reference.cs is the only file that's actually used when compiling your client app (so you shouldn't delete this either, though Visual Studio will automatically re-generate it for you) - none of these files are used at runtime.
This article also explains what all these files are about:
http://scottseely.com/2009/01/26/misunderstood-add-service-reference/

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