1C web services (SOAP): create, publish, WSDL and calls with examples
Checkcraft is a desktop app for checking APIs and logs without code, with a free edition. Download, no sign-up →
1C web services use SOAP: each has a WSDL with operations and data types. They are chosen when a partner requires SOAP or a strict contract is needed. Below is the whole path: the configuration object, publishing, the WSDL address, calling someone else's service from 1C and testing.
Web service or HTTP service
A web service is SOAP with a WSDL: a strict contract, XML, data types defined upfront. An HTTP service is free-form REST: any URL, usually JSON. If a partner sends a WSDL or works with older 1C versions, use a web service. For a website or mobile app an HTTP service is simpler.
How to create and publish a web service
In the configuration under Common add a Web service, set the namespace and the publication file name, create operations with parameters and a return type, write the handlers in the module. When publishing the database, tick web services. The WSDL is available at an address ending in .1cws?wsdl.

How to test a web service
Open the WSDL in a browser with a 1C account: if the description shows, publishing works. Then load the WSDL into SoapUI or another client, send an operation with test data and check the response and the SOAP Fault in error cases. Repeat saved checks after every configuration update.
An operation handler in 1C
// операция GetOrder, параметр Id (string), возвращает string
Функция GetOrder(Id)
Заказ = НайтиЗаказ(Id); // ваша функция
Если Заказ = Неопределено Тогда
ВызватьИсключение "Order not found: " + Id; // клиент получит SOAP Fault
КонецЕсли;
Возврат Заказ.Статус;
КонецФункцииAn exception in the handler reaches the client as a SOAP Fault. Put a clear cause into the exception text, not just the internal platform error.

Calling an external SOAP service from 1C
Определения = Новый WSОпределения("https://partner.example.com/orders?wsdl", "user", Пароль);
Прокси = Новый WSПрокси(Определения,
"http://partner.example.com/orders", // URI пространства имён из WSDL
"OrderService", // имя сервиса
"OrderServiceSoap"); // имя точки подключения (порта)
Прокси.Пользователь = "user";
Прокси.Пароль = Пароль;
Результат = Прокси.GetOrder("5001");The namespace URI, service name and endpoint name come from the WSDL: the targetNamespace attribute and the service and port elements. A mistake in any of them is a common reason the proxy is not created.
1C web service addresses
| What | Address |
|---|---|
| WSDL | http://server/publication/ws/file_name.1cws?wsdl |
| Endpoint | http://server/publication/ws/file_name.1cws |
| Browser check | Open the WSDL address with a 1C account |
Common errors
- WSDL returns 404. Web services were not ticked when publishing.
- 401 on call. The 1C user login and password were not sent.
- WSProxy is not created. Wrong namespace, service or port name; check the WSDL.
- The client cannot read the response. The operation return type differs from the partner's description.
Validating the XML itself against a schema is covered in XML and XSD validation.
More on 1C
Section overview and all guides: 1C integration via API: options, architecture and examples.
- Publishing 1C on IIS and Apache: step by step and common errors
- JSON in 1C:Enterprise: read, write, HTTP requests and common errors
- Unexpected character when reading JSON in 1C: causes and fixes
- Structure, Array and ValueTable to JSON in 1C: both directions
- Data exchange in 1C: methods, formats, setup and checks
Frequently asked questions
How do I get the WSDL of a 1C web service?
Open http://server/publication/ws/file_name.1cws?wsdl with a 1C account after publishing with web services.
How do I call an external web service from 1C?
Create WSDefinitions from the WSDL and a WSProxy with the namespace, service and endpoint names, then call the operation as a proxy method.
Web service vs HTTP service?
A web service is SOAP with a strict WSDL and XML; an HTTP service is free-form REST, usually JSON.
Repeat this on your own API
Checkcraft is a desktop app that saves API response checks without code and shows what did not match. Start with a sample, then use your own sanitized data. Free runs on Windows and Linux with no time limit.
Download FreeDownload and first runNo sign-up or email needed, the archive is ready in a couple of minutes. See the edition limits.
Start with the linked example and compare its result with your own test requirement.