473,385 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to generate a response that matches wsdl

Hi, I have a wsdl I have to conform to that looks like this:
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <wsdl:definitions
  3.     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  4.     xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
  5.     xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  6.     xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
  7.     xmlns:tns="http://www.paaleads.com/LeadConsumerService/"
  8.     xmlns:s="http://www.w3.org/2001/XMLSchema"
  9.     xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
  10.     xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
  11.     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  12.     targetNamespace="http://www.paaleads.com/LeadConsumerService/">
  13.  
  14.       <wsdl:types>
  15.         <s:schema elementFormDefault="qualified" targetNamespace="http://www.paaleads.com/LeadConsumerService/">
  16.               <s:element name="ConsumeLead">
  17.                 <s:complexType>
  18.                       <s:sequence>
  19.                         <s:element minOccurs="0" maxOccurs="1" name="request" type="tns:ConsumeLeadRequest" />
  20.                       </s:sequence>
  21.                 </s:complexType>
  22.               </s:element>
  23.               <s:complexType name="ConsumeLeadRequest">
  24.                 <s:sequence>
  25.                       <s:element minOccurs="1" maxOccurs="1" name="LeadType" type="tns:LeadType" />
  26.                       <s:element minOccurs="0" maxOccurs="1" name="LeadXml" type="s:string" />
  27.                       <s:element minOccurs="0" maxOccurs="1" name="AuthenticationUsername" type="s:string" />
  28.                       <s:element minOccurs="0" maxOccurs="1" name="AuthenticationPassword" type="s:string" />
  29.                 </s:sequence>
  30.               </s:complexType>
  31.               <s:simpleType name="LeadType">
  32.                 <s:restriction base="s:string">
  33.                       <s:enumeration value="Unknown" />
  34.                       <s:enumeration value="Mortgage" />
  35.                       <s:enumeration value="TermAssurance" />
  36.                       <s:enumeration value="Travel" />
  37.                       <s:enumeration value="PMI" />
  38.                       <s:enumeration value="SecuredLoan" />
  39.                       <s:enumeration value="CreditHelp" />
  40.                       <s:enumeration value="Stakeholder" />
  41.                       <s:enumeration value="TermPostal" />
  42.                       <s:enumeration value="Pension" />
  43.                       <s:enumeration value="Savings" />
  44.                       <s:enumeration value="Investments" />
  45.                       <s:enumeration value="UnsecuredLoan" />
  46.                       <s:enumeration value="OverseasMortgage" />
  47.                       <s:enumeration value="Debt" />
  48.                       <s:enumeration value="ASU" />
  49.                       <s:enumeration value="LegalServices" />
  50.                 </s:restriction>
  51.               </s:simpleType>
  52.               <s:element name="ConsumeLeadResponse">
  53.                 <s:complexType>
  54.                       <s:sequence>
  55.                         <s:element minOccurs="0" maxOccurs="1" name="ConsumeLeadResult" type="tns:ConsumeLeadResponse" />
  56.                       </s:sequence>
  57.                 </s:complexType>
  58.               </s:element>
  59.               <s:complexType name="ConsumeLeadResponse">
  60.                 <s:sequence>
  61.                       <s:element minOccurs="1" maxOccurs="1" name="LeadReceived" type="s:boolean" />
  62.                       <s:element minOccurs="0" maxOccurs="1" name="FailureMessage" type="s:string" />
  63.                 </s:sequence>
  64.               </s:complexType>
  65.         </s:schema>
  66.       </wsdl:types>
  67.     <wsdl:message name="ConsumeLeadSoapIn">
  68.         <wsdl:part name="parameters" element="tns:ConsumeLead" />
  69.       </wsdl:message>
  70.       <wsdl:message name="ConsumeLeadSoapOut">
  71.         <wsdl:part name="parameters" element="tns:ConsumeLeadResponse" />
  72.       </wsdl:message>
  73.  
  74.       <wsdl:portType name="LeadConsumerServiceSoap">
  75.         <wsdl:operation name="ConsumeLead">
  76.               <wsdl:input message="tns:ConsumeLeadSoapIn" />
  77.               <wsdl:output message="tns:ConsumeLeadSoapOut" />
  78.         </wsdl:operation>
  79.       </wsdl:portType>
  80.  
  81.       <wsdl:binding name="LeadConsumerServiceSoap" type="tns:LeadConsumerServiceSoap">
  82.         <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
  83.         <wsdl:operation name="ConsumeLead">
  84.               <soap:operation soapAction="http://www.paaleads.com/LeadConsumerService/ConsumeLead" style="document" />
  85.               <wsdl:input>
  86.                 <soap:body use="literal" />
  87.               </wsdl:input>
  88.               <wsdl:output>
  89.                 <soap:body use="literal" />
  90.               </wsdl:output>
  91.         </wsdl:operation>
  92.       </wsdl:binding>
  93.       <wsdl:binding name="LeadConsumerServiceSoap12" type="tns:LeadConsumerServiceSoap">
  94.         <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
  95.         <wsdl:operation name="ConsumeLead">
  96.               <soap12:operation soapAction="http://www.paaleads.com/LeadConsumerService/ConsumeLead" style="document" />
  97.               <wsdl:input>
  98.                 <soap12:body use="literal" />
  99.               </wsdl:input>
  100.               <wsdl:output>
  101.                 <soap12:body use="literal" />
  102.               </wsdl:output>
  103.         </wsdl:operation>
  104.       </wsdl:binding>
  105.       <wsdl:service name="LeadConsumerService">
  106.         <wsdl:port name="LeadConsumerServiceSoap" binding="tns:LeadConsumerServiceSoap">
  107.               <soap:address location="http://localhost:8080/dealdirectfinancial.co.uk/paaleads/PAALeadServer.php" />
  108.         </wsdl:port>
  109.         <wsdl:port name="LeadConsumerServiceSoap12" binding="tns:LeadConsumerServiceSoap12">
  110.               <soap12:address location="http://localhost:8080/dealdirectfinancial.co.uk/paaleads/PAALeadServer.php" />
  111.         </wsdl:port>
  112.       </wsdl:service>
  113. </wsdl:definitions>
  114.  
