Code examples
SOAP client setup and working examples for C#, Python, and Java.
Setup and dependencies
Add a WSDL reference in Visual Studio:
Right-click the project.
Select Add Connected Service or Add Web Reference.
Enter
https://soap.ecall.ch/eCall.asmx.Set a namespace, for example
eCallService.
You can also use dotnet-svcutil:
dotnet tool install --global dotnet-svcutil
dotnet-svcutil https://soap.ecall.ch/eCall.asmx?WSDLpip install zeepGenerate JAX-WS client code:
wsimport -keep -p com.ecall.soap https://soap.ecall.ch/eCall.asmx?WSDLOr add the runtime dependency:
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>4.0.0</version>
</dependency>Send SMS — SendSMSBasic
using eCallService;
var client = new eCallSoapClient(
eCallSoapClient.EndpointConfiguration.eCallSoap12
);
var request = new SendSMSBasicRequest
{
AccountName = "johnsmith",
AccountPassword = "secretpassword",
Address = "0041791234567",
Message = "Hello from eCall!",
JobID = "SMS-001"
};
var response = await client.SendSMSBasicAsync(request);
if (response.ResponseCode == 0)
{
Console.WriteLine("SMS successfully submitted.");
}
else
{
Console.WriteLine($"Error {response.ResponseCode}: {response.ResponseText}");
}Send fax with attachment — SendFax
Send voice message — SendVoiceBasic
Query send status — GetStateBasic
Last updated
Was this helpful?
