migrate_plus.migration.weather_soap.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # This migration demonstrates importing from SOAP/WSDL.
  2. id: weather_soap
  3. label: SOAP service providing weather.
  4. migration_group: wine
  5. source:
  6. # We use the SOAP parser source plugin.
  7. plugin: url
  8. data_fetcher_plugin: http # Ignored - SoapClient does the fetching.
  9. data_parser_plugin: soap
  10. # URL of a WSDL endpoint.
  11. urls: http://www.webservicex.net/globalweather.asmx?WSDL
  12. # The function to call on the service, and the parameters to pass. See
  13. # http://www.webservicex.net/New/Home/ServiceDetail/56 for the XML structure
  14. # of this feed - how CountryName is passed within the GetCitiesByCountry
  15. # XML element.
  16. function: GetCitiesByCountry
  17. parameters:
  18. CountryName: Spain
  19. # Responses may be returned as an XML string, an object, or an array - specify
  20. # the type of response here.
  21. response_type: xml
  22. # Looking at the XML response at http://www.webservicex.net/globalweather.asmx/GetCitiesByCountry,
  23. # we see that the data items we want are within <NewDataSet><Table>.
  24. item_selector: /NewDataSet/Table
  25. # For each field, 'name' is the source property name to be used in the process
  26. # steps below, 'label' is optional (to document the property), and selector
  27. # is an xpath (-like, for array and object returns) string relative to the
  28. # item_selector for retrieving that data value.
  29. fields:
  30. -
  31. name: Country
  32. label: Country
  33. selector: Country
  34. -
  35. name: City
  36. label: City
  37. selector: City
  38. # 'ids' tells us what source property ('City') holds the unique identifying
  39. # value for each imported item, and what schema type to use to hold that
  40. # value in the migration map an message tables.
  41. ids:
  42. City:
  43. type: string
  44. process:
  45. vid:
  46. plugin: default_value
  47. default_value: migrate_example_wine_varieties
  48. name: City
  49. destination:
  50. plugin: entity:taxonomy_term