views:

42

answers:

2

I'm attempting to create a process that verifies data within a database and notifies users of errors. My initial thought was to create a web service that is triggered when the user saves the web form. That web service would begin the process of validating the data and populating another table with information about what information it believes is invalid. From the beginning I had intended for this web service to return instantly prior to the actual completition of the data verification. The data verification is going to be a longer process and isn't intended to be form validation. It's also okay if it were to happen to fail since the process will be refreshed every evening also so I’m not concerned about that.

OneWay services seems like the most logical choice for this. I have already written the service and everything is working great without OneWay being present. However the moment I add OneWay the process no longer works. What is particularly puzzling to me is I have a line that outputs a log file at the very beginning of the web service method and it occasionally writes the log when I call the service. Not every time, but sometimes. I also have multiple log statements that get outputted and it has never made it past the first line once isOneWay is enabled. It seems like the code is just being arbitrarily halted. Has anyone ever run into this before? My next option is to create a network queue task that receives the web service call directly and adds it to its queue and I was hoping to avoid doing that.

A bit more background information, I am new to WCF services but not web services in general. The web application is written in ASP.Net and is calling the webservice via HttpGet.

I'm open to other architecture suggestions and any input is greatly appreciated.

Here is the ServiceModel element from the web.config:

        <system.serviceModel>
      <bindings>
        <customBinding>
          <binding name="WebHttpBinding_Service">
            <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
                messageVersion="Soap12" writeEncoding="utf-8">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                  maxBytesPerRead="4096" maxNameTableCharCount="16384" />
            </textMessageEncoding>
            <httpTransport authenticationScheme="Negotiate,Ntlm"/>
          </binding>
        </customBinding>
        <webHttpBinding>
          <binding name="webHttpBinding_IISAuthen">
            <security mode="TransportCredentialOnly">
              <transport clientCredentialType="Windows" />
            </security>
          </binding>
        </webHttpBinding>
      </bindings>
      <services>
        <service name="Namespace.Service" behaviorConfiguration="Namepsace.ServiceBehavior">
          <endpoint address="" behaviorConfiguration="Namespace.ServiceAspNetAjaxBehavior"
           binding="webHttpBinding" bindingConfiguration="webHttpBinding_IISAuthen" contract="Namespace.Service" />
        </service>
      </services>
      <behaviors>
        <endpointBehaviors>
          <behavior name="Namespace.ServiceAspNetAjaxBehavior">
            <enableWebScript />
          </behavior>
        </endpointBehaviors>
        <serviceBehaviors>
          <behavior name="Namespace.ServiceBehavior">
            <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
            <serviceMetadata httpGetEnabled="true" />
            <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
            <serviceDebug includeExceptionDetailInFaults="false" />
          </behavior>
        </serviceBehaviors>
      </behaviors>
      <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
      <client>
        <endpoint binding="customBinding" bindingConfiguration="WebHttpBinding_Service"
            contract="Service" name="WebHttpBinding_Service"  />
      </client>
    </system.serviceModel>
A: 

When running into problems like these in WCF, where something stops working when changing the configuration, I would definitely start by tracing the running service. WCF has a great tracing mechanism which you start by editing the configuration. You can read all about configuring it here.

steinar
Thank you for this information, it will certainly prove to be useful in the future.
Silence Dogood
A: 

I discovered the problem. It may seem odd but the service was being run within the same project and that seemed to be causing the problem with using it as a one way service. I moved it out into its own project everything worked as expected.

I thank everyone for their time, the tracing will certainly prove to be useful in the future.

Silence Dogood