Home Page › Forums › BizTalk 2004 – BizTalk 2010 › soap attachment
- This topic has 12 replies, 1 voice, and was last updated 9 years, 3 months ago by
community-content.
-
AuthorPosts
-
-
January 14, 2010 at 7:22 AM #24069
Hi everybody,
In my biztalk application i have to send a file thru a send soap port (or more surely a wcf-custom port) .
The schema of this xml file has been generated from a wsdl.
One of the element of the schema has reference (href) to another xml file generated before in the orchestration.
The xml file and the refered xml file must be sent together in the same soap envelope (multiref).
How to do that ?
If it’s a wcf-custom port that is to be used, what is the configuration of it in the biztalk admin console ?
Regards
-
January 14, 2010 at 9:59 AM #24070
Hi,
Check the following MS publication to see if that answers your question(s):
http://technet.microsoft.com/en-us/library/bb226478(BTS.20).aspx?wt.svl=prodtechnol
Daniel.
-
January 15, 2010 at 2:16 AM #24078
thanx a lot, i’m gonna try this, but perhaps not with a netnamedpipe, i’ll tell you how it works.
-
January 21, 2010 at 4:44 AM #24097
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 21, 2010 at 5:38 AM #24101
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.-
January 21, 2010 at 6:00 AM #24103
mime is not proposed in the biztalk admin console, only Mtom and Text proposed in the encoding binding
-
January 21, 2010 at 6:43 AM #24105
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.
-
January 21, 2010 at 8:00 AM #24106
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
-
January 22, 2010 at 9:08 AM #24113
Any other help ?
Regards
-
-
January 22, 2010 at 11:13 AM #24115
it doesn’t seem to work :
making the message element a distinguished field
the base64 element cannot be distinguished
Message.message = ConvertXmlToBase64(XMlDocument secondXml);
How and where to do that, in an orchestration (assignment), mapping, …
Regards
-
January 22, 2010 at 1:34 PM #24117
You can use the xpath function to assign a value to a node:
xpath(Message, “/*[local-name()=’Message’]/*[local-name()=’message’]”) = ConvertXmltoBase64(XmlDocument secondXml);
-
January 22, 2010 at 1:49 PM #24119
i’ll try this next week, i’ll tell you how it works.
I’ll put this code in a message assignment before sending it to the soap port.
A little problem is how to access secondXml ? by xpath ? and to pass this parameter in the convert method ? I’ll try this, but the call of this method doesn’t work, impossible to cast this xpathdocument to an xmldocument.
Thank you again, you’re of great help.
-
January 26, 2010 at 9:21 AM #24139
ok, it works ! base64 looks like a viewstate !
thanx
-
-
-
-
-
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.