Home Page › Forums › BizTalk 2004 – BizTalk 2010 › HTTP Receive/Send Adapters
- This topic has 10 replies, 1 voice, and was last updated 9 years, 2 months ago by
community-content.
-
AuthorPosts
-
-
January 20, 2006 at 8:22 PM #12677
The passthru pipeline contains no components. The Flat file parser is not being run. The message is being delivered to the messagebox as a binary blob with no message type.
If you have an orchestration bound to this port then you will probably see this error.You need to create a custom pipeline, adding the Flat File parser and specifying the flat file schema you have created.
I have created a small assembly for handling HTML forms. It contains a flat file schema, Xml schema, a send and receive pipeline and two maps.
The maps are generic and will translate between these two formats
Flat file:
[code:1:37900d0aff]<form>
<field><name>FieldA</name><value>ValueA</value></field>
<field><name>FieldB</name><value>ValueB</value></field>
</form>
[/code:1:37900d0aff]Xml format
[code:1:37900d0aff]<form>
<FieldA>ValueA</FieldA>
<FieldB>ValueB</FieldB>
<form>
[/code:1:37900d0aff]Email me if you would like a copy of this assembly
-
January 21, 2006 at 12:54 AM #12678
Oops forgot to log in for that last post.
I tried to use the standard mapping tool, but this has some limitations. So I ended up with the custom Xslt.
To create a map using a custom Xslt is relatively simple.
1. Create your Xslt file and extension Xml file and add to project.2. Add a map to your project, specify the source and destination schema and click on the map grid.
3. You can now set the compiler properties, Custom Extension Xml and Custom Xsl PathYou now have a Biztalk Map that uses the custom Xslt.
-
January 22, 2006 at 10:07 AM #12679
The variable values are UrlEncoded by the sender. All characters that ar illegal in a url are converted into their escaped values e.g. %2A etc.
In the map I supplied earlier I call the System.Web.HttpUtility.UrlDecode() method for each value variable to convert these escaped characters back to their original character value.
I also have a map that will does the opposite i.e.
from
<FieldA>Value1</FieldA><FieldB>Value2</FieldB>
to
<Items><Item><Name>FieldA</Name><Value>Value1</Value></Item>…….</Items>This map also calls UrlEncode to escape to illegal characters so they can be HTTP Posted.
This assembly is generic and can be used for any Html form interface.
Let me know your email address and I will send you the assembly and source-
January 20, 2006 at 6:10 AM #12680
Hi everyone.
I have a system in place where our client HTTP Posts form variables to one of our asp.net pages which starts the whole communications process that we have with them. My problem is: the HTTP Receive adapter expects an XML document. So it sounds like I can’t just give our client a new URL (ie. /vrot/BTS…..dll) where the biztalk receive adapter is listening without our client making some changes (posting an XML document in the body). I was just wondering if there is a way to somehow make the adapter accept Form variables, maybe some special schema? More simply, I want the client to be able to post Form variables to the receive location and I also need to post form variables to the client from the http send adapter, plain HTTP/html.
Any ideas?
Thanks
gene-
January 20, 2006 at 7:33 AM #12681
Ok, so I tried to create a flatfile schema for content such as (FieldA=Value1&FieldB=Value2&FieldC=Value3)
I’ve made the receive port use a PassThru pipeline.
So i post \”FieldA=Value1&FieldB=Value2&FieldC=Value3\” to the url and the message goes into the messagebox but then it errors due to No Subscription.
Any ideas? Thanks
-
January 20, 2006 at 11:37 PM #12682
Greg,
I really appreciate the response. Sorry I couldn’t get to this forum to post sooner but I have figured out the problem exactly the same way that you have described. The only thing differnt with my solution is that I read the POST Stream where the Form Variables are in the form of
FieldA=Value1&FieldB=Value2
so what i did is i created a flatfile schema which parses it into
[code:1:52537684d8]
<Items><Item><Name>FieldA</Name><Value>Value1</Value></Item><Item><Name>FieldB</Name><Value>Value2</Value></Item></Items>
[/code:1:52537684d8]after that, i have a map which transforms it into
[code:1:52537684d8]
<Record><FieldA>Value1</FieldA><FieldB>Value2</FieldB>
[/code:1:52537684d8]using Value Mapper (Flattening) shaps along with \”=\” shape.
Is that a good way to do this? Any suggestions are welcome.
Btw, I’ve encountered a problem where Biztalk kept giving me error msgs about the schema used in the pipeline not being properly deployed. I checked and it was GACked and everything seemed fine but still didn’t work. So i had to create a new Biztalk project and went it went through fine and i got it to work finally.
Gino[/code]
-
January 21, 2006 at 12:29 AM #12683
thanks for the input guest.
In light of what you said about generic maps. I was just wondering, is it possible to somehow send the name of a destination field into an \”=\” functiod so that it is not needed to type in each fieldname in each \”=\” functoid but instead just drag-drop?
Thanks
-
January 21, 2006 at 1:12 AM #12684
nice.thanks alot. very useful. I am sure other people will find use for this too
-
January 22, 2006 at 6:41 AM #12685
So i receive an HTTP Post with Form Variables. The values of the variables containing characters such as (‘:’,’/’,’) become ;amp, %2A, %35…etc
the question is, how do i convert this to normal text?
Is creating a scripting functoid that takes \”string html\” as parameter and does something like html = html.replace(\”%2A\”,\”:\”); ?
That’s what i have right now, is there a better way?
I am not sure if i rmeber the codes right….so pls dont call me on it 🙂
-
January 22, 2006 at 6:43 AM #12686
Another problem i ran into, i needed to http post back so i needed to map something like:
<FieldA>Value1</FieldA><FieldB>Value2</FieldB>
into
<Items><Item><Name>FieldA</Name><Value>Value1</Value></Item>…….</Items>
It was easier going in reverse using a Value Mapping (flattening)
any idea how to do this?
Thanks
-
-
-
-
-
-
-
-
-
-
January 21, 2006 at 12:14 AM #12676
I created a custom Xslt.
I wanted a generic map that would work with any form and I also wanted to be able to handle any Url encoding in the data.So I have created this Xslt file:
[code:1:c4e5985810]<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"
xmlns:msxsl=\"urn:schemas-microsoft-com:xslt\"
xmlns:var=\"http://schemas.microsoft.com/BizTalk/2003/var\"
xmlns:SystemWebHttpUtility=\"http://schemas.microsoft.com/BizTalk/2003/System.Web\"
xmlns:s0=\"http://HtmlForm\"
xmlns:ns0=\"http://HtmlForm.AnyForm\"
exclude-result-prefixes=\"msxsl var s0 SystemWebHttpUtility\"
version=\"1.0\" >
<xsl:output omit-xml-declaration=\"yes\" version=\"1.0\" method=\"xml\" />
<xsl:template match=\"/\">
<xsl:element name=\"ns0:Form\">
<xsl:call-template name=\"htmlFormData\"/>
</xsl:element>
</xsl:template>
<xsl:template name=\"htmlFormData\">
<xsl:for-each select=\"//field[name != ‘Submit’]\">
<xsl:variable name=\"var:v1\" select=\"name\" />
<xsl:element name=\"{$var:v1}\">
<xsl:value-of select=\"SystemWebHttpUtility:UrlDecode(string(value))\"/>
</xsl:element>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>[/code:1:c4e5985810]And this Extension Xml file:
[code:1:c4e5985810]<ExtensionObjects>
<ExtensionObject Namespace=\"http://schemas.microsoft.com/BizTalk/2003/System.Web\" AssemblyName=\"System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" ClassName=\"System.Web.HttpUtility\" />
</ExtensionObjects>[/code:1:c4e5985810]Then create a Biztalk map setting the custom Xslt and extension Xml properties.
I also have maps and pipelines for going the other way i.e calling an Html form
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.