Custom SOAP Processor Problem

The good news is that I created a custom soap processor that works for simple document types. I run into problems if the input document contains a list of documents. If the consumer of the service only sends 1 element for the list of documents, I can’t seem to get the xmlNodeToDocument to create the target document with a list of documents. It does not create a list of document with 1 entry, it only creates one document. I hope this makes sense. Let me know if anybody has any suggestions.

Thanks!

Todd,

There are at least four approaches to dealing with this issue:

  1. Create a property in a properties file to hold a list of array names to feed into the “arrays” parameter of your pub.xml:xmlNodeToDocument service setting
  2. Use an approach similar to Fred’s that leverages the services in the WmDoc package to build a list of elements in IS document types that contain lists (string lists, document lists, object lists) and feed that value into the “arrays” parameter of the pub.xml:xmlNodeToDocument service See this post for details.
  3. Create a web services meta data repository using an XML file, database table, UDDI or LDAP directory. Add a property to that metadata for each web service operation that identifies the IS document type to be used when creating a document from the node obtained from the soap message body. Set the “documentTypeName” input parameter to this value and set the “makeArrays” flag to “false” on the pub.xml:xmlNodeToDocument service
  4. Same as 3, but derive the document type name from the namespace and message name of the soap request.

I personally use approach 3, because I find it useful to have a place to specifiy other settings for each web service operation such as its logging level, need to perform xml validation, version, etc.

HTH,

Mark

Thanks! I am currently using method 4. It seems to be working except for the list of documents problem. The target service gets invoked and it tries to put the document out on the broker. This is where it blows up because the document published on the broker expects there to be a list of documents but there is only one there. Is there a chance I am using the pub.xml:xmlNodeToDocument incorrectly? My understanding is that if you set the “documentTypeName” input parameter, it would use the structure of the document.

Thanks!

Yes, but it is possible that the structure of the node in the soap body isn’t the same as your derived document type.

Using a test harness service, build a soap message and then directly invoke your soap processor Flow service. Don’t drop the document output of the pub.xml:xmlNodeToDocument service and be sure that the document being created matches the structure of the referenced document type.

If so, the list elements will be created correctly and you should be able to validate that document using pub.schema:validate.

Mark