1. Richard Carrier
  2. PowerBuilder
  3. Friday, 7 September 2018 20:22 PM UTC

We setup a wsdl in the latest PB 2017 worked great. But now we tried to create a datawindow with the datasource as a webservice or even just capture and parse it in the code. 

Problem is it's coming back as a system.object data type and the datawindow throws up an error when we create it and we cant figure out how to read and convert it in code.

Any help is much appreciated. Thanks Richard

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 7 September 2018 20:32 PM UTC
  2. PowerBuilder
  3. # 1

Hi Richard;

  The Web Service DWO can only handle simple data types and they must be returned in a 2D format (ie: rows and columns) only. Varying the WS returned Result Set outside of that format would error the DW at design and/or run-time for sure.

Regards ... Chris

Comment
  1. Richard Carrier
  2. Friday, 7 September 2018 20:44 PM UTC
Hi Chris,

Well, I kinda figured and read that also. I appreciate you responding. We are stuck looking for another method to read this results and wanted to stay in PB is possible.



Any suggestions from prior experience ? Thanks
  1. Helpful
  1. Richard Carrier
  2. Friday, 7 September 2018 22:41 PM UTC
Anyone know how to actually make this work ?



Any help is appreciated.



Thanks
  1. Helpful
There are no comments made yet.
Marco Meoni Accepted Answer Pending Moderation
  1. Sunday, 9 September 2018 15:28 PM UTC
  2. PowerBuilder
  3. # 2

Hi Richard,

instead of WS DW just use regular PB WS proxy object:

https://www.appeon.com/support/documents/appeon_online_help/pb2017r3/application_techniques/ch28s03.html

the returned system.object will be mapped by PB as a standard NVO.

This tutorial shows the basic howtos:

https://www.appeon.com/developers/library/videos/soap-web-service-crash-course.html

Best,

.m

Comment
There are no comments made yet.
Richard Carrier Accepted Answer Pending Moderation
  1. Sunday, 9 September 2018 20:26 PM UTC
  2. PowerBuilder
  3. # 3

Went thru the entire video and did not see any mention of what I'm trying to do. I certainly may have missed it.

Are you referring to this

"The script to call AppeonWebServiceComponent takes effect on both the Web and the mobile, and has no effect in the PowerBuilder application"

 

Because this looked interesting until I saw its only usable from Appeon Web or mobile (i think)

Can you be more specific on what in the tutorial will help

 

I really appreciate your response. 

Thanks

Richard

Comment
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Monday, 10 September 2018 11:31 AM UTC
  2. PowerBuilder
  3. # 4

As Marco said below, PB usually creates NVOs for the response.  It can be a single nvo with attributes, arrays, or even additional nvo's or arrays of nvo's.  You need to parse the result with Powerscript and populate the DW manually.  One thing that is usually very helpful in doing this is to go through in debugger.  Stop when you get the response and look at the object and what's inside it.  Once you get used to processing the response, it's not that bad.  Another thing that's helpful is to do a Edit Source on the service object so you can see each method and what it expects as a return.

 

Kevin

Comment
  1. Richard Carrier
  2. Monday, 10 September 2018 16:38 PM UTC
I'm not sure what you mean by "usually" . How is PB going to create a NVO to represent an object?



I dont think you understand what the challenge is here. The return type from the web service is of type any.

The video I watched did nothing but a array of two strings. A very simple example



Do actually have any sample code that works. Any help is appreciated Thanks
  1. Helpful
  1. Kevin Ridley
  2. Monday, 10 September 2018 17:25 PM UTC
If you use the web service proxy wizard it will step you through the process (New/Project/Web Service Proxy Wizard). The objects are created by PB when it consumes the WSDL file. Once you go through the wizard, it creates a project object that you run. I usually use a new PBL with nothing else in it as the "deploy" pbl so it's easy to see what objects are generated. Generally, 1 object is created for the service. You can't open this object, you have to do Edit Source to see what the functions, arguments and response types are. The other objects will be "value objects", basically nvo's with attributes only, no functions. Sometimes the nvo's have other nvo's or arrays of nvo's as attributes, depending on the complexity of the response.



If you are saying you went through this process and it tells you the return is type Any, then there is probably something in the WSDL that PB didn't like. Everything has to be standard SOAP datatypes. I think Chris posted a link somewhere specifying the list of acceptable types. If you can't get rid of the Any as a response, I have still been able to process the Any sometimes if the contents are well defined. As I mentioned, use debugger and put a stop on your method call where you have something like this:



Any la_response

//(setup soapconnection obj, createinstance)

la_response = myinstance.myfunction()



Step over that line and when it finishes, take a look at the la_response and see if it's broken down into something you can parse.



If your WSDL is something public and you post it, we can try to consume it and see what we get.



Kevin
  1. Helpful
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Wednesday, 12 September 2018 14:33 PM UTC
  2. PowerBuilder
  3. # 5

Curious if you got this working?  Not sure if you saw my last comment after yours below because the thread doesn't move to the top for a comment, only when there is a reply like this.  Hopefully you got it working.

{pasted from comments below}

If you use the web service proxy wizard it will step you through the process (New/Project/Web Service Proxy Wizard). The objects are created by PB when it consumes the WSDL file. Once you go through the wizard, it creates a project object that you run. I usually use a new PBL with nothing else in it as the "deploy" pbl so it's easy to see what objects are generated. Generally, 1 object is created for the service. You can't open this object, you have to do Edit Source to see what the functions, arguments and response types are. The other objects will be "value objects", basically nvo's with attributes only, no functions. Sometimes the nvo's have other nvo's or arrays of nvo's as attributes, depending on the complexity of the response.



If you are saying you went through this process and it tells you the return is type Any, then there is probably something in the WSDL that PB didn't like. Everything has to be standard SOAP datatypes. I think Chris posted a link somewhere specifying the list of acceptable types. If you can't get rid of the Any as a response, I have still been able to process the Any sometimes if the contents are well defined. As I mentioned, use debugger and put a stop on your method call where you have something like this:



Any la_response

//(setup soapconnection obj, createinstance)

la_response = myinstance.myfunction()



Step over that line and when it finishes, take a look at the la_response and see if it's broken down into something you can parse. 



If your WSDL is something public and you post it, we can try to consume it and see what we get.



Kevin

Comment
There are no comments made yet.
Richard Carrier Accepted Answer Pending Moderation
  1. Saturday, 15 September 2018 23:23 PM UTC
  2. PowerBuilder
  3. # 6

Kevin and Everyone thank you for the responses.

Good news is we worked with and solved the problem perfectly using Chilkat software embedded right inside our powerscript code.

It was tricky but we can now submit files and capture the results in XML. Basically the tool did all the conversions etc. for us. The datawindow is obviously very nice for simple data types but for complex returns data types i would suggest chilkat. They have a full page of powerbuilder example which is rare.

 

Thank you,

Richard

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