2

I have a problem. I have a simple application (in VB.NET) which connect with my shop database (in MySQL). And now I want to integrate this application with a SenditAPI system. Sendit is a courier company. My aim is to send the contact details of the customer (from my datebase) to the system (SenditAPI).

I have just simply added a web references to this system in my application. And I don't know what to do next. I have never done it before so I don't know what should I do next. I read SenditAPI documentation but there are only methods and nothing else.

I will be very glad for any kind of tips.

XardasLord
  • 1,764
  • 2
  • 20
  • 45

1 Answers1

2

This is WSDL service so you have probably donwloaded the file

https://api.sendit.pl/webservice.php?wsdl

and added a service reference. They have also a sandbox, you should first register with Sandbox service and use the regular service only with bug-less code. Check http://sandbox.sendit.pl/sandbox-info.

Check alsoo this answer: How to use a WSDL

Mark especially the answer that starts with Use WSDL.EXE utility to generate a Web Service proxy from WSDL. Run from Windows start menu Visual Studio Command Prompt and there type

C:\Program Files\Microsoft Visual Studio 10.0\VC>wsdl /out:c:\MyProject\SendItplProxy.cs https://api-sandbox.sendit.pl/webservice.php?wsdl

It creates SendItplProxy.cs for SendIt sandbox web service in the folder c:\MyProject. Add it to your project and then you will have your methods:

 SendItpl x = new SendItpl();
 x.SIUserLogin("a", "b", "c", "pl");

You will also have to add reference to System.Web.Services.


And yes - the best solution you found yourself: use Framework 2.0 WebServices, so I add it to this answer.

Add a Service reference and then click on Advanced and then follow this picture:

Add legacy web service

Community
  • 1
  • 1
Vojtěch Dohnal
  • 7,867
  • 3
  • 43
  • 105
  • 1
    Thanks for a quick answer! But... Yes I added a service reference and I see this reference in Solution Explorer. But as written in this answer which you've given me - 'If no errors, you should be able to see the service reference in the object browser and all related methods.' - I don't see this reference and methods in the object browser... So I can't even call these methods. – XardasLord Aug 16 '14 at 08:31
  • @XardasLord I have edited the answer, try WSDL.exe - it is legacy but it seems to work better in this case. – Vojtěch Dohnal Aug 16 '14 at 08:32
  • 2
    Yeah, thank you so much. When it creates this code I have some syntax errors with events. But after a while I did it this way - http://sanity-free.org/125/php_webservices_and_csharp_dotnet_soap_clients.html - and it works perfect now. I have an access to these methods now. – XardasLord Aug 16 '14 at 09:32
  • Yes, it is even better solution, you do not need to play with command line parameters. – Vojtěch Dohnal Aug 16 '14 at 09:39