Forum Discussion

milosjaran's avatar
milosjaran
New Contributor
15 years ago

SOAPUI and WCF - WS-RM Terminate sequence.

Hello,

I am having problems getting SOAPUI to work properly with WCF service that is configured to use WS-RM version 1.0.

WCF service Details
SOAP 1.2 with WS_RM enabled and MTOM encoding running on IIS 6.0 windows server 2003 r 2 .Net framework 4.0.
Web.config (not entire but with relevant details)

<system.serviceModel>
<services>
<service name="INM.IDA.WSRM.WebServices.ResidenceApplicationCreate">
<endpoint name="WSRM_ResidenceApplicationCreate" address="" binding="customBinding" bindingConfiguration="WSRM_ApplicationCreate"
contract="IApplicationCreate/>
</service>
</services>
<bindings>
<customBinding>
<binding name="WSRM_ApplicationCreate">
<reliableSession acknowledgementInterval="00:00:02" flowControlEnabled="true"
inactivityTimeout="00:10:00" maxPendingChannels="4" maxRetryCount="8"
maxTransferWindowSize="8" ordered="true" reliableMessagingVersion="Default" />
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Default" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="20971520" maxArrayLength="20971520"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</textMessageEncoding>
<httpTransport manualAddressing="false" maxBufferPoolSize="20971520"
maxReceivedMessageSize="20971520" allowCookies="false" authenticationScheme="Anonymous"
bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="20971520" proxyAuthenticationScheme="Anonymous"
realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
useDefaultWebProxy="true" />
</binding>
</customBinding>
</bindings>
<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="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>


SoapUI details
Version 3.6.1. JDK 1.6 running on same mchine as WCF service.

Request details
See WSA and WSRM_Tab images for details of soapui ws-a and ws-rm settings.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ns="http://rep.oio.dk/inm.dk/2011/03/24/" xmlns:ns1="http://rep.oio.dk/inm.dk/2011/10/06/" xmlns:xm="http://www.w3.org/2005/05/xmlmime">
<soap:Header>
<ns:Identity>
<ns:Roles>
<ns:Role>Some role</ns:Role>
</ns:Roles>
</ns:Identity>
</soap:Header>
<soap:Body>
<ns1:ResidenceApplication>
<!--Optional:-->
<ns1:CaseData>
<ns1:ApplicationID>10000000001</ns1:ApplicationID>
<ns1:ApplicationDate>2011-02-12T05:12:00</ns1:ApplicationDate>
</ns1:CaseData>
</ns1:ResidenceApplication>
</soap:Body>
</soap:Envelope>


Failure description
After I execute the request above, everything works fine until I actually look into the Event log, where I find my service logging following error:

