TXGB SOAP Endpoin Python Query

Viewed 16

i am trying to create a Python project using TXGB (https://www.txgb.co.uk/). Provider Search Endpoint. I created a script using the test providerAvailability endpoint and it is running. The script `

# set the WSDL URL
wsdl_url = "https://apis.txgb.co.uk/CABS.WebServices/SearchService.asmx?WSDL"

# set method URL
method_url = "https://apis.txgb.co.uk/CABS.WebServices/ProviderSearch"
# initialize zeep client
client = zeep.Client(wsdl=wsdl_url)

# set country code for India
country_code = "GB"
def providerAvailability():

    data = {
        "Channels": {
            "DistributionChannelRQ": {
                "id": "TestDistributor",
                "key": "7C874541-AA83-4AD5-A08D-794401270D67",
            }
        },
        "Providers": {
            "ProviderRQ": {
                "short_name": "TestProviderHotel",
            }
        },
        "Query": {
            "IndustryCategory": "None",
            "IndustryCategoryGroup": "Accommodation",
            "SearchCriteria": {
                "LengthNights": {
                    "minimum": "1",
                    "maximum": "1"
                },
                "CommencingWindow": {
                    "start_date": "2022-12-01",
                    "finish_date": "2022-12-14"
                },
                "Consumers": {
                    "Consumer": {
                        "adults": "2",
                        "children": "0",
                        "concessions": "0"
                    }
                }
            }
        }
    }
    print(client.service.ProductAvailability(**data))` 

But i couldnt run provider search endpoint. It is running in the test endpoint. My function for provider search is

def providerSearch():
    data = {
        "Channels": {
            "CO_DistributionChannelRQType": {
                "id": "Test_V3_Offload",
                "key": "60E0533B-6E38-4779-A7D7-0D82BF824C55",
            }
        },
        "Query": {
            "SearchCriteriaIncludeTestProviders": {
                "value": "true",
            }
        }
    }
    print(client.service.ProviderSearch(**data))

Error is:

TypeError: {http://www.v3leisure.com/Schemas/CABS/1.0/CABS_ProviderSearch_RQ.xsd}CABS_ProviderSearch_RQ() got an unexpected keyword argument 'Query'. Signature: ({Response: {http://www.v3leisure.com/Schemas/CABS/1.0/CABS_Common.xsd}PS_ResponseInclusionsRQType} | {Paging: {http://www.v3leisure.com/Schemas/CABS/1.0/CABS_Common.xsd}CO_ResponsePagingRQType} | {Query: {http://www.v3leisure.com/Schemas/CABS/1.0/CABS_Common.xsd}PS_QueryRQType} | {Channels: {http://www.v3leisure.com/Schemas/CABS/1.0/CABS_ProviderSearch_RQ.xsd}ArrayOfCO_DistributionChannelRQType})[], callerId: xsd:string, version: xsd:string

This is the test tool XML request

<CABS_ProviderSearch_RQ version="1.9" xmlns="http://www.v3leisure.com/Schemas/CABS/1.0/CABS_ProviderSearch_RQ.xsd">
  <Channels>
    <CO_DistributionChannelRQType id="Test_V3_Offload" key="60E0533B-6E38-4779-A7D7-0D82BF824C55" />
  </Channels>
  <Query>
    <SearchGroup xmlns="http://www.v3leisure.com/Schemas/CABS/1.0/CABS_Common.xsd" />
  </Query>
  <Response />
</CABS_ProviderSearch_RQ>

The test tool screenshot for provider search endpoint enter image description here

0 Answers
Related