Quantcast
Channel: SCN: Message List - PowerBuilder Developer Center
Viewing all articles
Browse latest Browse all 7329

Re: How to pass a structure/array of structure as input parameter in a webservice

$
0
0

I am assuming this is the same for .Net but in Classic you can create NVO's with Instance Variables and then reference them in the NVO that will be used as the parameter for the Public WebService.

 

WS NVO's:

Children

     String             Child[]

 

Customer

     String             FirstName

     String             LastName

     String             DOB

     Children          Children

 

Public Interface uses Customer

 

Calling Code Example:

 

integer    rc, liNdx
string     lsReturn
SoapConnection lSoapConnect
proxy_testing  px_Testing

 

lSoapConnect = CREATE SoapConnection
if IsValid(lSoapConnect) then
TRY
  rc = lSoapConnect.CreateInstance(px_Testing, 'proxy_testing')
  CHOOSE CASE rc
   CASE 100
    lsReturn = "Invalid proxy name"
   CASE 101
    lsReturn = "Failed to create proxy"
   CASE 0
    Proxy_Customer lNewCustomer
    lNewCustomer = CREATE Proxy_Customer
    lNewCustomer.FirstName = 'Chris'
    lNewCustomer.LastName = 'Craft'
    lNewCustomer.DOB = 'Getting Older'
    Proxy_Children lChildren
    lChildren = CREATE Proxy_Children
    lChildren.Child[1] = 'Madeline'
    lChildren.Child[2] = 'Hayden'
    lNewCustomer.Children = lChildren
    lsReturn = px_Testing.NewCustomer(lNewCustomer)
   CASE ELSE
    lsReturn = "Unknown error (" + String(rc) + ")"
  END CHOOSE
  if rc <> 0 then MessageBox("Invocation Error", lsReturn, Exclamation!)
 
CATCH (RuntimeError rte)
  rc = -1
  MessageBox("Runtime Error", rte.text, Exclamation!)
END TRY
end if

 

 

Chris Craft


Viewing all articles
Browse latest Browse all 7329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>