At the moment I can get my input to pass the wsdl, but I can't seem to pass a response back.
My server code looks like this:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. # PAALeadServer.php
  3. # SiteWeavers Web Solutions (http:www.siteweavers.co.uk)
  4. #
  5.  
  6. function ConsumeLead($data) 
  7.  
  8.     $response =
  9.         array(
  10.             'ConsumeLeadResponse' =>
  11.                 array(
  12.                     'ConsumeLeadResult' =>
  13.                         array(
  14.                                'LeadReceived' => 'true'
  15.                         )
  16.                 )
  17.             );
  18.    return $response;
  19. }
  20.  
  21. ini_set("soap.wsdl_cache_enabled", "0");
  22. $server = new SoapServer("http://localhost:8080/dealdirectfinancial.co.uk/paaleads/LeadConsumerService.wsdl");
  23. $server->addFunction("ConsumeLead");
  24.  
  25. $server->handle();
  26. ?>
  27.  
My client like this:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3.    $leadType = 'Mortgage';
  4.  
  5.    $leadXML = '
  6.     &lt;ns1:LeadAssigned xmlns:ns1="http://PAA.LeadDelivery.Generic.Schemas.LeadAssigned" xmlns:ns0="http://PAA.LeadDelivery.Generic.Schemas.Lead" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  7.         &lt;ns0:Lead&gt;
  8.             &lt;Reference&gt;
  9.                 1234
  10.             &lt;/Reference&gt;
  11.             &lt;Product&gt;
  12.                 &lt;Mnemonic&gt;
  13.                     Mortgage
  14.                 &lt;/Mnemonic&gt;
  15.                 &lt;Description&gt;
  16.                     Mortgage Leads
  17.                 &lt;/Description&gt;
  18.                 &lt;SubType&gt;
  19.                     Other
  20.                 &lt;/SubType&gt;
  21.             &lt;/Product&gt;
  22.             &lt;ExtendedInfo&gt;
  23.                 &lt;Mortgage&gt;
  24.                     &lt;MortgageValue&gt;
  25.                         75000
  26.                     &lt;/MortgageValue&gt;
  27.                     &lt;MortgageValueLowerBound&gt;
  28.                         1
  29.                     &lt;/MortgageValueLowerBound&gt;
  30.                     &lt;MortgageValueUpperBound&gt;
  31.                         500
  32.                     &lt;/MortgageValueUpperBound&gt;
  33.                     &lt;PropertyValue&gt;
  34.                         100000
  35.                     &lt;/PropertyValue&gt;
  36.                     &lt;PropertyValueLowerBound&gt;
  37.                         1
  38.                     &lt;/PropertyValueLowerBound&gt;
  39.                     &lt;PropertyValueUpperBound&gt;
  40.                         500
  41.                     &lt;/PropertyValueUpperBound&gt;
  42.                     &lt;Adverse&gt;
  43.                         false
  44.                     &lt;/Adverse&gt;
  45.                     &lt;FirstTime&gt;
  46.                         false
  47.                     &lt;/FirstTime&gt;
  48.                 &lt;/Mortgage&gt;
  49.             &lt;/ExtendedInfo&gt;
  50.             &lt;Applicants&gt;
  51.                 &lt;Applicant1&gt;
  52.                     &lt;Title&gt;
  53.                         Mr
  54.                     &lt;/Title&gt;
  55.                     &lt;Forename&gt;
  56.                         SampleForename
  57.                     &lt;/Forename&gt;
  58.                     &lt;Surname&gt;
  59.                         SampleSurname
  60.                     &lt;/Surname&gt;
  61.                     &lt;DateOfBirth&gt;
  62.                         1903-02-01
  63.                     &lt;/DateOfBirth&gt;
  64.                     &lt;Smoker&gt;
  65.                         false
  66.                     &lt;/Smoker&gt;
  67.                     &lt;TelephoneNumbers&gt;
  68.                         &lt;TelephoneNumber&gt;
  69.                             &lt;Number&gt;
  70.                                 01244123456
  71.                             &lt;/Number&gt;
  72.                             &lt;Type&gt;
  73.                                 Mobile
  74.                             &lt;/Type&gt;
  75.                         &lt;/TelephoneNumber&gt;
  76.                     &lt;/TelephoneNumbers&gt;
  77.                     &lt;EmailAddresses&gt;
  78.                         &lt;EmailAddress&gt;
  79.                             &lt;Email&gt;
  80.                                 test@moneysupermarket.com
  81.                             &lt;/Email&gt;
  82.                             &lt;Type&gt;
  83.                                 Business
  84.                             &lt;/Type&gt;
  85.                         &lt;/EmailAddress&gt;
  86.                     &lt;/EmailAddresses&gt;
  87.                     &lt;Addresses&gt;
  88.                         &lt;Address&gt;
  89.                             &lt;Street&gt;
  90.                                 Sample Street
  91.                             &lt;/Street&gt;
  92.                             &lt;District&gt;
  93.                                 Sample District
  94.                             &lt;/District&gt;
  95.                             &lt;Town&gt;
  96.                                 Sample Town
  97.                             &lt;/Town&gt;
  98.                             &lt;County&gt;
  99.                                 Sample County
  100.                             &lt;/County&gt;
  101.                             &lt;Postcode&gt;
  102.                                 CH53UZ
  103.                             &lt;/Postcode&gt;
  104.                             &lt;Type&gt;
  105.                                 Home
  106.                             &lt;/Type&gt;
  107.                         &lt;/Address&gt;
  108.                     &lt;/Addresses&gt;
  109.                 &lt;/Applicant1&gt;
  110.             &lt;/Applicants&gt;
  111.         &lt;/ns0:Lead&gt;
  112.         &lt;Assignment&gt;
  113.             &lt;Price&gt;
  114.                 20
  115.             &lt;/Price&gt;
  116.             &lt;AssignmentDateTime&gt;
  117.                 2010-02-01T00:00:00
  118.             &lt;/AssignmentDateTime&gt;
  119.             &lt;Subscription&gt;
  120.                 &lt;Reference&gt;
  121.                     1234
  122.                 &lt;/Reference&gt;
  123.                 &lt;Subscriber&gt;
  124.                     &lt;Title&gt;
  125.                         Mr
  126.                     &lt;/Title&gt;
  127.                     &lt;Forename&gt;
  128.                         SampleForename
  129.                     &lt;/Forename&gt;
  130.                     &lt;Surname&gt;
  131.                         SampleSurname
  132.                     &lt;/Surname&gt;
  133.                 &lt;/Subscriber&gt;
  134.             &lt;/Subscription&gt;
  135.             &lt;Account&gt;
  136.                 &lt;Reference&gt;
  137.                     1234
  138.                 &lt;/Reference&gt;
  139.                 &lt;CompanyName&gt;
  140.                     Sample Company
  141.                 &lt;/CompanyName&gt;
  142.             &lt;/Account&gt;
  143.             &lt;LeadType&gt;
  144.                 SampleLeadType
  145.             &lt;/LeadType&gt;
  146.             &lt;TerritoryName&gt;
  147.                 UNITED KINGDOM
  148.             &lt;/TerritoryName&gt;
  149.         &lt;/Assignment&gt;
  150.     &lt;/ns1:LeadAssigned&gt;
  151.     ';
  152.  
  153.     $server = "http://localhost:8080/dealdirectfinancial.co.uk/paaleads/";
  154.     $wsdl = $server . "LeadConsumerService.wsdl";
  155.  
  156.     try {
  157.            $client = new SoapClient($wsdl,
  158.               array("trace"=>1,"exceptions"=>1));
  159.  
  160.  
  161.         ob_start();
  162.         var_dump($client->__getFunctions());
  163.         $dump = ob_get_contents();
  164.         ob_end_clean();
  165.  
  166.            printf("<br />Dumping client object functions:<br /><pre>%s</pre>", $dump);
  167.  
  168.            // Create the parameters
  169.  
  170.         $params =
  171.             array(
  172.                 'ConsumeLead' =>
  173.                     array( 'request' =>
  174.                         array(
  175.                             "LeadType" => $leadType,
  176.                             "LeadXml" => $leadXML,
  177.                             "AuthenticationUsername" => 'dealdirectfinancial',
  178.                             "AuthenticationPassword" => 'opensesame'
  179.                         )
  180.                     )
  181.                 );
  182.         //$params = array(new SoapParam($params, 'ConsumeLeadRequest'));
  183.  
  184.            // Make the call to the service
  185.         #$result = $client->ConsumeLead($params);
  186.         $result = $client->__soapCall('ConsumeLead', $params);
  187.  
  188.         // Print the result
  189.         printf("Printing the response: <br /><br />");
  190.         print_r($result->ConsumeLeadResponse);
  191.  
  192.     } catch (SoapFault $e) {
  193.         echo "Error: {$e->faultstring}";
  194.     }
  195. // display what was sent to the server (the request)
  196. printf("Request: %s <br />", htmlspecialchars($client->__getLastRequest()));
  197. // display what came back from the server (the response)
  198. printf("Response: %s <br />", htmlspecialchars($client->__getLastResponse()));
  199. ?>
  200.  
