Premature end of data tag line 2

  • mika34


    I try to reproduce examples  of this tutorial but I have errors during script execution. I use Ubuntu 10.10 with libnusoap-php distribution's package. There are 2 scripts in the tutorial : stockserver.php and stockclient.php. Stockserver seem to work because I can see the lila box on my web page :
    On the other hand, nothing appears when I click on 'WSDL' link but I can see it in firebug and it seems to be not correctly written because of the carriage return on line 2 (after xsd:schema targetNamespace="urn:stockquote):

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <definitions xmlns:SOAP-ENV="" xmlns:xsd="" xmlns:xsi="" xmlns:SOAP-ENC="" xmlns:tns="urn:stockquote" xmlns:soap="" xmlns:wsdl="" xmlns="" targetNamespace="urn:stockquote">
    <xsd:schema targetNamespace="urn:stockquote"
     <xsd:import namespace="" />
     <xsd:import namespace="" />
    <message name="getStockQuoteRequest">
      <part name="symbol" type="xsd:string" /></message>
    <message name="getStockQuoteResponse">
      <part name="return" type="xsd:decimal" /></message>
    <portType name="stockserverPortType">
      <operation name="getStockQuote">
        <documentation>Get stock quote</documentation>
        <input message="tns:getStockQuoteRequest"/>
        <output message="tns:getStockQuoteResponse"/>
    <binding name="stockserverBinding" type="tns:stockserverPortType">
      <soap:binding style="rpc" transport=""/>
      <operation name="getStockQuote">
        <soap:operation soapAction="urn:stockquote#getStockQuote" style="rpc"/>
        <input><soap:body use="encoded" namespace="urn:stockqote" encodingStyle=""/></input>
        <output><soap:body use="encoded" namespace="urn:stockqote" encodingStyle=""/></output>
    <service name="stockserver">
      <port name="stockserverPort" binding="tns:stockserverBinding">
        <soap:address location="http://localhost/private/soaptest1/stockserver.php"/>

    So when I run the client script of the tutorial (you can see it in…AP-with-PHP/5/) I have a server error with this explanation in Apache error logs :

       PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost/private/soaptest1/stockserver.php' : Premature end of data in tag html line 2\n in /media/www-dev/private/soaptest1/stockclient.php on line 4
       PHP Fatal error: Uncaught SoapFault exception:  SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost/private/soaptest1/stockserver.php' : Premature end of data in tag html line 2\n in /media/www-dev/private/soaptest1/stockclient.php:4\nStack trace:\n#0 /media/www-dev/private/soaptest1/stockclient.php(4): SoapClient->SoapClient('http://localhos…')\n#1 {main}\n thrown in /media/www-dev/private/soaptest1/stockclient.php on line 4

    Does anyon knows why ? Thanks for your answers