Last active
October 29, 2019 09:47
-
-
Save gitfvb/c6dc13921c8190b2cd9ddf88c8419155 to your computer and use it in GitHub Desktop.
first try to read and parse SOAP wsdl in powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wsdlUrl = "https://soap.flexmail.eu/3.0.0/flexmail.wsdl" | |
$wsdlContent = Invoke-RestMethod -Method Get -Uri $wsdlUrl -Verbose | |
# metadata | |
$targetNamespace = $wsdlContent.definitions.targetNamespace | |
$bindingStyle = $wsdlContent.definitions.binding.binding.style | |
# operations (different ways) | |
$operations1 = $wsdlContent.definitions.binding.operation | |
# operations with input and output | |
$operations2 = $wsdlContent.definitions.portType.operation | select name, @{name="input";expression={ $_.input.message }}, @{name="output";expression={ $_.output.message }} | |
# TODO [ ] join $operations2 and $messages | |
# messages with input/output and request/response | |
$messages = $wsdlContent.definitions.message | select name, @{name="partName";expression={ $_.part.name }}, @{name="partType";expression={ $_.part.type }} | |
# TODO [ ] join $messages and $complexTypes | |
# simple types | |
$simpleTypes = $wsdlContent.definitions.types.schema.simpleType | select @{name="typename";expression={ $_.name }} -expand restriction | select typename -expand enumeration | |
# complex types with "all" subtag | |
$complexTypes = $wsdlContent.definitions.types.schema.complexType | where { $_.all } | select @{name="typename";expression={ $_.name }} -expand all | select typename -expand element | |
# complex types with "complexContent" and "restriction" subtag | |
#$wsdlContent.definitions.types.schema.complexType | where { $_.complexContent } | select @{name="typename";expression={ $_.name }} -expand complexContent | where { $_.restriction } | select typename -Expand restriction | select typename -expand attribute | |
# complex types with | |
# ... there are more differentiations... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment