Forum Replies Created
-
AuthorPosts
-
thanx a lot Greg !
As you can see in the xml document structure above there are 2 elements that could be used to do what you’re saying :
– idMessage (xs:int)
– message (xs:base64Binary)
it’s said by the custommer (who gave the wsdl) that message doesn’t work (i don’t know why, but it may work ?, and the web service is in java).
Actually i’d be tempted to put the attached xml file in message, but message cannot be distinguished in biztalk because of its type (base64Binary cannot be distinguished).
I think we’re about to resolve this problem, just a little precision…
Thanx again
You will need to add your second Xml file as a Base64 string to the Message field of your message. This will require a C# helper class and making the message element a distinguished field
Message.message = ConvertXmlToBase64(XMlDocument secondXml);
Then use MTOM encoding on the Binding tab of the WCF Transport Properties.
You will need to confirm with the web service publisher that MTOM is the correct attchment mechanism.
1, The schema is a message specification. It specifies the message type (targetnamespace#root node). It can be used to validate messages in the pipeline using the XmlDisassembler or XmlValidator pipeline components. It contains the the specifications for promoted properties and distinguished fields. It contains the envelope property thst controls pipeline debatching. A flat file schema contains instructions for the Flat File Assembler and Disassembler to parse or serialize a flat file to/from Xml. An EDI schema does the same for Edifact, X12 or EANCOM messages….
2. There are many examples of complex schemas . e.g UBL http://docs.oasis-open.org/ubl/os-UBL-2.0/UBL-2.0.html and http://docs.oasis-open.org/ubl/os-UBL-2.0/xsd/
3. The message context contains promoted properties and distinguished fields. The promoted properties can be used for message routing where as the distinguished fields are only available inside an orchestration ( or custom pipeline code). Each promoted property is limited to 256 characters while a distinguished field has no limit. The MessageBox pub/sub mechanism relies on promoted properties without them it would not work.
4. I am not sure promoted properties do consume more memory than distinguished fields e.g the BTS.MessageType promoted property value is typically less than 100 characters, whereas a distinguished field could contain megabytes of data.
5 . A property schema is where you define your promoted properties. The quick promotion button is just a short cut to creating the property schema. You can define your on promoted properties that can be used for content-based routing and controlling the pub/sub mechanism central to BizTalk.
mime is not proposed in the biztalk admin console, only Mtom and Text proposed in the encoding binding
What is the mechanism for attaching the additional file. The choices are MIME, DIME or MTOM
DIME is a Microsoft specification that never really took off, so it will probably be MIME or MTOM.Hi Resende,
Thanks for you reply. I will go through the link you provided and if I have any doubts then I will post that also.
Hi Devendran
Perhaps this link bellow can help you
http://www.codeproject.com/KB/biztalk/BiztalkToGrandma.aspx
Hi Xman71,
I come back to you for this soap attachment:
In visual studio 2005 from a wsdl file (sent by the custommer) i have generated port type and message type and everything that go with these.
the generated message type is this one :
<?xml version=”1.0″ encoding=”utf-16″ ?>
– <xs:schema xmlns:tns=”http://messages.commun.titi.toto.com” xmlns:b=”http://schemas.microsoft.com/BizTalk/2003″ elementFormDefault=”qualified” targetNamespace=”http://messages.commun.titi.toto.com” xmlns:xs=”http://www.w3.org/2001/XMLSchema”>
<xs:element name=”Message” nillable=”true” type=”tns:Message” />
– <xs:complexType name=”Message”>
– <xs:sequence>
<xs:element minOccurs=”1″ maxOccurs=”1″ name=”auditCre” nillable=”true” type=”xs:dateTime” />
<xs:element minOccurs=”1″ maxOccurs=”1″ name=”auditUpd” nillable=”true” type=”xs:dateTime” />
<xs:element minOccurs=”1″ maxOccurs=”1″ name=”avisCree” type=”xs:boolean” />
<xs:element minOccurs=”1″ maxOccurs=”1″ name=”codeFournisseur” type=”xs:int” />
<xs:element minOccurs=”1″ maxOccurs=”1″ name=”dateCree” nillable=”true” type=”xs:dateTime” />
<xs:element minOccurs=”1″ maxOccurs=”1″ name=”datemsg” nillable=”true” type=”xs:dateTime” />
<xs:element minOccurs=”0″ maxOccurs=”1″ name=”envCible” type=”xs:string” />
<xs:element minOccurs=”0″ maxOccurs=”1″ name=”etatMsg” type=”xs:string” />
<xs:element minOccurs=”1″ maxOccurs=”1″ name=”factureCree” type=”xs:boolean” />
<xs:element minOccurs=”0″ maxOccurs=”1″ name=”fullEditCorrecteur” type=”xs:string” />
<xs:element minOccurs=”1″ maxOccurs=”1″ name=”idMessage” type=”xs:int” />
<xs:element minOccurs=”1″ maxOccurs=”1″ name=”idPieceJointe” type=”xs:int” />
<xs:element minOccurs=”0″ maxOccurs=”1″ name=”interchange” type=”xs:string” />
<xs:element minOccurs=”0″ maxOccurs=”1″ name=”message” type=”xs:base64Binary” />
<xs:element minOccurs=”0″ maxOccurs=”1″ name=”nomExp” type=”xs:string” />
<xs:element minOccurs=”0″ maxOccurs=”1″ name=”refAsso” type=”xs:string” />
<xs:element minOccurs=”0″ maxOccurs=”1″ name=”refMessage” type=”xs:string” />
<xs:element minOccurs=”0″ maxOccurs=”1″ name=”repMess” type=”xs:string” />
<xs:element minOccurs=”0″ maxOccurs=”1″ name=”typeMessage” type=”xs:string” />
</xs:sequence>
</xs:complexType>
</xs:schema>this message will be sent thru the generated send port.
if, in the biztalk admin console, i configure the generated send port as a soap port, it works fine.
Now the element idMessage in the structure of the generated message make a reference to another xml file generated before in the same biztalk orchestration and i have to send these 2 messages together in the same soap envelope, the 2nd one as a soap attachment.
How to do that ?
I’ve tried to do this (it didn’t work) :
In the biztalk admin console
– i have configured the generated send port as a WCF-WSHttp port (Static Solicit-Response),
– in the Address (URI) i have put the url of the web service,
– in the Messages tab,
* in the inbound biztalk message body i have choosen Path
* and put the infopath of the main element of the attached xml file in the body path expression
for the moment no proxy, no certificate.
Something’s wrong ? something’s lacking ?
Thank you for your help.
Best regards.
January 19, 2010 at 2:16 PM in reply to: can biztalk read data from csv file,tab file,partial data from multiple text files, ssh tunnel and send to sql server DB #24095Sorry typo, should read WCF SQL Adapter
The code below is for a custom functoid that I wrote to accomplish what you are asking. It takes two parameters in, date and format. It will use the DateTime.Parse() method to convert the date parameter to a DateTime type. It will then convert the date back to a string based on the .NET DateTime.ToString() formatting pattern specified in the format parameter. All of the standard .NET formatting patterns will work plus I added an extra to output Julian day by using “jjj” in the pattern.
Please let me know what you think!
[code]
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.BizTalk.BaseFunctoids;
using System.Reflection;
using System.Globalization;
using System.Resources;namespace BizTalk.CustomFunctoid
{
public class DateFormat : BaseFunctoid
{
static ResourceManager resmgr = new ResourceManager(“Meritain.BizTalk.CustomFunctoid.CustomResource”, Assembly.GetExecutingAssembly());public DateFormat()
: base()
{
// This has to be a number greater than 6000
this.ID = System.Convert.ToInt32(resmgr.GetString(“IDS_DATEFORMAT_ID”));
this.SetupResourceAssembly(“Meritain.BizTalk.CustomFunctoid.CustomResource”, Assembly.GetExecutingAssembly());//Set Resource strings , bitmaps
this.SetName(“IDS_DATEFORMAT_NAME”);
this.SetTooltip(“IDS_DATEFORMAT_TOOLTIP”);
this.SetDescription(“IDS_DATEFORMAT_DESCRIPTION”);
this.SetBitmap(“IDS_DATEFORMAT_ICON”);// Minimum and maximum parameters that the functoid accepts
this.SetMinParams(2);
this.SetMaxParams(2);// Function name that needs to be called when this Functoid is invoked.
// Put this in GAC
this.SetExternalFunctionName(GetType().Assembly.FullName, “Meritain.BizTalk.CustomFunctoid.DateFormat”, “FormatDate”);//Category for this functoid
this.Category = FunctoidCategory.DateTime;//Input and output Connection type
this.OutputConnectionType = ConnectionType.AllExceptRecord;
this.AddInputConnectionType(ConnectionType.AllExceptRecord);
}public String FormatDate(String dateIn, String formatOut)
{
String dateToFormat = dateIn.Trim();
DateTime theDate;
String dateFormatted = String.Empty;try
{
// Try to parse the date string passed through the map. /* .DayOfYear.ToString(“000”) */
theDate = DateTime.Parse(dateToFormat);dateFormatted = this.ApplyFormatting(theDate, formatOut);
}
catch
{
try
{
// “yyyyMMdd” cannot be parsed so try to format the date string to “MM/dd/yyyy” and reparse if parsing fails.
CultureInfo nfo = new CultureInfo(“en-US”);
theDate = DateTime.ParseExact(dateToFormat, “yyyyMMdd”, nfo);dateFormatted = this.ApplyFormatting(theDate, formatOut);
}
catch
{
dateFormatted = String.Empty;
}
}
return dateFormatted;
}private String ApplyFormatting(DateTime d, String f)
{
String s = String.Empty;// Check for lonely Julian Day and assign it to return value
if (f.Equals(“jjj”))
{
s = d.DayOfYear.ToString(“000”);
}
else
{
// Insert Julian Day where specified in date format string
s = d.ToString(f);
if (f.Contains(“jjj”))
s = s.Replace(“jjj”, d.DayOfYear.ToString(“000”));
}return s;
}
}
}[/code]
-Dave
Do you really want to buil a custom functoid? You could use the script functoid, and script .Net code.
Clustering is only required for those receive adapters that can only run on a single host. These hosts would run as active-passive.
For other hosts load balancing makes more sense, like HTTP and WCF. In this case you can run these hosts as active-active.Cool! Thanks Greg! I do plan on getting the Biztalk servers clustered eventually (when we upgrade to 2009) but for now, since we have NLB in place to manage the load between these two servers this should suffice.
The easiest place to start is probably the sample Custom Functoid:
C:\Program Files\Microsoft BizTalk Server 2006\SDK\Samples\XmlTools\CustomFunctoid
If your MyFTPHost host instance is configured to run on only one server, then you will only receive the file once.
The high availability solution is to cluster your Biztalk servers and have the MyFTPHost service fail-over if the server running your host instance fails. i.e. you have the MyFTPHost host instance configured on both servers but have it running on one and stopped on the other. The cluster software will manage starting and stopping each service as required.
-
AuthorPosts