Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/239.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 我需要创建.wsdl文件的帮助-需要多个函数!_Php_Javascript_Web Services - Fatal编程技术网

Php 我需要创建.wsdl文件的帮助-需要多个函数!

Php 我需要创建.wsdl文件的帮助-需要多个函数!,php,javascript,web-services,Php,Javascript,Web Services,我正在尝试创建一个web服务,为此,我阅读了一个很棒的教程,可以在这里找到:。现在,一切正常,但对于我正在开发的服务,我需要在.wsdl文件中定义多个函数。我试图再添加一个函数,但一直收到错误消息。这就是my.wsdl的外观: <?xml version ='1.0' encoding ='UTF-8' ?> <definitions name='Catalog' targetNamespace='http://example.org/catalog' xmlns

我正在尝试创建一个web服务,为此,我阅读了一个很棒的教程,可以在这里找到:。现在,一切正常,但对于我正在开发的服务,我需要在.wsdl文件中定义多个函数。我试图再添加一个函数,但一直收到错误消息。这就是my.wsdl的外观:

<?xml version ='1.0' encoding ='UTF-8' ?> 
<definitions name='Catalog' 
  targetNamespace='http://example.org/catalog' 
  xmlns:tns=' http://example.org/catalog ' 
  xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' 
  xmlns:xsd='http://www.w3.org/2001/XMLSchema' 
  xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' 
  xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' 
  xmlns='http://schemas.xmlsoap.org/wsdl/'> 

<message name='getCatalogRequest'> 
  <part name='catalogId' type='xsd:string'/> 
</message> 
<message name='getCatalogResponse'> 
  <part name='Result' type='xsd:string'/> 
</message> 

<message name='getTestMessageRequest'> 
  <part name='testMessage' type='xsd:string'/> 
</message> 
<message name='getTestMessageResponse'> 
  <part name='resultTestMessage' type='xsd:string'/> 
</message> 


<portType name='CatalogPortType'> 
  <operation name='getCatalogEntry'> 
    <input message='tns:getCatalogRequest'/> 
    <output message='tns:getCatalogResponse'/> 
  </operation> 
  <operation name='getTestMessage'> 
    <input message='tns:getTestMessageRequest'/> 
    <output message='tns:getTestMessageResponse'/> 
  </operation> 
</portType> 



<binding name='CatalogBinding' type='tns:CatalogPortType'> 
  <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> 

  <operation name='getCatalogEntry'> 
    <soap:operation soapAction='urn:localhost-catalog#getCatalogEntry'/> 
    <input> 
      <soap:body use='encoded' namespace='urn:localhost-catalog' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </input> 
    <output> 
      <soap:body use='encoded' namespace='urn:localhost-catalog' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </output> 
  </operation>

  <operation name='getTestMessage'> 
    <soap:operation soapAction='urn:localhost-catalog#getTestMessage'/> 
    <input> 
      <soap:body use='literal'/> 
    </input> 
    <output> 
      <soap:body use='literal'/> 
    </output> 
  </operation> 
</binding> 

<service name='CatalogService'> 
  <port name='CatalogPort' binding='CatalogBinding'> 
    <soap:address location='http://www.thevinylfactory.com.php5-8.dfw1-2.websitetestlink.com/ws/soap-server.php'/> 
  </port> 
</service>

</definitions>

有人能帮我吗?提前谢谢你

好的,我找到了一个解决方案-看起来wsdl文件正在缓存。我发布这个帖子是为了防止其他人遇到类似的问题。您只需在.htaccess文件中添加此行:

php_value soap.wsdl_cache_enabled 0

我已经安装了XAMPP,在哪里可以找到.htaccess文件
<?php  
  $client = new SoapClient("catalog.wsdl");
  $catalogId = 'catalog2';
  $testMessage = "Some Message";
  $response = $client->getCatalogEntry($catalogId);
  $response2 = $client->getTestMessage($testMessage);

  echo $response;
  echo "<br /><br />";
  echo $response2;
?>
[31-Jan-2011 04:30:29] PHP Fatal error:  Uncaught SoapFault exception: [Client] Function ("getTestMessage") is not a valid method for this service in /mnt/stor2-wc2-dfw1/441352/www.thevinylfactory.com/web/content/ws/soap-client.php:6
Stack trace:
#0 [internal function]: SoapClient->__call('getTestMessage', Array)
#1 /mnt/stor2-wc2-dfw1/441352/www.thevinylfactory.com/web/content/ws/soap-client.php(6): SoapClient->getTestMessage('Some Message')
#2 {main}
  thrown in /mnt/stor2-wc2-dfw1/441352/www.thevinylfactory.com/web/content/ws/soap-client.php on line 6
php_value soap.wsdl_cache_enabled 0