Re: Transmitting .net class type from one application to WCF service via BizTalk orchestration

Home Page Forums BizTalk 2004 – BizTalk 2010 Transmitting .net class type from one application to WCF service via BizTalk orchestration Re: Transmitting .net class type from one application to WCF service via BizTalk orchestration

#21546

Now what I have tried is to send simple xml file rather than .net class. I have defined schema for input message as

BODY{font:x-small ‘Verdana’;margin-right:1.5em}
.c{cursor:hand}
.b{color:red;font-family:’Courier New’;font-weight:bold;text-decoration:none}
.e{margin-left:1em;text-indent:-1em;margin-right:1em}
.k{margin-left:1em;text-indent:-1em;margin-right:1em}
.t{color:#990000}
.xt{color:#990099}
.ns{color:red}
.dt{color:green}
.m{color:blue}
.tx{font-weight:bold}
.db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px solid #CCCCCC;font:small Courier}
.di{font:small Courier}
.d{color:blue}
.pi{color:blue}
.cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small Courier;color:#888888}
.ci{font:small Courier;color:#888888}
PRE{margin:0px;display:inline}
<!–
function f(e){
if (e.className==”ci”){if (e.children(0).innerText.indexOf(“\n”)>0) fix(e,”cb”);}
if (e.className==”di”){if (e.children(0).innerText.indexOf(“\n”)>0) fix(e,”db”);}
e.id=””;
}
function fix(e,cl){
e.className=cl;
e.style.display=”block”;
j=e.parentElement.children(0);
j.className=”c”;
k=j.children(0);
k.style.visibility=”visible”;
k.href=”#”;
}
function ch(e){
mark=e.children(0).children(0);
if (mark.innerText==”+”){
mark.innerText=”-“;
for (var i=1;i<e.children.length;i++)
e.children(i).style.display=”block”;
}
else if (mark.innerText==”-“){
mark.innerText=”+”;
for (var i=1;i<e.children.length;i++)
e.children(i).style.display=”none”;
}}
function ch2(e){
mark=e.children(0).children(0);
contents=e.children(1);
if (mark.innerText==”+”){
mark.innerText=”-“;
if (contents.className==”db”||contents.className==”cb”)
contents.style.display=”block”;
else contents.style.display=”inline”;
}
else if (mark.innerText==”-“){
mark.innerText=”+”;
contents.style.display=”none”;
}}
function cl(){
e=window.event.srcElement;
if (e.className!=”c”){e=e.parentElement;if (e.className!=”c”){return;}}
e=e.parentElement;
if (e.className==”e”) ch(e);
if (e.className==”k”) ch2(e);
}
function ex(){}
function h(){window.status=” “;}
document.onclick=cl;
–>

  <?xml
version=”1.0″ encoding=”utf-16″
?>
<xs:element name=”Message>
<xs:complexType>
<xs:sequence>
  <xs:element name=”Text type=”xs:string />
  <xs:element name=”Client type=”xs:string
/>
  </xs:sequence>
  </xs:complexType>
  </xs:element>
  </xs:schema>

and Ouput message as

BODY{font:x-small ‘Verdana’;margin-right:1.5em}
.c{cursor:hand}
.b{color:red;font-family:’Courier New’;font-weight:bold;text-decoration:none}
.e{margin-left:1em;text-indent:-1em;margin-right:1em}
.k{margin-left:1em;text-indent:-1em;margin-right:1em}
.t{color:#990000}
.xt{color:#990099}
.ns{color:red}
.dt{color:green}
.m{color:blue}
.tx{font-weight:bold}
.db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px solid #CCCCCC;font:small Courier}
.di{font:small Courier}
.d{color:blue}
.pi{color:blue}
.cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small Courier;color:#888888}
.ci{font:small Courier;color:#888888}
PRE{margin:0px;display:inline}
<!–
function f(e){
if (e.className==”ci”){if (e.children(0).innerText.indexOf(“\n”)>0) fix(e,”cb”);}
if (e.className==”di”){if (e.children(0).innerText.indexOf(“\n”)>0) fix(e,”db”);}
e.id=””;
}
function fix(e,cl){
e.className=cl;
e.style.display=”block”;
j=e.parentElement.children(0);
j.className=”c”;
k=j.children(0);
k.style.visibility=”visible”;
k.href=”#”;
}
function ch(e){
mark=e.children(0).children(0);
if (mark.innerText==”+”){
mark.innerText=”-“;
for (var i=1;i<e.children.length;i++)
e.children(i).style.display=”block”;
}
else if (mark.innerText==”-“){
mark.innerText=”+”;
for (var i=1;i<e.children.length;i++)
e.children(i).style.display=”none”;
}}
function ch2(e){
mark=e.children(0).children(0);
contents=e.children(1);
if (mark.innerText==”+”){
mark.innerText=”-“;
if (contents.className==”db”||contents.className==”cb”)
contents.style.display=”block”;
else contents.style.display=”inline”;
}
else if (mark.innerText==”-“){
mark.innerText=”+”;
contents.style.display=”none”;
}}
function cl(){
e=window.event.srcElement;
if (e.className!=”c”){e=e.parentElement;if (e.className!=”c”){return;}}
e=e.parentElement;
if (e.className==”e”) ch(e);
if (e.className==”k”) ch2(e);
}
function ex(){}
function h(){window.status=” “;}
document.onclick=cl;
–>

  <?xml
version=”1.0″ encoding=”utf-16″
?>
<xs:element name=”Message>
<xs:complexType>
<xs:sequence>
  <xs:element name=”Text type=”xs:string />
  <xs:element name=”Client type=”xs:string
/>
  </xs:sequence>
  </xs:complexType>
  </xs:element>
  </xs:schema>

In the file receive port I send following XML message

<Message>
  <Text>Text_0</Text>
  <Client>Client_0</Client>
</Message>

This what I get

“net.tcp://localhost:8000/SubscriberWCFPort/MessageReceiver”. It will be retransmitted after the retry interval specified for this Send Port. Details:”System.ServiceModel.FaultException: http://www.w3.org/2005/08/addressing/faulturn:uuid:56fd1f9b-0204-427f-9a09-2036e3777389http://www.w3.org/2005/08/addressing/anonymouss:Sendera:ActionNotSupportedThe message with Action ‘<BtsActionMapping xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:xsd=”http://www.w3.org/2001/XMLSchema”&gt;
<Operation Name=”ForwardMessage” Action=”http://example.org/messenger/IMessageReceiver/ForwardMessage&#8221; />
</BtsActionMapping>’ cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).

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

 

My WCF code is as follows

    [ServiceContract(Namespace=”http://example.org/messenger&#8221;)]
    public interface IMessageReceiver
    {
        [OperationContract]
        void ForwardMessage(Message message);
    }

 

    public class MessageReceiver : IMessageReceiver
    {
        #region IMessageReceiver Members

        public void ForwardMessage(Message message)
        {
            Console.WriteLine(message.Text);
        }

        #endregion
    }

 

StatusMessage class is

    [DataContract(Namespace=”http://example.org/messenger&#8221;)]
    public class Message
    {
        [DataMember]
        public string Text { get; set; }
        [DataMember]
        public string Client { get; set; }
    }