Er du tilfreds med indholdet i denne her guide?
Hvis ikke, så vil vi meget gerne høre dine kommentarer.
Skriv dem herunder, så gør vi det bedste, vi kan for at forbedre manualen.
Tak for din kommentar!
To access the SmartWeb API from a .NET environment, you can easily add the WSDL file as a proxy client in Visual Studio using this guide.
1. Add a "Service Reference" to your project:
2. Type the URL to the WSDL file in the "address" field, then click the "Go" button. The URL is: https://api.smart-web.dk/service.wsdl
3. You should be able to see the class WebServicePort in the left column and all the available methods for the API in the right column:
4. Type a name for your new reference in the section "Namespace". In this case we are refering to it by the name "WebService". Click OK.
5. Open the file "App.Config" in your project in Visual Studio and find the binding named "WebServiceBinding". In this binding you should type a new attribute called allowCookies="true". This allows the proxy client to save the session in the API as a cookie. The code should look like this when you are done:
6. Use the following example to output a list of products and their variants for a given SmartWeb solution in the .NET console. In the example we are refering to the proxy client under the name "ConsoleApplication1.WebService". If you don't have a specific API user, you can fall back to your general login details for the solution.
Notice that the proxy automatically wraps arguments and dewraps return arguments.
The proxy has been generated using the https://api.smart-web.dk/service.wsdl.
Please refer to section 2 or the complete documentation at https://api.smart-web.dk/doc/ for a more detailed description of the various functionalities of the API.