Hi Richard, I would not build a WSDL from scratch by hand either. The one I am using would have been generated automatically by the company whose services I am consuming, and so of course I must conform to it, hence the request for help on getting my response to work with it. Thanks for the info on wsdl2php. I didn't think to look for something that could do that! Nick. RQuadling wrote: > > On 6 October 2010 09:14, nick.weavers <nickweavers@yahoo.co.uk> wrote: >> >> It appears that the response array should not contain the top output wsdl >> message element, but start with the first child element.... changing my >> server to the following solved my problem: >> >> [quote] >> function ConsumeLead($data) >> >> Â Â Â Â$response = >> Â Â Â Â Â Â Â Âarray('ConsumeLeadResult' => >> Â Â Â Â Â Â Â Â Â Â Â Âarray( >> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â'LeadReceived' => 'true' >> Â Â Â Â Â Â Â Â Â Â Â Â) >> Â Â Â Â Â Â Â Â); >> >> Â return $response; >> } >> [/quote] >> The response is now working: >> [quote] >> Response: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope >> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >> xmlns:ns1="http://www.paaleads.com/LeadConsumerService/"><SOAP-ENV:Body><ns1:ConsumeLeadResponse><ns1:ConsumeLeadResult><ns1:LeadReceived>true</ns1:LeadReceived></ns1:ConsumeLeadResult></ns1:ConsumeLeadResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> >> [/quote] >> That only took me 4 hours to solve using the Monte Carlo problem solving >> technique %-| > > > I must admit, I've never had to build a server to match a wsdl file, > only a client (and then I use wsdl2php from sourceforge with the > mods/patches by RazorsEdgeUK). > > But building a server. Well, the classes built by wsdl2php (ignoring > the client class) would act as the basis for this. > > class ConsumeLead { > public $request; // ConsumeLeadRequest > } > > class ConsumeLeadRequest { > public $LeadType; // LeadType > public $LeadXml; // string > public $AuthenticationUsername; // string > public $AuthenticationPassword; // string > } > > class LeadType { > const Unknown = 'Unknown'; > const Mortgage = 'Mortgage'; > const TermAssurance = 'TermAssurance'; > const Travel = 'Travel'; > const PMI = 'PMI'; > const SecuredLoan = 'SecuredLoan'; > const CreditHelp = 'CreditHelp'; > const Stakeholder = 'Stakeholder'; > const TermPostal = 'TermPostal'; > const Pension = 'Pension'; > const Savings = 'Savings'; > const Investments = 'Investments'; > const UnsecuredLoan = 'UnsecuredLoan'; > const OverseasMortgage = 'OverseasMortgage'; > const Debt = 'Debt'; > const ASU = 'ASU'; > const LegalServices = 'LegalServices'; > } > > class ConsumeLeadResponse { > public $ConsumeLeadResult; // ConsumeLeadResponse > } > > From there it is a case of building the appropriate framework. > > My server classes deal with supplying the wsdl file and the end-user > docuementation (http://site.com/service, http://site.com/service?wsdl, > http://site.com/service?help or doc or documentation or man or manual, > etc.). > > But I never build XML files by hand for anything more than the most > simplest of files. > > -- > Richard Quadling > Twitter : EE : Zend > @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY > > -- > PHP Soap Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- View this message in context: http://old.nabble.com/Need-help-generating-a-response-that-matches-wsdl-tp29890878p29896436.html Sent from the Php - Soap mailing list archive at Nabble.com. -- PHP Soap Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php