Novell IDM Workflow Integration Activity & .NET Web Services

How many times have you developed a workflow and discovered a need to have that workflow initiate another workflow, check for other open workflows, terminate another workflow, or something along those lines? Guess what? The Novell User Application can do that! The Novell User Application workflows can integrate with web services through the Integration Activity and the Novell User Application comes with a number of web services that provide those features and many, many more.

***NOTE: As with all Tips and Tricks we provide on the IDMWorks blog, use the following AT YOUR OWN RISK.  We do not guarantee this will work in your environment and make no warranties***

How many times have you developed a workflow and discovered a need to have that workflow initiate another workflow, check for other open workflows, terminate another workflow, or something along those lines?  Guess what?  The Novell User Application can do that! The Novell User Application workflows can integrate with web services through the Integration Activity and the Novell User Application comes with a number of web services that provide those features and many, many more.

For doing things within the Novell User Application it’s awesome.  But if you need to configure your workflow to use a different web service; like a .NET web service from a Microsoft Windows environment, it is supported, you just have to be aware of a few little “gotchas” when dealing with .NET web service integrations.

The first thing you need to be aware of is this information only applies to standard web services developed using the Microsoft Visual Studio IDEs, not AJAX enabled WCF web services or web services developed through other means.

Most web services generally provide some type of return value, even if it is nothing more than just a confirmation response to let the connecting system know that the communication was successful.  So with that in mind, if you have tried to use an Integration Activity with a .NET web service that returns a value you have probably discovered that the return value isn’t right 🙁 .

There is actually a very simple solution, and

The second thing you need to know about integrating with .NET web services is that .NET requires a namespace be provided and if one is not provided then it will default to one.  The .NET namespace is the key here as the Integration Activity does not add the namespace to the activity’s configuration so the workflow doesn’t have awareness of that element.  This means that when the web service call is made from the workflow that the request reaches the web service, however the namespace is missing the parameters thus are not passed into the web service function properly.  Without the parameters most functions require, the web service will return an error, which is not the ideal behavior.  The return value is detected by the workflow but since it’s not the right value it doesn’t really do you any good.

So how do we solve this problem and make the workflow submit the parameter data to the web service correctly?  Add a reference to the namespace in the Integration Activity configurations.

Basic Setup

  1.  We have a .NET web service using the namespace “MyService” and in it a function called “TestFunction”.
  2.  Once we have the WSDL from the web service we add it to an Integration Activity in our workflow and configure the activity to use the “TestFunction” by selecting it from the function list after the WSDL is imported.  This will create the basic configurations along with the connection details (URL, parameters, etc.) that must be configured to use this activity.
  3.  Once this is done you have the basic set up that would generate the undesirable result where the data isn’t mapping between systems properly.  If you were to review the Action Model tab of the Integration Activity near the top you would find the following lines:

    “Ignore NameSpaces For Input”
    “CALL Input.createXPath(“TestFunctionSoapIn”).setAttribute(“xmlns”, “MyService”)”
    “Apply NameSpaces For Output as( , MyService ) Root Element Name: TestFunctionSoapOut”

  4.  To make this Integration Activity work with this .NET web service all that is required is a single additional line to be added to this section.  Simply copy the line “CALL Input.createXPath….”, past it directly beneath itself, and make a simple edit so that the details look like this:

    “Ignore NameSpaces For Input”
    “CALL Input.createXPath(“TestFunctionSoapIn”).setAttribute(“xmlns”, “MyService”)”
    “CALL Input.createXPath(“TestFunctionSoapIn/TestFunction“).setAttribute(“xmlns”, “MyService”)”
    “Apply NameSpaces For Output as( , MyService ) Root Element Name: TestFunctionSoapOut”

    Notice all we did was add a line that called out the actual function name in the SOAP envelope that adds the web service namespace to the SOAP message.  This will allow for proper consumption of the SOAP input by the web service so that the output response to the workflow will contain the correct data in the proper format.

    Questions, comments or concerns?  Feel free to reach out to us at IDMWorks.