Quite often when dealing with AIF service I am asked to send a WSDL for a service to a 3rd party partner. Typically the partner dowsn’t have access to the service in that phase of the project. This means that I would have to send physical wsdl files (and not just an URL). In my experience the “singleWSDL” feature introduced with .net framework 4.5 doesn’t work for AIF services. In these cases AIF can be quite thedius to work with because the wsdl references other wsdl files as well as xsd’s. So in order to being able to send an offline wsdl file to a partner, you have to do a little bit of manual work. Ofcourse there are many ways to achieve the same, but here’s a guide of way, that I have found quite easy to work with.
- Make sure the service has been published.
- Open visual studio and create a console application. Add a new service reference pointing to the your service. Visuial studio now creates proxy classes as well as downloads referenced wsdl’s and xsd’s. You should see something similar to this in your project:
Please note the 3 WSDL files and 6 XSD files.
- Locate the physical location of the files (right click in VS and look at the file properties)
- Copy all of the WSDL and XSD to a new folder of your choice (outside the project). This folder now contains the files that we want to send to our partner. But before sending them, we need to do some minor modifications.
- Open the RoutingService.wsdl in your editor (VS will do just fine). Find and edit all import statements:
You will se that the Locations attribute references a http address. Edit the location to point to the local file residing in the current folder.
You will want to do the same for the service location:
Make sure to point to the local file instead of the url.
- Do the same for the other 2 WSDL files. It’s quickly done.
- When finished You can test your work by going back into visual studio. Just simulate adding a new service reference pointing to the local wsdl files instead. Remember it is the RoutingService.wsdl that is Your point of entry. If VS doesn’t complain You are now finished.
- Finally zip the folder and sent it to the partner.
If You know of a better/easier way please post a comment…