0

嗨,我想创建一个肥皂服务。当我运行它时,服务正常启动,但我无法从 php 连接到它,因为我收到以下错误:

致命错误:第6C:\xampp\htdocs\soaptest\soaptest.php中的最大执行时间超过 30 秒

第 6 行是: $client = new SoapClient('http://localhost:1741/TopicService.svc?wsdl'); 这是我的 web.config

<system.web>
    <compilation debug="true" targetFramework="4.0" />
    <trace enabled="false"/>
    <httpRuntime maxRequestLength="100000000" />
</system.web>

<system.serviceModel>

    <services>
        <service name="PptxToTopicWebService.TopicService">
            <endpoint address="soap" behaviorConfiguration="PptxToTopicWebService.ITopicService" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding1" contract="PptxToTopicWebService.ITopicService" />
        </service>
    </services>
    <behaviors>
        <endpointBehaviors>
            <behavior name="PptxToTopicWebService.ITopicService">
            </behavior>
        </endpointBehaviors>
        <serviceBehaviors>
            <behavior name="">
                <dataContractSerializer maxItemsInObjectGraph="2147483647" />
                <serviceMetadata httpGetEnabled="true"  />
                <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" minFreeMemoryPercentageToActivateService="0" />
    <bindings>
        <basicHttpBinding>
            <binding name="basicHttpBinding1" maxReceivedMessageSize="10000000" maxBufferSize="10000000">
                <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
            </binding>
        </basicHttpBinding>
    </bindings>
</system.serviceModel>

我究竟做错了什么?

4

1 回答 1

0

如下所述修改您的终点。它会起作用的。似乎服务需要更多时间来响应。

<bindings>
                <basicHttpBinding>
                    <binding name="basicHttpBinding1" maxReceivedMessageSize="10000000" maxBufferSize="10000000" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
                        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
                    </binding>
                </basicHttpBinding>
            </bindings>
于 2012-04-06T10:55:47.317 回答