The output I see shows the request xml gets generated correctly, but the response xml just has a closing tag for the output parameters and the php debugger shows
Expand|Select|Wrap|Line Numbers
  1.  $result: object(stdClass) = 
ie. the result appears to be an empty object of stdClass.
The output is as follows:
Expand|Select|Wrap|Line Numbers
  1. Dumping client object functions:
  2.  
  3. array(2) {
  4.   [0]=>
  5.   string(56) "ConsumeLeadResponse ConsumeLead(ConsumeLead $parameters)"
  6.   [1]=>
  7.   string(56) "ConsumeLeadResponse ConsumeLead(ConsumeLead $parameters)"
  8. }
  9.  
  10. Printing the response:
  11.  
  12. Request: <?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:ConsumeLead><ns1:request><ns1:LeadType>Mortgage</ns1:LeadType><ns1:LeadXml>
  13.  &amp;lt;ns1:LeadAssigned xmlns:ns1="http://PAA.LeadDelivery.Generic.Schemas.LeadAssigned" xmlns:ns0="http://PAA.LeadDelivery.Generic.Schemas.Lead" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&amp;gt;
  14.  &amp;lt;ns0:Lead&amp;gt;
  15.  &amp;lt;Reference&amp;gt;
  16.  1234
  17.  &amp;lt;/Reference&amp;gt;
  18.  &amp;lt;Product&amp;gt;
  19.  &amp;lt;Mnemonic&amp;gt;
  20.  Mortgage
  21.  &amp;lt;/Mnemonic&amp;gt;
  22.  &amp;lt;Description&amp;gt;
  23.  Mortgage Leads
  24.  &amp;lt;/Description&amp;gt;
  25.  &amp;lt;SubType&amp;gt;
  26.  Other
  27.  &amp;lt;/SubType&amp;gt;
  28.  &amp;lt;/Product&amp;gt;
  29.  &amp;lt;ExtendedInfo&amp;gt;
  30.  &amp;lt;Mortgage&amp;gt;
  31.  &amp;lt;MortgageValue&amp;gt;
  32.  75000
  33.  &amp;lt;/MortgageValue&amp;gt;
  34.  &amp;lt;MortgageValueLowerBound&amp;gt;
  35.  1
  36.  &amp;lt;/MortgageValueLowerBound&amp;gt;
  37.  &amp;lt;MortgageValueUpperBound&amp;gt;
  38.  500
  39.  &amp;lt;/MortgageValueUpperBound&amp;gt;
  40.  &amp;lt;PropertyValue&amp;gt;
  41.  100000
  42.  &amp;lt;/PropertyValue&amp;gt;
  43.  &amp;lt;PropertyValueLowerBound&amp;gt;
  44.  1
  45.  &amp;lt;/PropertyValueLowerBound&amp;gt;
  46.  &amp;lt;PropertyValueUpperBound&amp;gt;
  47.  500
  48.  &amp;lt;/PropertyValueUpperBound&amp;gt;
  49.  &amp;lt;Adverse&amp;gt;
  50.  false
  51.  &amp;lt;/Adverse&amp;gt;
  52.  &amp;lt;FirstTime&amp;gt;
  53.  false
  54.  &amp;lt;/FirstTime&amp;gt;
  55.  &amp;lt;/Mortgage&amp;gt;
  56.  &amp;lt;/ExtendedInfo&amp;gt;
  57.  &amp;lt;Applicants&amp;gt;
  58.  &amp;lt;Applicant1&amp;gt;
  59.  &amp;lt;Title&amp;gt;
  60.  Mr
  61.  &amp;lt;/Title&amp;gt;
  62.  &amp;lt;Forename&amp;gt;
  63.  SampleForename
  64.  &amp;lt;/Forename&amp;gt;
  65.  &amp;lt;Surname&amp;gt;
  66.  SampleSurname
  67.  &amp;lt;/Surname&amp;gt;
  68.  &amp;lt;DateOfBirth&amp;gt;
  69.  1903-02-01
  70.  &amp;lt;/DateOfBirth&amp;gt;
  71.  &amp;lt;Smoker&amp;gt;
  72.  false
  73.  &amp;lt;/Smoker&amp;gt;
  74.  &amp;lt;TelephoneNumbers&amp;gt;
  75.  &amp;lt;TelephoneNumber&amp;gt;
  76.  &amp;lt;Number&amp;gt;
  77.  01244123456
  78.  &amp;lt;/Number&amp;gt;
  79.  &amp;lt;Type&amp;gt;
  80.  Mobile
  81.  &amp;lt;/Type&amp;gt;
  82.  &amp;lt;/TelephoneNumber&amp;gt;
  83.  &amp;lt;/TelephoneNumbers&amp;gt;
  84.  &amp;lt;EmailAddresses&amp;gt;
  85.  &amp;lt;EmailAddress&amp;gt;
  86.  &amp;lt;Email&amp;gt;
  87.  test@moneysupermarket.com
  88.  &amp;lt;/Email&amp;gt;
  89.  &amp;lt;Type&amp;gt;
  90.  Business
  91.  &amp;lt;/Type&amp;gt;
  92.  &amp;lt;/EmailAddress&amp;gt;
  93.  &amp;lt;/EmailAddresses&amp;gt;
  94.  &amp;lt;Addresses&amp;gt;
  95.  &amp;lt;Address&amp;gt;
  96.  &amp;lt;Street&amp;gt;
  97.  Sample Street
  98.  &amp;lt;/Street&amp;gt;
  99.  &amp;lt;District&amp;gt;
  100.  Sample District
  101.  &amp;lt;/District&amp;gt;
  102.  &amp;lt;Town&amp;gt;
  103.  Sample Town
  104.  &amp;lt;/Town&amp;gt;
  105.  &amp;lt;County&amp;gt;
  106.  Sample County
  107.  &amp;lt;/County&amp;gt;
  108.  &amp;lt;Postcode&amp;gt;
  109.  CH53UZ
  110.  &amp;lt;/Postcode&amp;gt;
  111.  &amp;lt;Type&amp;gt;
  112.  Home
  113.  &amp;lt;/Type&amp;gt;
  114.  &amp;lt;/Address&amp;gt;
  115.  &amp;lt;/Addresses&amp;gt;
  116.  &amp;lt;/Applicant1&amp;gt;
  117.  &amp;lt;/Applicants&amp;gt;
  118.  &amp;lt;/ns0:Lead&amp;gt;
  119.  &amp;lt;Assignment&amp;gt;
  120.  &amp;lt;Price&amp;gt;
  121.  20
  122.  &amp;lt;/Price&amp;gt;
  123.  &amp;lt;AssignmentDateTime&amp;gt;
  124.  2010-02-01T00:00:00
  125.  &amp;lt;/AssignmentDateTime&amp;gt;
  126.  &amp;lt;Subscription&amp;gt;
  127.  &amp;lt;Reference&amp;gt;
  128.  1234
  129.  &amp;lt;/Reference&amp;gt;
  130.  &amp;lt;Subscriber&amp;gt;
  131.  &amp;lt;Title&amp;gt;
  132.  Mr
  133.  &amp;lt;/Title&amp;gt;
  134.  &amp;lt;Forename&amp;gt;
  135.  SampleForename
  136.  &amp;lt;/Forename&amp;gt;
  137.  &amp;lt;Surname&amp;gt;
  138.  SampleSurname
  139.  &amp;lt;/Surname&amp;gt;
  140.  &amp;lt;/Subscriber&amp;gt;
  141.  &amp;lt;/Subscription&amp;gt;
  142.  &amp;lt;Account&amp;gt;
  143.  &amp;lt;Reference&amp;gt;
  144.  1234
  145.  &amp;lt;/Reference&amp;gt;
  146.  &amp;lt;CompanyName&amp;gt;
  147.  Sample Company
  148.  &amp;lt;/CompanyName&amp;gt;
  149.  &amp;lt;/Account&amp;gt;
  150.  &amp;lt;LeadType&amp;gt;
  151.  SampleLeadType
  152.  &amp;lt;/LeadType&amp;gt;
  153.  &amp;lt;TerritoryName&amp;gt;
  154.  UNITED KINGDOM
  155.  &amp;lt;/TerritoryName&amp;gt;
  156.  &amp;lt;/Assignment&amp;gt;
  157.  &amp;lt;/ns1:LeadAssigned&amp;gt;
  158.  </ns1:LeadXml><ns1:AuthenticationUsername>dealdirectfinancial</ns1:AuthenticationUsername><ns1:AuthenticationPassword>opensesame</ns1:AuthenticationPassword></ns1:request></ns1:ConsumeLead></SOAP-ENV:Body></SOAP-ENV:Envelope>
  159. 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/></SOAP-ENV:Body></SOAP-ENV:Envelope> 
  160.  
