Dot Net Dunk

Wandering in the land of .NET
posts - 42, comments - 22, trackbacks - 187

My Links

News

Archives

Post Categories

Blog Roll

Web Services, Schemas and BizTalk 2004 grumble

The scenario:

I receive a message from a 3rd party conforming to a particular schema. I want to send this off to a web service that I've created. I hand-crank some WSDL to define the web service, and <xs:import> the schema (plus a few others) so that I can be "strongly typed" in my web service definition instead of relying on XMLDocument or (shudder) String as a parameter type. I also add the <xs:import>ed schemas to my BizTalk solution.

When I add a reference to the web service, BTS downloads the WSDL and constructs me a proxy and a bunch of message types - including recreating the imported schemas as Reference[1...n].xsd.

When I want to call that web service, I have to use the mapper to map my inbound document to the relevant parameter of the web message type - which feels to me to be a waste of processing power, because in reality they conform to the same version of the same schema.

What I would rather do is use a message assignment shape, and assign my 3rd party document directly to the relevant parameter of the web method, something like: myOutboundDoc.portalData = inboundDoc, instead of going via the mapper. If I try to do this, I quite reasonably get an error that you can't convert between the two types (as an aside - the mapper is just an expensive Cast function :-) )

So how to achieve this? The purest way would be for BizTalk to recognise that the schema referenced by the web service is exactly the same as the schema that is already in the solution - same namespace, root node, version, etc, and to use that instead of using the Reference.xsd mechanism. Effectively BTS should treat the schema namespace details as the "type identifier", rather than the .NET type of the schema class. A hacky way I pondered would be to edit the Reference.odx file by hand to replace the references to the ReferenceX.xsd types with my local schemas. Sounds a bit too dangerous to me...

I appreciate that this approach introduces some tight coupling, but if used correctly then I can see it being of immense value. Has anyone had any experience in this area? Is there a magic rune that I'm missing that would let this work?

Print | posted on Wednesday, June 09, 2004 1:22 PM |

Feedback

Gravatar

# re: Web Services, Schemas and BizTalk 2004 grumble

ok.. so call me brave. I hacked the odx file, deleted the References.xsd file and this solved my problem.. that being that the References.xsd is in the same XML namespace as a previously deployed and referenced assembly. The result of which caused BizTalk to shoot itself in the foot... failed with an error trying to find the namespace... complains that more than one assembly define the same (xml) namespace.. blah blah...
7/15/2005 9:03 PM | bradh
Gravatar

# re: Web Services, Schemas and BizTalk 2004 grumble

You can hack a lot more things than just the .xsd! I've hacked the odx to point to my own web service proxy client code that I tweaked after generating it in wsdl.exe. Solved many many problems! The bonus is you can debug the proxy code and see what's going on.
10/5/2005 7:59 PM | Kyle

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 3 and 7 and type the answer here:

Powered by: