WCF-SQL and XML parameter

WCF-SQL can be used with a Stored Procedure that has an XML parameter.

The Xml parameter is converted in a string parameter in the generated code. So for passing an XML, you need to convert it in string with encoding.

It exists a simpler manner :

  • In your orchestration, only create your XML parameter as a message
  • Send it via your send port to WCF-SQL
  • Now in the send port click on configure
  • Click the Messages tab, and in the Outbound WCF message body section, choose the Template option.
  • In the XML text box, specify the template that will be used to construct the WCF message. By doing so, you create a message that conforms to the operation for the WCF-based SQL adapter
  • For the ADD_LAST_EMP_XML_INFO stored procedure, you must specify the following template:
    <ADD_LAST_EMP_XML_INFO xmlns="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo">
    <xml_info>
    <bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007" encoding="string"/> </xml_info>
    </ADD_LAST_EMP_XML_INFO>
  • The Tag encoding is very important. By specifying string, it’ll replace <> and other special caracter by their encoding (like &gt; …)

This method  is very powerfull, the only problem is you need to ensure that your schema is up to date manually

For more information see MSDN : http://msdn.microsoft.com/en-us/library/dd788497(v=bts.10).aspx

Publicités

Laisser un commentaire

Choisissez une méthode de connexion pour poster votre commentaire:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s