I cannot figure out how to build the response as a nested array that matches the wsdl. Can anyone help?
Oct 5 '10 #1

✓ answered by nickweavers

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:

function ConsumeLead($data)

$response =
array('ConsumeLeadResult' =>
array(
'LeadReceived' => 'true'
)
);

return $response;
}
The response is now working:
Expand|Select|Wrap|Line Numbers
  1. 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> 
  2.  
That only took me 4 hours to solve using the Monte Carlo problem solving technique ;)

1 2989
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:

function ConsumeLead($data)

$response =
array('ConsumeLeadResult' =>
array(
'LeadReceived' => 'true'
)
);

return $response;
}
The response is now working:
Expand|Select|Wrap|Line Numbers
  1. 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> 
  2.  
That only took me 4 hours to solve using the Monte Carlo problem solving technique ;)
Oct 6 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: simon | last post by:
Hello All, I have an ASP application that works perfectly on our development server, but when we moved the app to our test server, I got the following error message at the line where I do...
1
by: Karl | last post by:
I'm trying to learn an acceptable way to marshal complex data between an ASP.NET web service and an ASP.NET web client. Initially, it will be enough for the client to display the data from the...
0
by: Morten Overgaard | last post by:
Hi (Sorry for the cross-posting) We are developing a SOAPService which has its types defines in different XSDs like CommonTypes.xsd (namespace http:/MyNamespace/commonTypes -ComplexTypeA...
3
by: kevin | last post by:
Is that even possible? I am creating a web service in .NET to expose some already created .NET programs to other groups. One group is writing the client in PERL, and thus wishes the wsdl schema...
3
by: Arpan | last post by:
Web Services make use of proxy classes whose methods & properties are accessed in exactly the same way as how a normal class' methods & properties are accessed. So what for does ASP.NET generate...
9
by: Cesar | last post by:
Hello there, A java programmer sent me a wsdl file, which I have to use to consume his web methods. When I run the wsld.exe tool to generate the class' code, I get the following message: ...
4
by: matt | last post by:
hello, so from time to time i have to write code to send a file or a stream back to the end user. in my mini library i have code to do so. however, some of the Response object properties arent...
3
by: axel_johard | last post by:
Hi, need some help with creating a WSDL file. I will try to summarize the problem like this: I need to create a wsdl that accepts a response that has no namespace- prefix in the first line in...
1
by: javajavajava | last post by:
Hi every body, can anyone give me a sample for converting WSDL file with XSLT to html format? can you give me both WSD file sample and XSLT file? Best, javajavajava
1
by: =?Utf-8?B?WmFncmViTWlrZQ==?= | last post by:
There is probably a simple answer to this, but I'm a bit of a newby. I have a couple of complex XSDs that I need to use to define the format of the request and response messages in a SOAP/HTTP web...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.