capdragon
capdragon

Reputation: 14899

asmx page is blank but WebService is working

I have a asmx WebService that works perfectly but returns a blank page when I browse to it in a browser.

When I browse to the search.asmx file I don't get the usual html format description of the service with the testing form that allows you to invoke the service. All I get is a completely blank page. (view source returns nothing).

This happens both on localhost (casini) and on the server (IIS 7.5).

Is there a way I can turn this on?

My web.config looks like this:

  ...
  <system.web>
    <httpRuntime requestValidationMode="2.0" enableKernelOutputCache="false"/>
    <webServices>
      <protocols>
        <add name="HttpGet"/>
        <add name="HttpPost"/>
      </protocols>
    </webServices>
    ...

My Service looks something like this:

...
[WebService(Namespace = "http://mydomain.edu/something")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

[System.Web.Script.Services.ScriptService]
public class SearchService : System.Web.Services.WebService {

    public SearchService() {

    }

    [WebMethod(EnableSession = true)]
    [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
    public SearchResponse Search(SearchFilter filter)
    {
...

Update:

When I navigate to the wsdl search.asmx?wsdl I get an error:

System.InvalidOperationException: Method Search can not be reflected. ---> System.InvalidOperationException: There was an error reflecting 'SearchResult'. ---> System.InvalidOperationException: There was an error reflecting type 'SearchResponse'. ---> System.InvalidOperationException: There was an error reflecting property 'attributes'. ---> System.InvalidOperationException: There was an error reflecting type 'USpaceDataAttributes'. ---> System.NotSupportedException: Cannot serialize member USpaceDataAttributes.attributes of type System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[SimpleTypeData, Entities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], because it implements IDictionary.

I'm pretty sure this why I'm getting a blank page.

Upvotes: 0

Views: 1673

Answers (1)

John Saunders
John Saunders

Reputation: 161821

Try

<add name="Documentation"/>

Upvotes: 2

Related Questions