BizTalk Server Applications Integration - SQL Server Stored Procedure call

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Applications Integration > April 2005 > SQL Server Stored Procedure call





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author SQL Server Stored Procedure call
Michael

2005-04-19, 5:55 pm

Hi Stu,

I just got done battling with the same thing. In fact, I
can't use the return value from the SP call because the
distinguished field that I setup based on the schema
(created by BizTalk) can't be found because the SQL
adapter changes the namespace info from what is created
in the schema. Therefore, I jumped through hoops to
assign messages to Xmldocuments and then XPath out my
value....VERY FRUSTRATING. At the end of this exercise,
I got the feeling it would have been easier to write a
custom component in .NET to get what I wanted!! :-)

Anyway, I don't know if you have come across this
document or not, but it helped me get this up and
running. The link as follows:

http://home.comcast.net/~sdwoodgate...pterSamples.doc

I think the only thing I had to do that wasn't in the
article was to configure the port to listen for the
message types that I set up so that I didn't get
subscription errors during reciept of messages. This is
because I used direct receives instead of file receives.

Good luck. Hopefully this helps.

Michael

>-----Original Message-----
>I'm having all kinds of trouble trying to return the
>results of a stored procedure to an orchestration. I've
>tried using all the samples as guides and read a large
>amount of info but to no avail.
>
>Here's the error:
>Microsoft.XLANGs.Core.UnexpectedMessageTypeException:
>Received unexpected message type '' does not match
>expected

type 'http://MyFirstOrchestration#ResponseRoots'.
> at
>Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.VerifyTran

s
>port(Envelope env, Int32 operationId, Context ctx)
> at Microsoft.XLANGs.Core.Subscription.Receive(Segment
>s, Context ctx, Envelope& env, Boolean topOnly)
> at Microsoft.XLANGs.Core.PortBase.GetMessageId
>(Subscription subscription, Segment currentSegment,
>Context cxt, Envelope& env, CachedObject location)
> at MyFirstOrchestration.EmployeeOrchestration.segment1
>(StopConditions stopOn)
> at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment
>(Segment s, StopConditions stopCond, Exception& exp)
>Microsoft.XLANGs.Core.UnexpectedMessageTypeException
>
>Here's the schema:
> <?xml version="1.0" encoding="utf-16" ?>
>- <xs:schema
>xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
>attributeFormDefault="unqualified"
>elementFormDefault="qualified"
>targetNamespace="http://MyFirstOrchestration"
>version="1.0"

xmlns:xs="http://www.w3.org/2001/XMLSchema">
>- <xs:annotation>
>- <xs:appinfo>
> <msbtssql:sqlScript value="exec [ValidateToken]
>@GymID=NULL, @Token=NULL"
>xmlns:msbtssql="http://schemas.microsoft.com/BizTalk/2003

"
> />
> </xs:appinfo>
> </xs:annotation>
>- <xs:element name="RequestRoot">
>- <xs:complexType>
>- <xs:sequence>
>- <xs:element name="ValidateToken">
>- <xs:complexType>
> <xs:attribute name="GymID" type="xs:int" />
> <xs:attribute name="Token" type="xs:int" />
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
>- <xs:element name="ResponseRoots">
>- <xs:complexType>
>- <xs:sequence>
> <xs:element xmlns:q1="http://MyFirstOrchestration"
>minOccurs="0" maxOccurs="unbounded" name="products"
>type="q1:LoansType" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
>- <xs:complexType name="LoansType">
> <xs:attribute name="productID" type="xs:string" />
> </xs:complexType>
> </xs:schema>
>
>
>Here's the stored Procedure:
>CREATE PROCEDURE [dbo].[ValidateToken] @GymID int,

@Token
>int AS
>Select top 1 productID from products FOR XML AUTO,

XMLDATA
>GO
>------------------------------------------------
>As you can see i've dumbed it right down but still no
>joy... Any pointers would be much appreciated
>
>Thanks Stu
>
>P.S. I would have thought that intetgrating with SQL
>would be far easier than it is. I hope BTS2006 has some
>major improvements!
>.
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com