0

Okay So I have a WSDL service installed, and I can access it through the following URL:

server1/AccessService/StockControlService.svc

And when I view that page I get a long page of XML. In that XML there are elements called operations which are the function names I use. For instance, there is a function named StockPrice_Return.

However, each function has a specific set of parameters that you have to pass through to it to get a result back. In Google Chrome i've installed an extension called Wizdler which allows me to click a function name, and see the following XML:

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <Body>
        <StockPrice_Return xmlns="http://tempuri.org/">
            <!-- Optional -->
            <request>
                <Ticket xmlns="http://schemas.datacontract.org/2004/07/AccessUKWebService.DimensionsWebService">[string?]</Ticket>
                <PriceLineNo xmlns="http://schemas.datacontract.org/2004/07/AccessUKWebService.DimensionsWebService">[string?]</PriceLineNo>
                <PriceType xmlns="http://schemas.datacontract.org/2004/07/AccessUKWebService.DimensionsWebService">[string?]</PriceType>
                <StockCode xmlns="http://schemas.datacontract.org/2004/07/AccessUKWebService.DimensionsWebService">[string?]</StockCode>
            </request>
        </StockPrice_Return>
    </Body>
</Envelope>

Which is great, so from that I can see okay I need a Ticket, a PriceLineNo, a PriceType and a StockCode in order to be able to query this function.

However I've got a number of WSDL services which 20 or 30+ functions each. I want to be able to generate using PHP the functions and parameters myself.

The PHP Soap function doenst seem to have this ability. There are __getFunctions() and __getTypes() but neither of them seem to return the data I'm after.

I don't know how the chrome extension is getting that XML above but If I could just return it myself then I could build an XML parser in my browser. I downloaded SoapUI and it too managed to find the above XML. But no where am I able to find documentation on how to get the damned paramenters! It's driving me mad!

Chud37
  • 4,907
  • 13
  • 64
  • 116
  • The XML is generated from WSDL and the embedded/imported schema. Usually the programming languages have tools to generate files based on WSDL which will provide all the operations and message structures. The data is filled by understanding the datatype of the XML element. May be this can help: https://stackoverflow.com/questions/4430/how-to-easily-consume-a-web-service-from-php. Are you trying to consume the service in PHP or write a chrome extension? – sashwat May 07 '18 at 04:15
  • @sashwat yes I am trying to get it done in pure PHP as the PHP Soap statements don't really provide much information. – Chud37 May 08 '18 at 10:18

0 Answers0