Skip to content
CheckcraftDownload
Practical workflow

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.

Checkcraft ·

Get help with your first test →

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.

API call diagram: method and URL, headers, body, status and response body, logs and database

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.

Layers of an API call check: status, headers, body, calculations, logs, database

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

WhatAddress
WSDLhttp://server/publication/ws/file_name.1cws?wsdl
Endpointhttp://server/publication/ws/file_name.1cws
Browser checkOpen 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.

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.

Next step

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 run

No 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.

Ask a person

Get help with your first test

Tell us what you want to test or where you got stuck. We can help you start Checkcraft, choose an example and understand your first run. You can ask before downloading.

The Telegram group is public: do not post passwords, tokens or confidential work data. A description of your task is enough to start.

You can also email us support@checkcraft.ru

No account required. We will reply by email. This is a support request, not a newsletter subscription.