XML Schema support woes in K2.net Studio

  • 5 April 2006
  • 2 replies
  • 0 views

Badge +4
All,

Has anyone had experience using the web service event with complex return types? I have a service that I have defined using the schema-first approach. The return values is the only complex part, however, after importing the schema I am confronted with the following problems:

1. The WebService Event in Studio does not recognise complex return types and always return a compatibility error message. This is even when I attach the return value to the root of the schema.

2. The data contained within the returned object once in the XML instance variable is in no way validated against the schema, i.e. I can write alpha into integer fields.

3. Almost all the XML definition attributes within the schema are rejected, for example min and max occurences as well as the isnull. This is easy to verify as the newly imported full schema can be exported and compared.

To cut to the chase; does anyone have any hints or tips on what is going on here and how I can use the schema to its fullest within Studio? Additionally, have others experienced integrating webservices with more complex structures other than string, int, etc.?

Currently, I see no other option other than coding the complete validation within custom code and/or providing an enhanced Event for such a purpose.

Regards
Graham

2 replies

Badge +8
Has anyone had experience using the web service event with complex return types

I had a similar situation recently - the way i approached it was to generate an assembly using the Visual Studio WSDL tool, reference this assembly in the K2 project and call it in a normal server event. This article explains how to generate an assembly from a web service:

http://www.dotnetjunkies.com/Tutorial/4D13CEFA-D0FD-44BE-8749-8D17B5757564.dcik

Once the assembly is there it's all plain sailing.

Hope this helps...
Badge +4
Thanks Neil,

I had already got this far but the article did give me some food for thought. However, my concern is to get the complex object back into an XML format that in turn can be used within the process itself.

Currently, my code calls the webservice, captures the returned object, serializes it, pulls the schema out from the process XML data, and does a validation on the serialized stream. If all is okay then the complete serialized steam is written back to the process instance XML variable. What is missing in the Studio web service event is functionality similar to that in the SQL Event where a dataset is read into a repeating XML structure.

After this I need to make sure that the schema processing within K2.Studio does something valid when loading "real" schemas. The next hurdle is to make sure that the XML schema within the process is kept up to date with that defined for the webservice. This is, in itself, no mean feat. Finally, any changes to the web service and proxy must be taken into account. Oh, how I love a challenge!

Graham

Reply