Bookshelf Home | Contents | Index | PDF |
Integration Platform Technologies: Siebel eBusiness Application Integration Volume ll > Web Services > About Local Business ServiceIn 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. 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"); 4 // populate SOAP header elements 5 appId.SetType("ns1:ApplicationID"); 11 uName.SetType("ns1:userID"); 12 uName.SetValue("first.last@siebel.com"); 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); 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); 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"); 32 inPs.SetProperty("EscapeNames", "FALSE"); 33 inPs.SetProperty("GenerateProcessingInstructions", "FALSE"); 34 xmlSvc.InvokeMethod("XMLHierToXMLDoc", inPs, outPs); 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"); 43 // invoke Web Service using standard HTTP protocol 44 httpSvc.InvokeMethod("SendReceive", outPs, hpOut); 46 // Converting the SOAP document to a XMLHierarchy propset 47 xmlSvc.InvokeMethod("XMLDocToXMLHier", hpOut, tmp); 49 // removing XMLHierarchy, returning the SOAP header and SOAP body 50 soapDoc = tmp.GetChild(0).GetChild(0); 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"?> 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"> <authHeader xmlns:ns1="http://siebel.com/authHeaders"> <ns1:ApplicationID>Siebel</ns1:ApplicationID> |
Integration Platform Technologies: Siebel eBusiness Application Integration Volume ll |