How to use WCF service from PHPclient(SOAP) with HTTPS protocol RRS feed

  • Question

  • User-1666202131 posted

    Hi All,

    I did some WCF service with next web config.

    				<binding name="legacy">					
    					<security mode="Transport" >
    						<transport  clientCredentialType="None"/>						
    				<behavior name="My.Services.WCFBehavior">					
    					<serviceMetadata httpsGetEnabled="true"/>					
    					<serviceDebug includeExceptionDetailInFaults="false"/>					
    				<behavior name="WebBehavior">
    					<webHttp />
    			<service behaviorConfiguration="My.Services.WCFBehavior"
    				<endpoint address=""
    						contract="My.Services.WCFService.ISingleSignOnWCFService" />
    				<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    			<service behaviorConfiguration="My.Services.WCFBehavior"
    				<endpoint address=""
    								contract="My.Services.Security.IServiceSecurity" />
    				<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    		<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>

    For IIS 6 I added SSL certificate.

    And when I try use this service from browser I see WSDL by HTTPS  protocol.


    Also I have PHP and Apace server what using 82 port http://localhost:82/soap.php

    In soap.php  I wrote next 

    // $orig_error_reporting = error_reporting();
    // error_reporting(0);
    $soap = new SoapClient("https://localhost/SingleSignOnWCFService.svc?wsdl",
       array('soap_version' => 'SOAP_1_2',
    $start = gettimeofday (TRUE);
    for ($i=1;$i<100;$i++)
    print "1";
    $response = $soap->GetPassword(array('cv_user_email'=>"a305@email.com",'cv_user_password'=>"123456")) ;
    //$response = $soap->__getTypes();
    print $response->GetPasswordResult ;
    print "<br>";
    print gettimeofday(TRUE) - $start;

    But when I try use this http://localhost:82/soap.php url.

    I got error with soap:

    Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://localhost/SingleSignOnWCFService.svc?wsdl' : failed to load external entity "https://localhost/SingleSignOnWCFService.svc?wsdl" in C:\wamp\www\soap.php:7 Stack trace: #0 C:\wamp\www\soap.php(7): SoapClient->SoapClient('https://localho...', Array) #1 {main} thrown in C:\wamp\www\soap.php on line 7

    are someone know how to call WCF  service from PHP with soap correct by using HTTPS ?

    And one more thing without security by HTTP all working !


    Wednesday, September 15, 2010 5:54 AM


  • User-1666202131 posted

    Problem with easy fix:

    SSL was disabled in php.ini :)

    Now all working good. I like WCF Cool 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 15, 2010 11:15 AM