1. David Peace (Powersoft)
  2. PowerBuilder
  3. Friday, 8 December 2017 15:03 PM UTC

HI Guys

I need to pick your brains, I am trying to make a call on a webservice where the WSDL file is hideously complicated compared to the one function that I would like to call. How can I simplify the WSDL or create the PB proxy objects manually or use a different method? Ideas please :)

WSDL File is: https://pms.verticalbooking.com/mainstay/OTA_PMS.php?wsdl


"http://www.opentravel.org/OTA/2003/05" xmlns:ns2 = "http://docs.oasis-open.org/wss/2004/01/oasis-
200401-wss-wssecurity-secext-1.0.xsd" xmlns:ns3 =
"http://schemas.xmlsoap.org/ws/2004/08/addressing">



test
test


uuid:84344d83-8078-e17f-a721-56e2facbf13d
http://www.myhotel.com/ws/ota
http://www.myhotel.com/ws/ota/OTA_ReadRQ

http://schemas.xmlsoap.org/ws/2004/12/addressing/role/anonymous






"MTRD"/>





"MTRD"/>







RESPONSE TYPE:


"http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:ns2 =
"http://www.opentravel.org/OTA/2003/05">

uuid:e73be007-3adb-cc93-8394-e56977350c3f
http://www.myhotel.com/ws/ota

http://schemas.xmlsoap.org/ws/2004/12/addressing/role/anonymous


uuid:84344d83-8078-e17f-a721-
56e2facbf13d

http://www.aecinternet.
it/booking_engine/int/myhotel/OTA_HotelInvCountNotifRS







 

 

Cheers

David

David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Monday, 11 December 2017 15:31 PM UTC
  2. PowerBuilder
  3. # 1

I contacted the company whos WSDL it is that we are using and this was their response:

Dear David,

