WCF Host ASP.NET Service - WSE 3.0 Client Compatibility

Discussion in 'ASP .Net Web Services' started by Richard Collette, Aug 27, 2007.

  1. My goal is to connect a WSE 3.0 client to a WCF asp.net hosted service,
    utilizing MTOM encoding and if at all possible, streamedRequest transfer mode.

    I am starting with a basic Hello World service. I am basing the
    configuration on these articles:

    http://devlicio.us/blogs/ziemowit_s...interoperability-between-wcf-and-wse-3-0.aspx
    http://msdn2.microsoft.com/en-us/library/ms730049.aspx

    When calling the hello method of the service I am getting the error:

    SOAP Action header was not understood

    Any help is greatly appreciated.

    The WCF Host Service is defined as:

    <ServiceContract(SessionMode:=SessionMode.NotAllowed)> _
    Public Interface IWCFTestService

    <OperationContract()> _
    Function hello(ByVal value As String) As String

    End Interface

    The host web.config is:

    <?xml version="1.0"?>

    <configuration>
    <system.serviceModel>
    <services>
    <service name="WCFTestService" behaviorConfiguration="returnFaults">
    <endpoint address="" contract="IWCFTestService"
    binding="wsHttpBinding" bindingConfiguration="wsHttp"/>
    <endpoint address="2004" contract="IWCFTestService"
    binding="customBinding" bindingConfiguration="WSE"/>
    </service>
    </services>
    <bindings>
    <customBinding>
    <binding name="WSE">
    <textMessageEncoding messageVersion="Soap12WSAddressingAugust2004"/>
    <httpTransport/>
    </binding>
    </customBinding>
    <wsHttpBinding>
    <binding name="wsHttp"/>
    </wsHttpBinding>
    </bindings>
    <behaviors>
    <serviceBehaviors>
    <behavior name="returnFaults" >
    <serviceDebug includeExceptionDetailInFaults="true" />
    <serviceMetadata httpGetEnabled="true" />
    </behavior>
    </serviceBehaviors>
    </behaviors>
    </system.serviceModel>
    </configuration>

    The WSE Client config is able to add the web reference and there is one
    class generated for each of the endpoints defined by the service. If I use
    the Soap11 messageVersion specified in the MSDN article, I only see one
    client class defined so I assume at this point, Soap12 is the proper
    configuration as noted in the blog article.

    The client code is:

    Imports WCFTestServiceClient.WCFTestService
    Module Module1

    Sub Main()
    Dim service As New WCFTestService.CustomBinding_IWCFTestService
    System.Console.WriteLine(service.hello("Rich"))
    Dim x As String = ""
    End Sub

    End Module

    The client app.config configuration is:
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <configSections>
    <sectionGroup name="applicationSettings"
    type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0,
    Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <section name="WCFTestServiceClient.My.MySettings"
    type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0,
    Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </sectionGroup>
    <section name="microsoft.web.services3"
    type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration,
    Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35" />
    </configSections>
    <system.diagnostics>
    <sources>
    <!-- This section defines the logging configuration for
    My.Application.Log -->
    <source name="DefaultSource" switchName="DefaultSwitch">
    <listeners>
    <add name="FileLog" />
    <!-- Uncomment the below section to write to the Application Event
    Log -->
    <!--<add name="EventLog"/>-->
    </listeners>
    </source>
    </sources>
    <switches>
    <add name="DefaultSwitch" value="Information" />
    </switches>
    <sharedListeners>
    <add name="FileLog"
    type="Microsoft.VisualBasic.Logging.FileLogTraceListener,
    Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
    initializeData="FileLogWriter" />
    <!-- Uncomment the below section and replace APPLICATION_NAME with the
    name of your application to write to the Application Event Log -->
    <!--<add name="EventLog"
    type="System.Diagnostics.EventLogTraceListener"
    initializeData="APPLICATION_NAME"/> -->
    </sharedListeners>
    </system.diagnostics>
    <applicationSettings>
    <WCFTestServiceClient.My.MySettings>
    <setting name="WCFTestServiceClient_WCFTestService_WCFTestService"
    serializeAs="String">
    <value>http://vmservercollett/WCFWSEServiceTest/Service.svc</value>
    </setting>
    </WCFTestServiceClient.My.MySettings>
    </applicationSettings>
    <microsoft.web.services3>
    <messaging>
    <mtom clientMode="Off" />
    </messaging>
    <diagnostics>
    <trace enabled="false" input="InputTrace.webinfo"
    output="OutputTrace.webinfo" />
    </diagnostics>
    </microsoft.web.services3>
    </configuration>

    The http conversation is:

    POST /WCFWSEServiceTest/Service.svc/2004 HTTP/1.1
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client
    Protocol 2.0.50727.832)
    VsDebuggerCausalityData:
    uIDPo6Qxe7N1eM9HhvdKAtBbVyQAAAAAnYhYItwjIkKr0ekzClTrSM22vQv1ompKg0kaBJHlxo8ACAAA
    Content-Type: application/soap+xml; charset=utf-8;
    action="http://tempuri.org/IWCFTestService/hello"
    Host: vmservercollett
    Content-Length: 306
    Expect: 100-continue
    Connection: Keep-Alive

    HTTP/1.1 100 Continue

    <?xml version="1.0" encoding="utf-8"?><soap:Envelope
    xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><hello
    xmlns="http://tempuri.org/"><value>Rich</value></hello></soap:Body></soap:Envelope>

    HTTP/1.1 500 Internal Server Error
    Date: Fri, 24 Aug 2007 19:27:06 GMT
    Server: Microsoft-IIS/6.0
    MicrosoftOfficeWebServer: 5.0_Pub
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50727
    Cache-Control: private
    Content-Type: application/soap+xml; charset=utf-8
    Content-Length: 1534

    <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
    xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"><s:Header><a:Action
    s:mustUnderstand="1">http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher/fault</a:Action><a:To
    s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To></s:Header><s:Body><s:Fault><s:Code><s:Value>s:Receiver</s:Value><s:Subcode><s:Value
    xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</s:Value></s:Subcode></s:Code><s:Reason><s:Text
    xml:lang="en-US">The SOAP action specified on the message, '', does not match
    the HTTP SOAP Action, 'http://tempuri.org/IWCFTestService/hello'.
    </s:Text></s:Reason><s:Detail><ExceptionDetail
    xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel"
    xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><HelpLink
    i:nil="true"/><InnerException i:nil="true"/><Message>The SOAP action
    specified on the message, '', does not match the HTTP SOAP Action,
    'http://tempuri.org/IWCFTestService/hello'. </Message><StackTrace> at
    System.ServiceModel.Channels.RequestContextBase.get_RequestMessage()

    at
    System.ServiceModel.Dispatcher.ChannelHandler.ProvideFaultAndReplyFailure(RequestContext
    request, Exception exception, ErrorHandlerFaultInfo& faultInfo, Boolean&
    replied)</StackTrace><Type>System.ServiceModel.ActionMismatchAddressingException</Type></ExceptionDetail></s:Detail></s:Fault></s:Body></s:Envelope>
    Richard Collette, Aug 27, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon
    Replies:
    0
    Views:
    996
    Simon
    Oct 13, 2009
  2. Cindy Lee
    Replies:
    1
    Views:
    2,076
    Mr. Arnold
    Mar 19, 2010
  3. Curt K
    Replies:
    3
    Views:
    443
    John Saunders [MVP]
    Jun 15, 2007
  4. mike

    Windows Service as Web Service host without WCF?

    mike, Mar 30, 2009, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    817
  5. CS ADNT
    Replies:
    0
    Views:
    813
    CS ADNT
    Mar 16, 2010
Loading...

Share This Page