System.ServiceModel.ProtocolException: The remote endpoint has errantly sent a TerminateSequence protocol message before the sequence finished.
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.Runtime.InputQueue`1.AsyncQueueReader.End(IAsyncResult result, T& value)
at System.Runtime.InputQueue`1.EndDequeue(IAsyncResult result, T& value)
at System.ServiceModel.Channels.InputQueueChannel`1.EndDequeue(IAsyncResult result, TDisposable& item)
at System.ServiceModel.Channels.ReplyChannel.EndTryReceiveRequest(IAsyncResult result, RequestContext& context)
at System.ServiceModel.Dispatcher.ReplyChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext)


After investigating a bit it appears as if SOAPUI terminates the reliable session in a way WCF does not like it. This can be observed from the messages below:

SOAPUI sequence: message 1:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Action>http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence</wsa:Action><wsa:ReplyTo><wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address></wsa:ReplyTo><wsa:MessageID>uuid:d21d7eb8-c296-4255-8efb-29823080f8d5</wsa:MessageID><wsa:To>http://localhost:82/INM.IDA.WSRM.WebServices/ResidenceApplicationCreate.svc</wsa:To></soap:Header>
<soap:Body xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"><wsrm:CreateSequence><wsrm:AcksTo xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address></wsrm:AcksTo><wsrm:Offer><wsrm:Identifier>blah</wsrm:Identifier></wsrm:Offer></wsrm:CreateSequence></soap:Body>
</soap:Envelope>


SOAPUI Message 2

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ns="http://rep.oio.dk/inm.dk/2011/03/24/" xmlns:ns1="http://rep.oio.dk/inm.dk/2011/10/06/" xmlns:xm="http://www.w3.org/2005/05/xmlmime">
<soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm">
<ns:Identity>
<ns:Roles>
<ns:Role>Some role</ns:Role>
</ns:Roles>
</ns:Identity>
<wsrm:Sequence><wsrm:Identifier>urn:uuid:2c4defca-3d01-40ba-83ce-f21effef2ba6</wsrm:Identifier><wsrm:MessageNumber>1</wsrm:MessageNumber></wsrm:Sequence><wsa:Action>http://rep.oio.dk/inm.dk/IDA/xml.wsdl/2011.10.06#ApplicationCreate</wsa:Action><wsa:ReplyTo><wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address></wsa:ReplyTo><wsa:MessageID>uuid:f54321a0-d810-4690-bba8-63714ca169af</wsa:MessageID><wsa:To>http://localhost:82/INM.IDA.WSRM.WebServices/ResidenceApplicationCreate.svc</wsa:To></soap:Header>
<soap:Body>
<ns1:ResidenceApplication>
<!--Optional:-->
<ns1:CaseData>
<ns1:ApplicationID>10000000001</ns1:ApplicationID>
<ns1:ApplicationDate>2011-02-12T05:12:00</ns1:ApplicationDate>
</ns1:CaseData>
</ns1:ResidenceApplication>
</soap:Body>
</soap:Envelope>


SOAPUI Message 3

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Action>http://schemas.xmlsoap.org/ws/2005/02/rm/TerminateSequence</wsa:Action><wsa:MessageID>uuid:4b312845-db65-4629-b118-248cf3b28da7</wsa:MessageID><wsa:To>http://localhost:82/INM.IDA.WSRM.WebServices/ResidenceApplicationCreate.svc</wsa:To></soap:Header>
<soap:Body xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"><wsrm:TerminateSequence><wsrm:Identifier>urn:uuid:2c4defca-3d01-40ba-83ce-f21effef2ba6</wsrm:Identifier></wsrm:TerminateSequence></soap:Body>
</soap:Envelope>


As it can be seen above the SOAPUI sends Terminate sequence, but I cannot find the LastMessage and handshaking with service before.

To demonstrate that, below is the WCF client sequence:
WCF Client Message 1

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence</a:Action><a:MessageID>urn:uuid:9be36a88-dd6d-41ac-b838-1b2cb903bb3c</a:MessageID><a:To s:mustUnderstand="1">http://localhost:82/INM.IDA.WSRM.WebServices/ResidenceApplicationCreate.svc</a:To></s:Header><s:Body><CreateSequence xmlns="http://schemas.xmlsoap.org/ws/2005/02/rm"><AcksTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></AcksTo><Offer><Identifier>urn:uuid:ff60dabd-750d-4333-b187-e398a62e498c</Identifier></Offer></CreateSequence></s:Body></s:Envelope>


WCF Client Message 2

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:r="http://schemas.xmlsoap.org/ws/2005/02/rm" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><r:Sequence s:mustUnderstand="1"><r:Identifier>urn:uuid:8a165f53-351a-4c56-8482-a051bb5f42c1</r:Identifier><r:MessageNumber>1</r:MessageNumber></r:Sequence><a:Action s:mustUnderstand="1">http://rep.oio.dk/inm.dk/IDA/xml.wsdl/2011.10.06#DocumentAdd</a:Action><h:Identity xmlns:h="http://rep.oio.dk/inm.dk/2011/03/24/" xmlns="http://rep.oio.dk/inm.dk/2011/03/24/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Roles><Role>Some role</Role></Roles></h:Identity><a:MessageID>urn:uuid:937ec7f6-395a-4bbe-a698-ad226d2b7c30</a:MessageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo><a:To s:mustUnderstand="1">http://localhost:82/INM.IDA.WSRM.WebServices/ResidenceApplicationCreate.svc</a:To></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ns1:ResidenceApplication>
<!--Optional:-->
<ns1:CaseData>
<ns1:ApplicationID>10000000001</ns1:ApplicationID>
<ns1:ApplicationDate>2011-02-12T05:12:00</ns1:ApplicationDate>
</ns1:CaseData>
</ns1:ResidenceApplication>
</s:Body>
</s:Envelope>


WCF Client Message 3 (Note the existence of the LastMessage and handshaking)

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:r="http://schemas.xmlsoap.org/ws/2005/02/rm" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><r:SequenceAcknowledgement><r:Identifier>urn:uuid:ff60dabd-750d-4333-b187-e398a62e498c</r:Identifier><r:AcknowledgementRange Lower="1" Upper="1"/></r:SequenceAcknowledgement><r:Sequence s:mustUnderstand="1"><r:Identifier>urn:uuid:8a165f53-351a-4c56-8482-a051bb5f42c1</r:Identifier><r:MessageNumber>2</r:MessageNumber><r:LastMessage/></r:Sequence><a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/LastMessage</a:Action><a:To s:mustUnderstand="1">http://localhost:82/INM.IDA.WSRM.WebServices/ResidenceApplicationCreate.svc</a:To></s:Header><s:Body/></s:Envelope>


WCF Client Message 4 (Terminate sequence)

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:r="http://schemas.xmlsoap.org/ws/2005/02/rm" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><r:SequenceAcknowledgement><r:Identifier>urn:uuid:ff60dabd-750d-4333-b187-e398a62e498c</r:Identifier><r:AcknowledgementRange Lower="1" Upper="2"/></r:SequenceAcknowledgement><a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/rm/TerminateSequence</a:Action><a:MessageID>urn:uuid:cf1326a4-bbc4-4a40-9773-0062a0a5a0b5</a:MessageID><a:To s:mustUnderstand="1">http://localhost:82/INM.IDA.WSRM.WebServices/ResidenceApplicationCreate.svc</a:To></s:Header><s:Body><r:TerminateSequence><r:Identifier>urn:uuid:8a165f53-351a-4c56-8482-a051bb5f42c1</r:Identifier></r:TerminateSequence></s:Body></s:Envelope>


Is it me missing configuration or there is perhaps another explanation?
No RepliesBe the first to reply