Good afternoon to everybody,
We have just migrated our application from PB6 to Appeon PB2017 R3. It works fine, but we want to implement some new features.
One of them is receive data from a webservice, but I just don't know how to do it.
I've tried doing this:
New Datawindow - Grid - From Webservice - Enter the WSDL - It detects the webservice - Detects the methods - I select the one I need and when I select the returnvalue [RET], it crashes with the message "An invalid resultset parameter type was detected."
I'm quite new at this, so I don't know how to do it.
Our webservice WSDL is https://amcspainfresh.qdecalidad.com/webserviceExternal/ws.apps
It's an external WS, so I can't modify anyting.
If anybody could help me, it would be appreciated.
This way is working ok, I see the response, the IdCategoria and IdNube, which are either string or long.
The problem now is how to see the data(Informes), which is a TabInformesarray type.
I've tried creating a TabInformes variable, and giving it the result of lo_res.tabcategoria.informes
Then, when I see the methods of this variable (la_informes), I can see the "datos" one, which is what I need, but I don't know how to access/see/work with the data...
Here is my code:
SoapConnection conn // Definimos conexión SOAP
webserviceexternalcontrollerservice proxy_obj // Declaramos proxy
long rVal
resultadotabmodule lo_res
Tabinformes la_informes []
conn = create SoapConnection //Creamos instancia de la conexión
// Set trace file to record soap interchange data,
// if string is "", disables the feature
rVal = Conn.CreateInstance(proxy_obj, &
"webserviceexternalcontrollerservice")
try
// Create proxy object
lo_res = proxy_obj.getreportscategory("98e03348f20cf62c735993d0fea96359", "Volcado_AMC_Carcer",dp_1.text,0,50000,dp_1.text)
la_informes = lo_res.tabcategoria.informes
messagebox("Respuesta", lo_res.Resultado)
messagebox("Id Categoria", lo_res.TabCategoria.IdCategoria)
messagebox("Id Nube", lo_res.TabCategoria.IdNube)
catch ( SoapException e )
messagebox ("Error", "WS no accesible")
end try
destroy conn
Thank you again Marco and Chris,
Pepe.
I hope you understood now the principle behind PB proxies.
You can access *any* structured data types provided by SOAP/XML WS.
Whenever you need to handle non-primitive data types, the corresponding PB NVOs will be created in you library by the proxy project.
Deploy the proxy project and all is needed for the Web Service client gets into your PBL.
If the WS accepts/returns *nested* structured objects, just use dot notation as in my previous example.
Best regards,
.m
The thing is that the "results" of the category are in the very bottom of the result, and I can't (don't know how) access them.
I've created a variable "lt_informe" of the type tabinformes, and I want to save the "usuario" field.
I create a variable ls_usuario of the type string, and code:
ls_usuario = lt_informe.usuario
I messagebox to see the result and compiles ok, but the execution shows a Null Object Reference.
At the beginning I've changed the lo_res variable to
lo_res = proxy_obj.getreportscategory("98e03348f20cf62c735993d0fea96359", "Volcado_AMC_Carcer",dp_1.text,0,50000,dp_1.text).tabcategoria ,
So I've gone a level further in the XML response...