locked
Unable to call an asmx web service using windows authentication from a Service workflow RRS feed

  • Question

  • Hello,

    I need to use an existing asmx service from inside my service workflow and I am unable to call it.

    This asmx service is hosted in a web application with iis set to windows authentication, anonymous is not allowed.
    I need to send the authentication, only way seems too be using transport for basicHttpBindings.

    Every time I try to call the service I get an error saying that there is nothing listening to the url of the service generated automatically by VS when I added the Service Reference ?

    my web config

    <configuration>
     <configSections>
     </configSections>
     <system.web>
      <compilation debug="true" targetFramework="4.0" />
     </system.web>
     <system.serviceModel>
      <protocolMapping>
       <add scheme="http" binding="wsHttpBinding" bindingConfiguration="WindowsCreds" />
      </protocolMapping>
       <bindings>
         <basicHttpBinding>
           <binding name="UtilitiesSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
             receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
             bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
             maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
             messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
             useDefaultWebProxy="true">
             <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
               maxBytesPerRead="4096" maxNameTableCharCount="16384" />
             <security mode="TransportCredentialOnly">
               <transport clientCredentialType="Windows" proxyCredentialType="None"
                 realm="" />
               <message clientCredentialType="UserName" algorithmSuite="Default" />
             </security>
           </binding>
         </basicHttpBinding>
         <wsHttpBinding>
           <binding name="WindowsCreds">
             <security mode="Message">
               <message clientCredentialType="Windows" negotiateServiceCredential="true"
                 establishSecurityContext="false" />
             </security>
           </binding>
         </wsHttpBinding>
       </bindings>
      <client>
       <endpoint address="http://127.0.0.1:5052/Services/utilities.asmx"
        binding="basicHttpBinding" bindingConfiguration="UtilitiesSoap"
        contract="UtilitiesSoap" name="UtilitiesSoap" />
      </client>
      <behaviors>
       <serviceBehaviors>
        <behavior>
         <!-- 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="true"/>
        </behavior>
       </serviceBehaviors>
      </behaviors>
      <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
     </system.serviceModel>
     <system.webServer>
      <modules runAllManagedModulesForAllRequests="true"/>
     </system.webServer>
    </configuration>
    
    

    and xaml

    <WorkflowService mc:Ignorable="sap" ConfigurationName="Service1" sap:VirtualizedContainerService.HintSize="1036,801" Name="Service1" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/servicemodel" xmlns:a="clr-namespace:ADNWFService;assembly=ADNWFService" xmlns:ac="clr-namespace:ADNWFService.CrmDiscoveryService;assembly=ADNWFService" xmlns:aca="clr-namespace:ADNWFService.CrmDiscoveryService.Activities;assembly=ADNWFService" xmlns:au="clr-namespace:ADNWFService.UtilitiesService;assembly=ADNWFService" xmlns:aua="clr-namespace:ADNWFService.UtilitiesService.Activities;assembly=ADNWFService" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:p="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:p1="http://schemas.microsoft.com/wf/2010/xaml/wfsecuritypack" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=System.Xml" xmlns:s3="clr-namespace:System;assembly=System.Core" xmlns:s4="clr-namespace:System;assembly=System.ServiceModel" xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:sd1="clr-namespace:System.Data;assembly=System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:ss="clr-namespace:System.ServiceModel;assembly=System.ServiceModel" xmlns:ss1="clr-namespace:System.ServiceModel;assembly=System.ServiceModel.Web" xmlns:ss2="clr-namespace:System.ServiceModel;assembly=System.ServiceModel.Activities" xmlns:ssa="clr-namespace:System.ServiceModel.Activities;assembly=System.ServiceModel.Activities" xmlns:ssx="clr-namespace:System.ServiceModel.XamlIntegration;assembly=System.ServiceModel" xmlns:st="clr-namespace:System.Text;assembly=mscorlib" xmlns:swsd="clr-namespace:System.Web.Services.Description;assembly=System.Web.Services" xmlns:sxs="clr-namespace:System.Xml.Serialization;assembly=System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" xmlns:sxs1="clr-namespace:System.Xml.Serialization;assembly=System.Xml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
     <p:Flowchart sad:XamlDebuggerXmlReader.FileName="C:\CRM\CRM2010\ADNWFService\ADNWFService\CreateBulkEMails.xamlx" sap:VirtualizedContainerService.HintSize="1006,771" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">
      <p:Flowchart.Variables>
       <p:Variable x:TypeArguments="CorrelationHandle" Name="bulkSendHandle" />
       <p:Variable x:TypeArguments="x:String" Name="strListId" />
       <p:Variable x:TypeArguments="a:EmailParams" Default="[New EmailParams()]" Name="emailParams" />
       <p:Variable x:TypeArguments="sd:DataTable" Name="cacheTable" />
      </p:Flowchart.Variables>
      <sap:WorkflowViewStateService.ViewState>
       <scg3:Dictionary x:TypeArguments="x:String, x:Object">
        <x:Boolean x:Key="IsExpanded">False</x:Boolean>
        <av:Point x:Key="ShapeLocation">190,12.5</av:Point>
        <av:Size x:Key="ShapeSize">60,75</av:Size>
        <av:PointCollection x:Key="ConnectorLocation">220,87.5 220,117.5 220,164.5</av:PointCollection>
        <x:Double x:Key="Width">992</x:Double>
        <x:Double x:Key="Height">735.07999999999993</x:Double>
       </scg3:Dictionary>
      </sap:WorkflowViewStateService.ViewState>
      <p:Flowchart.StartNode>
       <x:Reference>__ReferenceID1</x:Reference>
      </p:Flowchart.StartNode>
      <p:FlowStep x:Name="__ReferenceID1">
       <sap:WorkflowViewStateService.ViewState>
        <scg3:Dictionary x:TypeArguments="x:String, x:Object">
         <av:Point x:Key="ShapeLocation">120,164.5</av:Point>
         <av:Size x:Key="ShapeSize">200,51</av:Size>
        </scg3:Dictionary>
       </sap:WorkflowViewStateService.ViewState>
       <p1:ImpersonatingReceiveScope Request="{x:Reference __ReferenceID0}" sap:VirtualizedContainerService.HintSize="303,675">
        <p:Sequence sap:VirtualizedContainerService.HintSize="277,475">
         <sap:WorkflowViewStateService.ViewState>
          <scg3:Dictionary x:TypeArguments="x:String, x:Object">
           <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          </scg3:Dictionary>
         </sap:WorkflowViewStateService.ViewState>
         <p:WriteLine sap:VirtualizedContainerService.HintSize="255,61" Text="[OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.ToString()]" />
         <aua:GetCacheTable EndpointConfigurationName="UtilitiesSoap" GetCacheTableResult="[cacheTable]" sap:VirtualizedContainerService.HintSize="255,22" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" ShowDetails="True" handshake="Adn_Cache" />
         <p:Assign sap:VirtualizedContainerService.HintSize="255,58">
          <p:Assign.To>
           <p:OutArgument x:TypeArguments="x:String">[emailParams.strListId]</p:OutArgument>
          </p:Assign.To>
          <p:Assign.Value>
           <p:InArgument x:TypeArguments="x:String">[cacheTable.TableName + " count=" + cacheTable.Rows.Count.ToString()]</p:InArgument>
          </p:Assign.Value>
         </p:Assign>
         <SendReply DisplayName="SendReplyToNewBulkRequest" sap:VirtualizedContainerService.HintSize="255,90">
          <SendReply.Request>
           <Receive x:Name="__ReferenceID0" CanCreateInstance="True" CorrelatesWith="[bulkSendHandle]" DisplayName="NewBulkRequest" sap:VirtualizedContainerService.HintSize="277,90" OperationName="GetListId" ServiceContractName="EmailParams">
            <Receive.CorrelationInitializers>
             <RequestReplyCorrelationInitializer CorrelationHandle="[bulkSendHandle]" />
            </Receive.CorrelationInitializers>
            <ReceiveMessageContent DeclaredMessageType="x:String">
             <p:OutArgument x:TypeArguments="x:String">[strListId]</p:OutArgument>
            </ReceiveMessageContent>
           </Receive>
          </SendReply.Request>
          <SendMessageContent DeclaredMessageType="x:String">
           <p:InArgument x:TypeArguments="x:String">["Fin"]</p:InArgument>
          </SendMessageContent>
         </SendReply>
        </p:Sequence>
       </p1:ImpersonatingReceiveScope>
      </p:FlowStep>
     </p:Flowchart>
    </WorkflowService>
    

    Thanks fo help

    CS

    Monday, August 30, 2010 4:49 PM