none
Powershell and WSDL Question

    General discussion

  • I've read many a posting about using Powershell to get a WSDL and call a method.  In fact I too can do this using one of the many Weather examples out there.  My problem comes in when the WSDL gets a little more complicated.

    I have a internal WSDL we use inside my company to pull trouble tickets.  Using Storm I am able to pass the required data and get the response.  This is the generated Raw data sent.

    <?xml version="1.0" encoding="utf-8"?>
    
    
    
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    
    
    
    <soap:Header>
    
    
    
    <AuthenticationInfo xmlns="urn:HPDGetTicketDetails">
    
    
    
    <userName>Username</userName>
    
    
    
    <password>Password</password>
    
    
    
    <authentication />
    
    
    
    <locale />
    
    
    
    <timeZone />
    
    
    
    </AuthenticationInfo>
    
    
    
    </soap:Header>
    
    
    
    <soap:Body>
    
    
    
    <OpGet xmlns="urn:HPDGetTicketDetails">
    
    
    
    <ViewOHDTicketRequest xmlns="http://www.mycompany.com/XMLSchema">
    
    
    
    <WebServiceDataSet>
    
    
    
    <RequestId xmlns="http://www.mycompany.com/XMLSchema/BIM" />
    
    
    
    <WebServiceName xmlns="http://www.mycompany.com/XMLSchema/BIM" />
    
    
    
    <AuthenticationId xmlns="http://www.mycompany.com/XMLSchema/BIM" />
    
    
    
    <AuthenticationPassword xmlns="http://www.mycompany.com/XMLSchema/BIM" />
    
    
    
    </WebServiceDataSet>
    
    
    
    <InputDataSet>
    
    
    
    <TroubleTicketId xmlns="http://www.mycompany.com/XMLSchema/BIM">HD00004798638</TroubleTicketId>
    
    
    
    </InputDataSet>
    
    
    
    </ViewOHDTicketRequest>
    
    
    
    </OpGet>
    
    
    
    </soap:Body>
    
    
    
    </soap:Envelope>
    
    
    
    

     

    $URI = <My WSDL URI>
    
    
    
    $myWSDL = New-WebServiceProxy -uri $URI
    
    
    
    # Add the Authentication Bit
    
    
    
    # Add the InputDataSet stuff
    
    
    
    $Response = $myWSDL.opget
    
    
    
    

     

     The only Values I need to pass are the TroubleTicketID, Username, Password

     

    Any help is greatly appreciated, Thanks

    Josh

    So I'm missing pretty much everything.  I figure it should be something like $Data.InputDataSet.Trouble.Ticket.ID = "HD12345678901" or something like that.
    Thursday, October 21, 2010 12:20 AM