Our webservice is a SOAP service based on OTA (http://opentravel.org/) schemas.

All the XSD schemas we are exposing are the one provided in version 2010B of their specifications with no modifications.

I suppose you are trying to consume our services using .NET (or similar platform), creating automatically objects from the exposed schemas.

In my experience that does not work due to the complexity of OTA schemas.

If you manually check the XSD, you will be able to find all the attributes and entities in the schemas even if the "automatic creation tool" you are using (wsdl.exe ?) can not find/parse them.

If you prefer you can use some visual tools to navigate the OTA schemas, like pilotfish:  https://www.pilotfishtechnology.com/modelviewers/OTA/

I know that some partners of ours, are successfully calling our webservice using .NET clients and I think with some work you can fix your classes.

Unfortunately we are using PHP and a simple SOAPClient object we can easily exploit all the functions.

Please remember that SOAP is based on HTTP POST: every example message can be posted as is to our endpoint: you will loose all the WSDL/schemas features (message verification, objects) but that could be a possible way to proceed, even if we do not recommend that.

Hope this help.

Kindest regards,

 

Is there another way / simpler way to call the web service?

Comment
There are no comments made yet.
Marco Meoni Accepted Answer Pending Moderation
  1. Friday, 8 December 2017 18:39 PM UTC
  2. PowerBuilder
  3. # 2

Hi David,

In principle you can DIY and manually edit the WSDL, save it locally and in the client refer to the local copy of the WSDL. Point is, it has many nested structure definitions (../OTA_PMS_CommonBindings.wsdl, ../OTA_PMS_CommonPortTypes.wsdl, ...) and those are not straightforward to isolate. I guess the WS is not on your hands and you cannot trim structures from the interface, don't you?

All in all, I agree that the WS has a certain complexity, but since PB creates the proxy without any issue (see picture below) and on disk it is just 150KB, why would you bother to chop it up?

Cheers,

Marco

ws

Comment
  1. David Peace (Powersoft)
  2. Monday, 11 December 2017 09:55 AM UTC
Hi marco



The only reason to chop it up s that I cannot get it to work in PB, I'm thinking that a simpler approach might work.



The type for OTA_HotelInvCountNotifRQ is not liked by PB. I cannot address the inventories.inventory. elements to setup the dates etc. I might be missing something though. Any thoughts welcome.



I'm testing using this code:



SoapConnection lws_conn                // Web Service Connection Object (Requires pbwsclient125)

ota_pms lproxy_otapms

//runtimeerror ierr                            // Run time error

boolean ib_connected = false            // Web service connected?





// Create web service object

long rval



lws_conn = create SoapConnection

rval =  lws_conn.setbasicauthentication( '', '3r799d6yq6', 'y3ppi58t20')



// Create Instance of VerticalCM

rval = lws_Conn.CreateInstance(lproxy_otapms,  "ota_pms", 'https://pms.verticalbooking.com/mainstay/OTA_PMS.php')

ib_connected = true





// Call the API function

ota_pingrq lota_pingrq

ota_pingrs lota_pingrs

lota_pingrq = Create ota_pingrq

//lota_pingrs = Create lota_pingrs

ota_hotelinvcountnotifrq lota_avail_rq

lota_avail_rq = Create ota_hotelinvcountnotifrq

ota_hotelinvcountnotifrs lota_avail_rs

string ls_return



lota_pingrq.timestamp = datetime(today(), now())

lota_pingrq.version = 1

lota_pingrq.echodata = 'echo message'



boolean lb_rtn

securityheadertype lsec

lsec = Create securityheadertype

lsec.mustunderstand = true

lsec.encodedmustunderstand = '1'

lsec.encodedmustunderstand12 = '1'

lsec.encodedrelay = '0'



// Set up availability Request

lota_avail_rq.inventories.hotelcode = '5071'

lota_avail_rq.inventories.inventory.        // Cannot reference the sub objects.

lb_rtn = lproxy_otapms.setsecurity( lsec)

//lota_pingrs = lproxy_otapms.ota_ping_request( lota_pingrq)

lota_avail_rs = lproxy_otapms.ota_hotelinvcountnotif_request( lota_avail_rq)

messagebox('blx', lota_pingrs.echotoken)



========================================================================



I cannot reference the hotel and dates i this section:







ns1:StatusApplicationControl Start = "2010-11-25" End = "2010-11-25" InvTypeCode =

"MTRD"/>













  1. Helpful
  1. David Peace (Powersoft)
  2. Monday, 11 December 2017 11:15 AM UTC
Hi Guys



I have moved a little bit further, using code as follows:



SoapConnection lws_conn                // Web Service Connection Object (Requires pbwsclient125)

ota_pms lproxy_otapms

//runtimeerror ierr                            // Run time error

boolean ib_connected = false            // Web service connected?



invcounttype linv_countype1

baseinvcounttype linv_inventory2

statusapplicationcontroltype linv_controltype3

baseinvcounttypeinvcount linv_counts3

baseinvcounttypeinvcountinvblockcutoff linv_block_cutoff4



// Create web service object

long rval



lws_conn = create SoapConnection

rval =  lws_conn.setbasicauthentication( '', '3r799d6yq6', 'y3ppi58t20')



// Create Instance of VerticalCM

rval = lws_Conn.CreateInstance(lproxy_otapms,  "ota_pms", 'https://pms.verticalbooking.com/mainstay/OTA_PMS.php')

ib_connected = true





// Call the API function

ota_pingrq lota_pingrq

ota_pingrs lota_pingrs

lota_pingrq = Create ota_pingrq

//lota_pingrs = Create lota_pingrs

ota_hotelinvcountnotifrq lota_avail_rq

lota_avail_rq = Create ota_hotelinvcountnotifrq

ota_hotelinvcountnotifrs lota_avail_rs

string ls_return



lota_pingrq.timestamp = datetime(today(), now())

lota_pingrq.version = 1

lota_pingrq.echodata = 'echo message'



boolean lb_rtn

securityheadertype lsec

lsec = Create securityheadertype

lsec.mustunderstand = true

lsec.encodedmustunderstand = '1'

lsec.encodedmustunderstand12 = '1'

lsec.encodedrelay = '0'



// Set up availability Request

linv_block_cutoff4 = Create baseinvcounttypeinvcountinvblockcutoff

linv_block_cutoff4.offsetcalculationmode = 1

linv_counts3 = Create baseinvcounttypeinvcount

linv_counts3.invblockcutoff = linv_block_cutoff4

linv_counts3.counttype = "1"

linv_counts3.count = "5"

linv_controltype3 = Create statusapplicationcontroltype

linv_controltype3.fri = true

linv_inventory2 = Create baseinvcounttype

linv_inventory2.statusapplicationcontrol = linv_controltype3

linv_inventory2.invcounts[1] = linv_counts3

linv_countype1 = Create invcounttype

linv_countype1.hotelcode = "5071"

linv_countype1.inventory[1] = linv_inventory2

lota_avail_rq.inventories = linv_countype1



//linv_block_cutoff.



//linv_controltype.



lb_rtn = lproxy_otapms.setsecurity( lsec)

//lota_pingrs = lproxy_otapms.ota_ping_request( lota_pingrq)

lota_avail_rs = lproxy_otapms.ota_hotelinvcountnotif_request( lota_avail_rq)

messagebox('blx', lota_pingrs.echotoken)





=================================================



I now get the error that the return value of (see below) cannot be reflected.





  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.