Inbound Web Service – Part 2 – Workflow Process

Having created our IO, we can now move on to the Workflow Process. We’ll use this to pull in the inputs, extract the data and map it into the IO.

  1. Start off by creating a new Workflow Process in the Project that we created last time. Call it ‘My Web Service Workflow’ and set the Business Object property to ‘Contact’
  2. Let’s set up some important Process Properties:
    • CustNum – In – String: this will act as our ‘input’ to the Web Service
    • SiebelMessage – Out – Integration Object: this will act as the ‘output’ of the Web Service
    • Setting the other Process Props to ‘None’ helps to keep things neat and tidy
  3. An important step here is to set the ‘Integration Object’ property of the ‘SiebelMessage’ property to ‘My Contact IO’. This will allow Siebel to work out the ‘output’ format when it generates the WSDL for our Web Service
  4. Edit the Workflow: drag Start, Business Service and End steps into the designer and link them up. If you have an exception handler Business Service, you can also add a Business Service step with an exception branch from the other. Link this up to the End step to complete the design:
  5. In the first Business Service, set the following properties:
  6. Set the input arguments as follows:
    • SearchSpec – Expression – “[Contact.Id] = ‘” + [&CustNum] + “‘” : This provides the search criteria for the query. In this case, we’re passing in the ‘ROW_ID’ as the CustNum. Note that Siebel evaluates the whole string as an expression, hence the quotes
    • OutputIntObjectName – Literal – My Contact IO : this tells the method how to retrieve and map the Contact fields to our output format
  7. Now set the output arguments:
    • SiebelMessage – Output Argument – SiebelMessage
  8. Test through the simulator by populating the ‘CustNum’ default string value with a ROW_ID from a Contact in your environment. By enabling the ‘Watch’ window you should see a fully populated ‘SiebelMessage’ with the contact details that we’re looking for

Our next step is to expose this Workflow through a Web Service, which will allow our external application to push in a Contact ROW_ID and pull back the name and address details.

VN:F [1.9.17_1161]
Rating: 10.0/10 (1 vote cast)

Inbound Web Service – Part 1 – Integration Object

To begin creating our Inbound Web Service, let’s first recall what that means: we’re going to expose some function of Siebel for an external client to access. There are two basic entities that we can expose externally: Workflow Processes and Business Services. Siebel Tools offers some really helpful functions to expose Workflows so we’ll take that for our example.

Let’s consider this requirement:

An external Web Site retrieves a unique Customer reference from an end user. Knowing nothing of the customer, the external system will look up the Customers name and address in Siebel.

We’ll create a Web Service to achieve just this.

First of all, consider the components we mentioned in the last post:

  1. Integration Object – this is important as it defines what data we’ll pull from the Siebel BCs and how it will be presented in XML
  2. Data Map – this is useful, but not essential: if we want to map and transform data, we can put a DataMap step in the Workflow to achieve this, using a defined Data Map object. We won’t do this in the example.
  3. Workflow Process – we’ll create a Workflow to read in our inputs, pull out our outputs and handle any exceptions. This will also form the basis for our Web Service
  4. Inbound Web Service – we’ll get Siebel to create this for us and this will allow us to generate our WSDL file that we can deploy to our external system

In the next four posts, I’ll cover off these items culminating in testing our new Web Service. Today, we’ll start off by creating a new Integration Object.

Let’s start by creating a new project in Tools called My Web Service and lock it. Then follow these steps to build the components:

  1. Select the ‘File > New Object’ menu item, select the ‘EAI’ tab and select the ‘Integration Object’ item
  2. Select your Project then select the ‘EAI Siebel Wizard’
  3. We’re returning Contact details so select the ‘Contact’ BO and ‘Contact’ BC from the drop down lists. Let’s call the new IO ‘My Contact IO’
  4. You’ll see a number of relationships returned, but we’re only interested in name and address details, so uncheck everything except for the top level ‘Contact’ and ‘Contact_Personal_Address’ objects
  5. Once the process is complete, your new IO will be brought to focus in Tools. Expand it fully and you will see we have created basic mappings for all Contact and Personal Address fields. Tools has even specified XML tags for each field and relationship, so you don’t have to.
  6. We don’t need all these fields returned, so inactivate all Integration Component Fields in Contact except for:
    • Id
    • First Name
    • Last Name
    And for the purpose of maintaining the user keys:
    • Account Integration Id
    • Employee Number
    • Personal Contact
    • Person UId
    • Personal Contact
    • Primary Organization
  7. Use the ‘Edit > Change Records’ menu item to do this quickly.

  8. Personal Address has a far more manageable number of fields, so leave that as it is.

We now have the basis for the extracting of information from our Contact BC into a format that can be mapped directly into the XML of our SOAP message. This is a major stepping stone to completing our Web Service.

VN:F [1.9.17_1161]
Rating: 7.0/10 (3 votes cast)

Siebel Web Services

A recent requirement at one of our clients saw the need to dig deep into the realms of integration and Web Services. It’s one of those concepts that is big in the business and shrouded in mystery and complexity. With a bit of reading and a bit of practical application, it really isn’t that difficult and you will find it a useful and rewarding technology to master. I thought I’d start with a quick run down of concepts then move on to an example or two over the coming weeks.

First up, head on down to w3schools.com and run through their Web Services Tutorial. Here, you’ll begin to see that the concepts around Web Services – XML, SOAP and WSDL – really aren’t that complex at all and are quite logical. With a bit of XML and HTML know-how, it should all start to make a great deal of sense. To me, this was the major step in demystifying the technology and made me realise that it was within my ability to master.

When we start applying these principals to Siebel, there are a number key components that tie in with the basic WS concepts:

  • Integration Objects – meta data representing the structure of the entities that we will be passing around. XML in the SOAP payload will follow the structures we define in the IOs
  • Data Maps – A wonderful Siebel 7 component that allows mapping from the external IO to the internal IO. Simple expressions are supported to allow some quite complex transformations that would have taken a Business Service and eScript to achieve in earlier versions
  • Web Services – Provide the description of the Web Service that we’re consuming or exposing – these tie in nicely with the WSDL component mentioned above and are key to defining and describing the function we’re exposing or executing. Inbound Web Services expose functionality within Siebel to an external party. Outbound Web Services consume some functionality exposed through an external application
  • Workflow Processes – These provide the glue to chain together the components of both Inbound and Outbound Web Services and should already be familiar to most Siebel developers

Siebel provides a host of tools to help develop these components automatically to create both inbound and outbound Web Services. You’ll be amazed at what you can achieve using out of the box functionality and some basic Tools configuration.

A final tip to end this post: download a copy of SOAP UI. This is a simple, free utility that you will find invaluable when testing your Web Services. Download it now and we’ll see how to use it in the posts to come.

In the next post, we’ll create an Inbound Web Service that will allow an external application to grab data out of Siebel over the web. You’ll see how the ‘Deploy as Web Service’ option in Tools makes this really, really easy!

VN:F [1.9.17_1161]
Rating: 10.0/10 (1 vote cast)