Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Error consuming WCF service
- This topic has 3 replies, 1 voice, and was last updated 9 years, 2 months ago by
community-content.
-
AuthorPosts
-
-
March 26, 2009 at 11:07 AM #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: DEVBT2006Description:
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 occuredat 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) -
March 26, 2009 at 1:49 PM #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.
- In the adapter configuration, choose “Messages”
- Check “Path”
- Add an OR-expression for your possible response messages
- Check that Node encoding is set to Xml
- 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-
March 27, 2009 at 11:00 AM #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; }
}
}
-
April 1, 2009 at 7:58 AM #22064
Thanks Martin for your help. Using the hint you gave me, I was able to find a sample that cleared up my issue. The sample I downloaded is Handling Typed Fault Exceptions in Orchestrations from http://msdn.microsoft.com/en-us/biztalk/bb608378.aspx
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.