1

I have a scenario where I need to send JSON through a dynamic send port. For that reason I created a send pipeline with the JSON encoder with the option Remove Outer Envelope = true.

I have the pipeline associated with my dynamic port and the pipeline has both Xml assembler and Json encoder (I also tried without the xml assembler and the result was the same).

My construct shape for the request message has the following code:

varXml.LoadXml(
"<ns0:DataMigrationRequest xmlns:ns0=\"http://temp">"+
  "<ns0:DataSets>Local Products</ns0:DataSets>"+
  "<ns0:Country>Spain</ns0:Country>"+
  "</ns0:DataMigrationRequest>"
);

msgRequest = varXml;

msgRequest(WCF.SuppressMessageBodyForHttpVerbs)="POST"; 
msgRequest(WCF.TransportClientCredentialType) = "None";
msgRequest(WCF.AlgorithmSuite) = "Default";
msgRequest(WCF.SecurityMode)="Transport";
msgRequest(WCF.HttpMethodAndUrl)=@"POST"; 
msgRequest(BTS.IsDynamicSend) = true;

msgRequest(WCF.BindingType)="customBinding";
msgRequest(WCF.Action)="";
msgRequest(WCF.BindingConfiguration)=@"<binding name=""customBinding""><httpsTransport /></binding>";

msgRequest(WCF.EndpointBehaviorConfiguration) = @"
<behavior name=""customBehavior"">
    <CustomBehavior />
</behavior>";

Dynamic_Port(Microsoft.XLANGs.BaseTypes.Address) =     System.String.Format("https://localhost/temp");
Dynamic_Port(Microsoft.XLANGs.BaseTypes.TransportType)="WCF-Custom";  

Every time that I try to send a message I get the error:

Error details: System.Xml.XmlException: Data at the root level is invalid.

If I replaced the dynamic port by a static port everything works and I'm able to send the message as expected. It just doesn't work is I send as a dynamic.

For sure something is missing, anyone has any hints that could help?

Dijkgraaf
  • 9,324
  • 15
  • 34
  • 48
Ricardo
  • 77
  • 1
  • 9

1 Answers1

0

I think that I figured the issue. It seems that WCF-Custom can only work with XML messages, as such, I replaced with WCF-WebHttp.

Ricardo
  • 77
  • 1
  • 9