I have noticed that 1c WS implememation does not work with a lot of web services published. I have tried to make it work all the way from 8.3.6 until now. I have prepared and example to test
Code
&AtServer
Procedure TestSOAPAtServer()
Clave = "1801201801099271313500120010020000004247142553011";
SSL = New OpenSSLSecureConnection();
WSD = New WSDefinitions("https://cel.sri.gob.ec/comprobantes-electronicos-ws/AutorizacionComprobantesOffline?wsdl",,,,,SSL);
WSProxy = New WSProxy(WSD,"http://ec.gob.sri.ws.autorizacion",
"AutorizacionComprobantesOfflineService",
"AutorizacionComprobantesOfflinePort",,15,
SSL);
Response = WsProxy.autorizacionComprobante(Clave);
EndProcedure
As you can imagine, it fails. And there is no way I can ask my service provider to make any changes to the publication, because it works just fine with java, c# and other applications.
Quote
{DataProcessor.Consultar.Form.Form.Form(156)}: Error calling context method (autorizacionComprobante) Response = WsProxy.autorizacionComprobante(Clave); , reason: Web service call error. Service operation call error: {}:AutorizacionComprobantesOfflineService:autorizacionComprobante() , reason: Web service call error. Unknown error. Error converting XDTO data: Read object of type - [1,503] Additional property validation: form: Item name: autorizacion , reason: Error converting XDTO data: Read object of type - [1,503] Additional property validation: form: Item name: autorizacion , reason: XDTO data validation error: Object structure does not match type:
Is there any way to make it work without manually parsing XML? Actually I have already created a library to replase 1C SOAP services, but it does not seems to be the rihgt way to proceed. I am really hoping it could be done by using standard functions and objects.
I executed your code and it failed. Then I tried to run request at and it failed too.
Code
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:autorizacionComprobanteResponse xmlns:ns2="http://ec.gob.sri.ws.autorizacion">
<RespuestaAutorizacionComprobante>
<claveAccesoConsultada/>
<autorizaciones>
<autorizacion>
<estado>RECHAZADA</estado>
<mensajes>
<mensaje>
<identificador>80</identificador>
<mensaje>ERROR EN LA ESTRUCTURA DE LA CLAVE DE ACCESO</mensaje>
</mensaje>
</mensajes>
</autorizacion>
</autorizaciones>
</RespuestaAutorizacionComprobante>
</ns2:autorizacionComprobanteResponse>
</soap:Body>
</soap:Envelope>
ERROR IN THE STRUCTURE OF THE ACCESS KEY
I think something wrong with "Clave".
So 1C doesn't work wrong, but it would be very useful to show plain response in the error message instead "Error converting XDTO data". Wireshark for such small problem - it's overkill.
We tested the web service via SoapUI and it successfully returns an XML-formatted response.
The issue with 1C:Enterprise script code you provided is that at the moment the XDTO library incorrectly processes the contents of the response's "ambiente" XML element (this contents is encoded in CDATA and has XML format).
Our developers will either provide a fix for the issue in the next version of 1C:Enterprise platform, or provide you with a workaround to let you work with the web service from your 1C:Enterprise script code.
Vladimir Gurov wrote: Our developers will either provide a fix for the issue in the next version of 1C:Enterprise platform, or provide you with a workaround to let you work with the web service from your 1C:Enterprise script code.
It definitely needs to be fixed, because every time I was trying to adapt XDTO it fails on me. Also, please suggest some workaround until it will be fixed. I have made a xml manually and changed the content variables. but it does not look as a sleek solution.