我有一个小型SOAP应用程序,通常在每台服务器上都能正常工作。现在我将它安装在PHP / 5.5.9-1ubuntu4.14上,并在结果前面添加换行符。 我的相应系统无法解析错误的xml并生成错误:
The XML or Text declaration must start at line/column 1/1
我现在绝对想知道为什么。 任何人都可以帮助我,或者有人有任何线索吗?
代码: 基本上我用:
$server = new SoapServer ( "somewsdl.wsdl" );
$server->setClass ( "soapserver_bla" );
$server->handle ();
在soapserver_bla类中有相应的方法:
public function testConnection()
{
return 'success';
}
WSDL:
<?xml version="1.0" encoding="UTF-8" ?>
<definitions name="TOPIX" targetNamespace="http://www.4d.com/namespace/default" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.4d.com/namespace/default" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<types>
<schema targetNamespace="http://www.4d.com/namespace/default" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<complexType name="ArrayOfstring" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<complexContent>
<restriction base="SOAP-ENC:Array">
<attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ArrayOffloat" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<complexContent>
<restriction base="SOAP-ENC:Array">
<attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:float[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ArrayOfint" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<complexContent>
<restriction base="SOAP-ENC:Array">
<attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:int[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ArrayOfboolean" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<complexContent>
<restriction base="SOAP-ENC:Array">
<attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:boolean[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ArrayOfdate" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<complexContent>
<restriction base="SOAP-ENC:Array">
<attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:date[]"/>
</restriction>
</complexContent>
</complexType>
</schema>
</types>
<message name="testConnection_Request">
</message>
<message name="testConnection_Response">
<part name="balbla" type="xsd:string"/>
</message> <portType name="SomePort">
<operation name="testConnection">
<input message="tns:testConnection_Request"/>
<output message="tns:testConnection_Response"/>
</operation>
</portType>
<binding name="SomeBinding" type="tns:SomeType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" /> <operation name="testConnection">
<documentation>no documentation is available</documentation> <soap:operation soapAction="testConnection"/>
<input>
<soap:body use="encoded" namespace="http://www.4d.com/namespace/default" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="http://www.4d.com/namespace/default" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output>
</operation>
AND SO ON...