1. Viktor Genel
  2. PowerServer 2020 or older (Obsolete)
  3. Wednesday, 30 May 2018 12:21 PM UTC

Hello Community,

I am implementing a webservice call through Appeon PowerServer 2017.
The call works fine in PB using web service proxy. 

The webmethod of the call takes a structure lstr_rqst as a parameter.

1. When I pass the whole parameter structure as a first item of the paralist array 
la_paralist[1] = lstr_rqst
I get this error:

ErrorText:
Execute call Web Service failed.
Error message:AppWebservice:Failed to parse Web Service!Web Service address https://xxx.xxx,
message=The remote server returned an error: (500) Internal Server Error.

ReturnValue Is Null

2. When I pass srtucture's items as individual items of the paralist array
la_paralist[1] = lstr_rqst.agency_id
la_paralist[UpperBound( la_paralist)+1] =  lstr_rqst.eligibility_id
la_paralist[UpperBound( la_paralist)+1] = lstr_rqst.worker_id

The call fails with no ErrorText 
ReturnValue Is Null

Function of_callwebservice() returns -1 in both cases 

Any Idea how to overcome this?

Appeon Support Team Accepted Answer Pending Moderation
  1. Thursday, 31 May 2018 00:46 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

Hi Viktor,

The appeonwebservicecomponent only supports basic data type as the parameter of web service, such as string, long, etc. And we doesn't support the complex data type like structure, Array, object,etc. Please try to work around this issue by store many values in one string variable.

Regards,
ZhaoKai

Comment
  1. Viktor Genel
  2. Friday, 1 June 2018 14:51 PM UTC
Thank you ZhaoKai.

Now I am implementing a different webservice with several parameters - all simple datatypes. 

I don't get Error 500 any more when I call appeonwebservicecomponent.of_callwebservice() function. 

Now I am getting -1 return with an ErrorText 'Object reference not set to an instance of an object' 

ReturnValue always comes back as 'Undefined'.

In PB the webservice' return is loaded by a soapconnection into a structure, and it works perfectly in PB. 



Does this all mean that Appeon will not handle structures as returns either?

  1. Helpful
There are no comments made yet.
Viktor Genel Accepted Answer Pending Moderation
  1. Wednesday, 30 May 2018 19:12 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 2

Thank you Govinda,

if you mean items within the passed structure, they were defined as strings. 
Following your suggestion, I changed all their types to any, and ran another test.
The result is: the same internal error 500.
I believe the culprit is: passing a structure through appeonwebservicecomponent.of_callwebservice() function, which only accepts an array of any.
I wonder if anyone ever implemented calls through Appeon PowerServer to web services accepting structures as parameters. 
I found no information on that anywhere so far. 
All the examples I found are using standard data types.

Thank you,


Comment
  1. Govinda Lopez @Appeon
  2. Wednesday, 30 May 2018 22:15 PM UTC
Hi Viktor,



 



Here's a suggestion, try either one of these three options:





 



INTEGER li_agency, li_eligibility_id, li_worker_id

li_agency = lstr_rqst.agency_id

li_eligibility_id = lstr_rqst.eligibility_id

li_worker_id = lstr_rqst.worker_id

la_paralist[1] = li_agency

la_paralist[UpperBound( la_paralist)+1] =  li_eligibility_id 

la_paralist[UpperBound( la_paralist)+1] = li_worker_id 

of_callwebservice("WS_Method", la_paralist)

 





 



STRING ls_parm

ls_parm ='{"parm1" : "' + STRING(lstr_rqst.agency_id) + '" , "parm2" : "' + STRING(lstr_rqst.eligibility_id) + '", "parm3" : "' +  STRING(lstr_rqst.worker_id) + '"}'

​​of_callwebservice("WS_Method", ls_parm)

 





 



​​ANY la_parm

la_parm ='{"parm1" : "' + STRING(lstr_rqst.agency_id) + '" , "parm2" : "' + STRING(lstr_rqst.eligibility_id) + '", "parm3" : "' +  STRING(lstr_rqst.worker_id) + '"}'

​​of_callwebservice("WS_Method", la_parm)









 



​Please do let us know if this worked for you. Otherwise, if you could share with us the web service to test...?



 



 



Regards,

  1. Helpful
  1. Viktor Genel
  2. Thursday, 31 May 2018 11:47 AM UTC
Thank you Govinda, I tried these approaches among many others. I am dealing with a very specific webservice which will only take a structure as a parameter. 

I got a confirmation from tech team that the Appeon workaround only supports basic datatypes. My next step will be to implement caller.calltype="2" approach deploying a DLL to the PowerServer. 

Unfortunately I have no control over the webservice we work with and I cannot share it here.

  1. Helpful
There are no comments made yet.
Govinda Lopez @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 30 May 2018 16:47 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 3

Hi Viktor,

 

What is the response header you get from the Web Service?

 

 

Regards,

Comment
  1. Govinda Lopez @Appeon
  2. Wednesday, 30 May 2018 18:39 PM UTC
Viktor,



 



I assume you have already set the Parameter as "Any" datatype. If so, you would need to debug the web service to see why it is not accepting your array. 



 



It could in fact be that your Web Service is looking for a very specific parameter datatype.



 



 



Regards,

  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 30 May 2018 18:56 PM UTC
Hi Govinda;



      That could well be Viktor`s issue as the ANY datatype is not a standard Web Service datatype as recognized by WC3 standards. Typically, web service parameters and returned results must be a within standard "C" data types.



Regards ... Chris

  1. Helpful
  1. Govinda Lopez @Appeon
  2. Wednesday, 30 May 2018 21:40 PM UTC
Hi Chris,



 



Based on documentation the function of_callwebservice would be sending, by reference, an array of "any" datatype to the web service. But, structures are not support as parameters for calling Web Services in PowerServer (see here). 



 



I recall having sent parameters this way before with success. It might just be the way he is sending them or, most likely, that the Web Service itself is not supporting the parameter he passed to it.



 



 



Regards,

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.