We have two instances of the same WCF service, one of which works in Visual Studio 2010 (IIS Express), and the other on the IIS 7 server. We use our own PHP5 SOAP calls to access the Service.
When accessing an instance of Visual Studio, it works without problems. But when we try to access the IIS 7 instance, we get an Uncaught SoapFault exception as follows:
PHP Fatal error: SOAP-ERROR: Parsing Schema: can't import schema from 'http://example.com/WCFService/Service.svc?xsd=xsd0' in C:\\xampp\\htdocs\\synergy_client\\test.php on line 2 PHP Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from 'http://example.com/WCFService/Service.svc?xsd=xsd0' in C:\\xampp\\htdocs\\synergy_client\\test.php:2\nStack trace:\n
PHP code used to access the service:
<?php $client = new SoapClient("[http://]example.com/WCFService/Service.svc?wsdl"); $result2 = $client->LoginAdmin(array('username' => "username",'password' => "password"));
web.conf instance of IIS 7:
<?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" strict="false" explicit="true" targetFramework="4.0"> <assemblies> <add assembly=...../> </assemblies> </compilation> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>
web.conf instance of Visual Studio (which works as expected):
<?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>
As we are new to .Net, we need your help to solve the problem.
Additional information: localhost is replaced by example.com [http: //] for http: //, since I canβt post links.
Edit: This is a script generated wsdl access directly in the browser.
<wsdl:definitions name="Service" targetNamespace="http://tempuri.org/"> <wsdl:types><xsd:schema targetNamespace="http://tempuri.org/Imports"> <xsd:import schemaLocation="http://localhost/WCFService/Service.svc?xsd=xsd0" namespace="http://tempuri.org/"/> <xsd:import schemaLocation="http://localhost/WCFService/Service.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/> <xsd:import schemaLocation="http://localhost/WCFService/Service.svc?xsd=xsd2" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/> </xsd:schema></wsdl:types><wsdl:message name="IService_LoginAdmin_InputMessage"><wsdl:part name="parameters" element="tns:LoginAdmin"/> </wsdl:message> .......