Creating a SoapServer response to a SoapClient without a WSDL in PHP

25 Views Asked by At

In order to communicate with vending machine, I have to accept their SOAP requests and respond in the proper format.

To dos this, I am using "soapServer" in PHP.

My problem is I do not have access tot he WSDL they are using and may response must be like below:

Request:

 <soap:Body>
  <IDAccountInquiry
   <IDNumber>string</IDNumber>
   <IDPIN>string</IDPIN>
   <SiteID>string</SiteID>
   <MachineID>string</MachineID>
  </IDAccountInquiry>
 </soap:Body></soap:Envelope>

Required response:

 <soap:Body>
  <IDAccountInquiryResponse xmlns="http://tempuri.org/">
  <IDAccountInquiryResult>
    <InquirySuccess>boolean</InquirySuccess> <CurrentBalance>decimal</CurrentBalance>
    <FailureReason>string</FailureReason>
    </IDAccountInquiryResult>
  </IDAccountInquiryResponse>

How would I code this in PHP to match exactly?

1

There are 1 best solutions below

1
Juanjo On

You need to contact the vendor to see if they have a discovery protocol or they need to give you the documentation. You can try some WSDL discovery tools, but without the documentation from the vending machine's vendor is very difficult to get the names of the XML Web services they are using.