Hello.
In Google I did not find a solution, I did not realize it with savvy (so far).
It is necessary to send a request with a list of parameters of the following form:
<ParameterList> <Parameter Name="Склад" Value="111" Type="Справочник.Склады" TypeSearch = "Код"></Parameter> <Parameter Name="Номенклатура" Value="222" Type="Справочник.Номенклатура" TypeSearch = "Код"></Parameter> <Parameter Name="Приоритет" Value="0" Type="" TypeSearch = ""></Parameter> </ParameterList> Since I have WSDL and android - I use ksopa2-android. B quietly it turns out to send requests with one simple parameter. But I don’t know how to put in such a list.
If someone had a similar experience, please share at least a link to how a similar parameter is made.
Examining the wsdl file, compiled the following code:
SoapObject request = new SoapObject(Auth.NAMESPACE, (String) paramRequest.get("2")); StringBuffer bufferProxyAuth = new StringBuffer(paramRequest.get("4") + ":"); bufferProxyAuth.append(paramRequest.get("5")); byte[] bytes1 = bufferProxyAuth.toString().getBytes(); bufferProxyAuth.setLength(0); bufferProxyAuth.append("Basic "); org.kobjects.base64.Base64.encode(bytes1, 0, bytes1.length, bufferProxyAuth); List<HeaderProperty> headers = new ArrayList<HeaderProperty>(); headers.add(new HeaderProperty("Authorization", bufferProxyAuth.toString())); headers.add(new HeaderProperty("Cookie", (String) paramRequest.get("6"))); PropertyInfo textQuery = new PropertyInfo(); textQuery.setName("Name"); textQuery.setType(PropertyInfo.STRING_CLASS); //Задаем параметр где находится название метода textQuery.setValue((String) paramRequest.get("8")); request.addProperty(textQuery); //Работа с комплексными типами ParametrBox selectBox = (ParametrBox) paramRequest.get("9");//отбор ParameterList selectList = new ParameterList(Auth.NAMESPACE_COMPLEX_TYPE, "DimensionsSelect"); for (Object item : selectBox.getList()) { Parameter parameter = new Parameter(Auth.NAMESPACE, "Parameter"); // parameter.addAttribute("Name",(((ParameterCus)item).getName())); PropertyInfo propertyName = new PropertyInfo(); propertyName.setName("Name"); propertyName.setType(PropertyInfo.STRING_CLASS); propertyName.setValue((((ParameterCus) item).getName())); parameter.addProperty(propertyName); PropertyInfo propertyValue = new PropertyInfo(); propertyValue.setName("Value"); propertyValue.setType(PropertyInfo.STRING_CLASS); propertyValue.setValue((((ParameterCus) item).getValue())); parameter.addProperty(propertyValue); //parameter.addAttribute("Value",(((ParameterCus)item).getValue())); PropertyInfo propertyType = new PropertyInfo(); propertyType.setName("Type"); propertyType.setType(PropertyInfo.STRING_CLASS); propertyType.setValue((((ParameterCus) item).getType())); parameter.addProperty(propertyType); // parameter.addAttribute("Type",(((ParameterCus)item).getType())); PropertyInfo propertyTypeSearch = new PropertyInfo(); propertyTypeSearch.setName("TypeSearch"); propertyTypeSearch.setType(PropertyInfo.STRING_CLASS); propertyTypeSearch.setValue((((ParameterCus) item).getTypeSearch())); parameter.addProperty(propertyTypeSearch); //parameter.addAttribute("TypeSearch",(((ParameterCus)item).getTypeSearch())); selectList.addSoapObject(parameter); } request.addSoapObject(selectList); ParametrBox insertBox = (ParametrBox) paramRequest.get("10");//вставка ParameterList inserList = new ParameterList(Auth.NAMESPACE_COMPLEX_TYPE, "DimensionsResources"); for (Object item : insertBox.getList()) { Parameter parameter = new Parameter(Auth.NAMESPACE, "Parameter"); PropertyInfo propertyName = new PropertyInfo(); propertyName.setName("Name"); propertyName.setType(PropertyInfo.STRING_CLASS); propertyName.setValue((((ParameterCus) item).getName())); parameter.addProperty(propertyName); PropertyInfo propertyValue = new PropertyInfo(); propertyValue.setName("Value"); propertyValue.setType(PropertyInfo.STRING_CLASS); propertyValue.setValue((((ParameterCus) item).getValue())); parameter.addProperty(propertyValue); //parameter.addAttribute("Value",(((ParameterCus)item).getValue())); PropertyInfo propertyType = new PropertyInfo(); propertyType.setName("Type"); propertyType.setType(PropertyInfo.STRING_CLASS); propertyType.setValue((((ParameterCus) item).getType())); parameter.addProperty(propertyType); // parameter.addAttribute("Type",(((ParameterCus)item).getType())); PropertyInfo propertyTypeSearch = new PropertyInfo(); propertyTypeSearch.setName("TypeSearch"); propertyTypeSearch.setType(PropertyInfo.STRING_CLASS); propertyTypeSearch.setValue((((ParameterCus) item).getTypeSearch())); parameter.addProperty(propertyTypeSearch); //parameter.addAttribute("TypeSearch",(((ParameterCus)item).getTypeSearch())); inserList.addSoapObject(parameter); } request.addSoapObject(inserList); In response, I get this error:
SoapFault - faultcode: 'soap:Client' faultstring: 'Неизвестная ошибка. Ошибка преобразования данных XDTO: Чтение объекта типа: {http://ws1c.xxxxx.ru/objects}ParameterList - [1,223] Проверка дополнительного свойства: форма: Элемент имя: {http://ws1c.xxxxxx.ru}Parameter по причине: Ошибка преобразования данных XDTO: Чтение объекта типа: {http://ws1c.xxxxxx.ru/objects}ParameterList - [1,223] Проверка дополнительного свойства: форма: Элемент имя: {http://ws1c.xxxxx.ru}Parameter по причине: Ошибка проверки данных XDTO: Структура объекта не соответствует типу: {http://ws1c.xxxxx.ru/objects}ParameterList ' faultactor: 'null' detail: org.kxml2.kdom.Node@29624c4b