Integration Platform Technologies: Siebel eBusiness Application Integration Volume ll > Web Services >

About Local Business Service


In many instances, Web Services utilize specialized SOAP headers for common tasks such as authentication, authorization, and logging. In order to support this common Web Service extensibility mechanism, a Local Business Service, as a transport option for outbound Web Services, is supported in the Siebel application. When specified as a transport, the Web Services infrastructure will route the message to the specified business service for additional processing and delivery to the Web Service endpoint as shown in the top half of Figure 25.

Figure 25.  Local Business Service Used as a Transport
Click for full size image

If the Web Service to be invoked is within the sample application, then no need exists to go through HTTP (or anything else) to invoke such a Web Service.

The input to the local business service is a property set representation of the SOAP request. Once within the local business service, additional SOAP headers may be added to address infrastructure requirements by direct modification of the input property set by using Siebel eScript or Siebel VB. The following code sample shows an example where a local business service was used to add a custom SOAP header to an outbound Web Service request.

function Service_PreInvokeMethod (MethodName, Inputs, Outputs)

{

1           // local variables & error handling omitted for clarity

2           soapHdr.SetType("SOAP-ENV:header");

3

4           // populate SOAP header elements

5           appId.SetType("ns1:ApplicationID");

6           appId.SetValue("Siebel");

7           pwd.SetType("ns1:PWS");

8           pwd.SetValue("123456789");

9           langCd.SetType("ns1:Lang");

10          langCd.SetValue("ENU");

11          uName.SetType("ns1:userID");

12          uName.SetValue("first.last@siebel.com");

13

14          // populate the eProfileHeader element

15          profileHeader.SetType("authHeader");

16          profileHeader.SetProperty("xmlns:ns1", "http://siebel.com/authHeaders");

17          profileHeader.AddChild(appId);

18          profileHeader.AddChild(pwd);

19          profileHeader.AddChild(langCd);

20          profileHeader.AddChild(uName);

21

22          // SOAP header property set. Once this is complete, add the SOAP header

23          // as a child of the Input property set (which contains the SOAP:body

24          soapHdr.InsertChildAt(profileHeader, 0)

25          Inputs.InsertChildAt(soapHdr, 0);

26

27          // convert property set to well defined SOAP/XML document

28          // due to XML Hierarchy Converter, need to create add a child element of type XMLHierarchy

29          childPS.SetType("XMLHierarchy");

30          childPS.AddChild(Inputs);

31          inPs.AddChild(childPS);

32          inPs.SetProperty("EscapeNames", "FALSE");

33          inPs.SetProperty("GenerateProcessingInstructions", "FALSE");

34          xmlSvc.InvokeMethod("XMLHierToXMLDoc", inPs, outPs);

35

36          // proxy the request through trace utility to view SOAP document

37          // set custom HTTP header - SOAPAction

38          outPs.SetProperty("HTTPRequestURLTemplate", "http://localhost:9000/search/beta2");

39          outPs.SetProperty("HTTPRequestMethod", "POST");

40          outPs.SetProperty("HTTPContentType", "text/xml; charset=UTF-8");

41          outPs.SetProperty("HDR.SOAPAction","customSOAPActionValue");

42

43          // invoke Web Service using standard HTTP protocol

44          httpSvc.InvokeMethod("SendReceive", outPs, hpOut);

45

46          // Converting the SOAP document to a XMLHierarchy propset

47          xmlSvc.InvokeMethod("XMLDocToXMLHier", hpOut, tmp);

48

49          // removing XMLHierarchy, returning the SOAP header and SOAP body

50          soapDoc = tmp.GetChild(0).GetChild(0);

51          Outputs.AddChild(soapDoc);

52

53          return (CancelOperation);

The following XML code sample displays the resulting SOAP document generated by the local business service. Note the addition of the <authHeader> element in the SOAP header which corresponds to the structure defined between lines 4 - 20 in the preceding code sample.

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope

xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<SOAP-ENV:header>

<authHeader xmlns:ns1="http://siebel.com/authHeaders">

<ns1:ApplicationID>Siebel</ns1:ApplicationID>

<ns1:PWS>123456789</ns1:PWS>

<ns1:Lang>ENU</ns1:Lang>

<ns1:userID>first.last@siebel.com</ns1:userID>

</authHeader>

</SOAP-ENV:header>

<SOAP-ENV:Body>

...

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Integration Platform Technologies: Siebel eBusiness Application Integration Volume ll