2011-09-21 111 views
1

我有WCF服務。 當我嘗試從.NET頁面訪問它時,一切正常。但是我找不到從php腳本訪問它的方法。無法從php腳本調用WCF服務方法

<system.serviceModel> 
<bindings> 
    <wsHttpBinding> 
    <binding name="NewBinding0"> 
     <reliableSession inactivityTimeout="01:00:00" /> 
     <security mode="TransportWithMessageCredential"> 
     <transport clientCredentialType="Basic" /> 
     <message clientCredentialType="UserName" /> 
     </security> 

    </binding> 
    </wsHttpBinding> 
</bindings> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="RegisterBehavior"> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
     <serviceMetadata httpsGetEnabled="true" /> 
     <serviceThrottling maxConcurrentCalls="48" maxConcurrentSessions="5000" 
     maxConcurrentInstances="5000" /> 
     <serviceCredentials> 
     <userNameAuthentication userNamePasswordValidationMode="Custom" 
      customUserNamePasswordValidatorType="..." 
      cacheLogonTokens="true" cachedLogonTokenLifetime="01:00:00" /> 
     </serviceCredentials> 
    </behavior> 
    <behavior name=""> 
     <serviceMetadata httpGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="false" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<services> 
    <service behaviorConfiguration="RegisterBehavior" name="Riepas.WCFRiepas"> 
    <endpoint address="..." 
     binding="wsHttpBinding" bindingConfiguration="NewBinding0" contract="..."> 

    </endpoint> 
    <endpoint address="mex" binding="mexHttpsBinding" name="mex" 
     contract="IMetadataExchange"> 

    </endpoint> 
    </service> 
</services> 
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" 
/> 

試圖從PHP連接,但它只是掛起。 :(

$client = new SoapClient("wsdl", array(
              'login' => "...", 
              'password' => "...", 
              'soap_version' => SOAP_1_2)); 
              $functions = $client->__getFunctions(); 
var_dump ($functions); 

$parameters = array("ReqVal" => "nu?"); 
//$result = $client->__soapCall("GetStr", $parameters); 
//$result = $client->GetStr($parameters); 

函數返回normaly。

回答