Take the 2-minute tour ×

I'm developing a simple wcf service and trying to expose it as Soap for compatibility reasons: the client will be a flash application with its nice actionscript.

I am obviously using basicHttpBinding to generate soap compatible WSDL.

Here follows my configuration (anonymized of sensitive data of course):

    <binding name="soapBinding" />
  <service behaviorConfiguration="BasicBehavior" name="MyCustomer.MyProject.WebService.MyService">
    <endpoint address="mex" binding="mexHttpBinding" name="mex" contract="IMetadataExchange" />
    <endpoint binding="basicHttpBinding" bindingConfiguration="soapBinding"
      name="Basic" bindingNamespace="http://myurl"
        <add baseAddress="http://myurl" />
    <behavior name="BasicBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />

It's quite simple really. Now the guy developing the flash application states that he has some troubles, that he sees the only method present (called ValidateForm) but he doesn't see the parameter list.

I tried the following:

  • Calling the webservice using storm (storm.codeplex.com): careful: storm and not wcf storm. Storm only works with normal webservices, it can't connect in native WCF mode. This works fine. I see parameters, can fill them, invoke and receive the correct response.
  • Calling the service with http://soapclient.com/soaptest.html : this reads my wsdl, sees the parameters list, but when invoking an "unexpected error" occurs.
  • Calling the webservice with http://www.validwsdl.com/ : this reads the wsdl but it doesn't see the parameter list at all, and the invoke fails.

There's obviously something wrong with my service. Here follows the WSDL, maybe someone can tell me what's wrong (again anonymized):

    <wsdl:definitions name="mycustomermyprojectService" targetNamespace="http://www1.myproject.mydomain.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://www1.myproject.mydomain.com" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
    <xsd:schema targetNamespace="http://www1.myproject.mydomain.com/Imports">
      <xsd:import schemaLocation="http://www1.myproject.mydomain.com/?xsd=xsd0" namespace="http://www1.myproject.mydomain.com"/>
      <xsd:import schemaLocation="http://www1.myproject.mydomain.com/?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
      <xsd:import schemaLocation="http://www1.myproject.mydomain.com/?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/mycustomer.myproject.WebService.Models"/>
  <wsdl:message name="ImycustomermyprojectService_ValidateForm_InputMessage">
    <wsdl:part name="parameters" element="tns:ValidateForm"/>
  <wsdl:message name="ImycustomermyprojectService_ValidateForm_OutputMessage">
    <wsdl:part name="parameters" element="tns:ValidateFormResponse"/>
  <wsdl:portType name="ImycustomermyprojectService">
    <wsdl:operation name="ValidateForm">
      <wsdl:input wsaw:Action="http://www1.myproject.mydomain.com/ImycustomermyprojectService/ValidateForm" message="tns:ImycustomermyprojectService_ValidateForm_InputMessage"/>
      <wsdl:output wsaw:Action="http://www1.myproject.mydomain.com/ImycustomermyprojectService/ValidateFormResponse" message="tns:ImycustomermyprojectService_ValidateForm_OutputMessage"/>
  <wsdl:binding name="Basic" type="tns:ImycustomermyprojectService">
    <wsdl:operation name="ValidateForm">
      <soap:operation soapAction="http://www1.myproject.mydomain.com/ImycustomermyprojectService/ValidateForm" style="document"/>
        <soap:body use="literal"/>
        <soap:body use="literal"/>
  <wsdl:service name="mycustomermyprojectService">
    <wsdl:port name="Basic" binding="tns:Basic">
      <soap:address location="http://www1.myproject.mydomain.com/"/>

Anyone can shed some light? Thanks.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

There are scenarios where other platforms dont understand the import attributes and hence we need to flatten our wsdl.

You can find some information on how to flatten your wsdl at the following link

You need to create your own Service host factory that flattens your wsdl as explained in the link. This would be a inbuilt feature going ahead in .NET 4.5 if i am not wrong. The information for that can be found at this link

share|improve this answer
add comment

There are no types directly in this wsdl indeed. They're imported from other locations (e.g. http://www1.myproject.mydomain.com/?xsd=xsd0) in the xsd:import declaration. A parser will have to follow these imports and parse them. I don't know if validWSDL.com does this. I tried it on a service of my own and the error when invoking was:

"No matching 'element' definition found within the element of the WSDL document"

If you're having troubles with some clients you could try to replace the imports with the schemas defined in those files directly. Look here for what wsdl element identifiers look like. Since I've not yet experienced that, I can't guarantee that this is the cause, but you could try that with validwsdl.com and see if it works. Should be easy to test.

share|improve this answer
I kept on investigating, and it really seems like this is the problem. I came across some "Wsdl Flattening" topics regarding interop for WCF. I am still experimenting, and I'll be sure to post a solution to my own problem if I make it. –  Matteo Mosca Oct 19 '11 at 12:10
add comment

Your Answer


