Error consuming WCF service

Home Page Forums BizTalk 2004 – BizTalk 2010 Error consuming WCF service

Viewing 1 reply thread
  • Author
    Posts
    • #21997

      When I try to consume a WCF service (the default WCF service that gets created when you create a WCF project in VS2008) using the default binding (WsHttp) I am getting the following error in my event log. Note: I have a break point set in VS2008 WCF project and it never breaks on that. I’m thinking there is some configuration issue with BizTalk. Somebody help!

      Event Type: Error
      Event Source: XLANG/s
      Event Category: None
      Event ID: 10033
      Date:  3/26/2009
      Time:  11:20:17 AM
      User:  N/A
      Computer: DEVBT2006

      Description:
      Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ‘GetCatalog.Service1_1Client(8afbfdae-aec6-5360-72d9-8cac51f155ca)’.
      The service instance will remain suspended until administratively resumed or terminated.
      If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
      InstanceId: d12308d2-04b0-44d0-9e90-452ad935666c
      Shape name:
      ShapeId:
      Exception thrown from: segment -1, progress -1
      Inner exception: Received unexpected message type ‘http://www.w3.org/2003/05/soap-envelope#Fault’ does not match expected type ‘http://tempuri.org/#GetDataUsingDataContractResponse’.
             
      Exception type: UnexpectedMessageTypeException
      Source: Microsoft.XLANGs.Engine
      Target Site: Void VerifyMessage(Microsoft.XLANGs.Core.Envelope, System.String, Microsoft.XLANGs.Core.Context, Microsoft.XLANGs.Core.OperationInfo)
      The following is a stack trace that identifies the location where the exception occured

         at Microsoft.XLANGs.Core.PortBinding.VerifyMessage(Envelope env, String typeName, Context cxt, OperationInfo op)
         at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBinding.VerifyMessage(Envelope env, String typeName, Context cxt, OperationInfo op)
         at Microsoft.BizTalk.XLANGs.BTXEngine.BTXLogicalPortBinding.VerifyMessage(Envelope env, String typeName, Context cxt, OperationInfo op)
         at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.VerifyTransport(Envelope env, Int32 operationId, Context ctx)
         at Microsoft.XLANGs.Core.Subscription.Receive(Segment s, Context ctx, Envelope& env, Boolean topOnly)
         at Microsoft.XLANGs.Core.PortBase.GetMessageIdForSubscription(Subscription subscription, Segment currentSegment, Context cxt, Envelope& env, CachedObject location)
         at Microsoft.XLANGs.Core.PortBase.GetMessageId(Subscription subscription, Segment currentSegment, Context cxt, Envelope& env, CachedObject location)
         at GetCatalog.Service1_1Client.segment1(StopConditions stopOn)
         at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)

       

    • #22007

      I sat with this problem for at least a day 🙂

      The service returns its own fault message (you can see that in your logical orchestration port) and you have to configure the adapter to get the knowledge of it, it is not done automatically.

      1. In the adapter configuration, choose “Messages”
      2. Check “Path”
      3. Add an OR-expression for your possible response messages
      4. Check that Node encoding is set to Xml
      5. Check “Propagate fault message”, is checked default

      Sample for Soap Exception and a custom fault: *[local-name()=’Fault’]/*[local-name()=’detail’]/* | /*[local-name()=’MyResponseMessageRootNodeName’]

      See more at: http://martinbring.blogspot.com/2009/02/handling-fault-message.html

      Kind Regards
      Martin Bring

      • #22035

        I tried your suggested solution but now I get a different error. I’m not sure what I’m doing wrong.

        The adapter failed to transmit message going to send port “WcfSendPort_Service1_WSHttpBinding_IService1” with URL “http://localhost:8731/Design_Time_Addresses/PMI.Services.Synchronization/Service1/”. It will be retransmitted after the retry interval specified for this Send Port. Details:”System.InvalidOperationException: Unable to find match for inbound body path expression “/*[local-name()=’Fault’]/*[local-name()=’detail’]/* | /*[local-name()=’CompositeType’]/*” in message.

        at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfMarshaller.CreateBizTalkMessageStream(Message wcfMessage, IAdapterConfigInboundMessageMarshalling config)

        at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfMarshaller.CreateBizTalkMessage(IBaseMessageFactory messageFactory, IAdapterConfigInboundMessageMarshalling marshallingConfig, Message wcfMessage)

        at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)”.

        The service interface is as follows:

             [ServiceContract]

         

            public interface IService1

            {

                [OperationContract]

                string GetData(int value);

         

                [OperationContract]

                CompositeType GetDataUsingDataContract(CompositeType composite);

            }

         

            [DataContract]

            public class CompositeType

            {

                bool boolValue = true;

                string stringValue = “Hello “;

         

                [DataMember]

                public bool BoolValue

                {

                    get { return boolValue; }

                    set { boolValue = value; }

                }

         

                [DataMember]

                public string StringValue

                {

                    get { return stringValue; }

                    set { stringValue = value; }

                }

            }

         

         

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.