Bookshelf Home | Contents | Index | PDF |
Integration Platform Technologies: Siebel Enterprise Application Integration > Web Services > Using the Local Business Service > Script Example for a Local Business ServiceA portion of the sample script for a local business service used to add a custom SOAP header to an outbound Web service request is shown in the following example. Local variables, error handling, and object destruction are omitted for clarity. soapHdr.SetType("SOAP-ENV:header"); // Populate the SOAP header elements. appId.SetType("ns1:ApplicationID"); uName.SetValue("first.last@mycompany.com"); // Populate the profileHeader element. profileHeader.SetType("authHeader"); profileHeader.SetProperty("xmlns:ns1", "http://siebel.com/authHeaders"); profileHeader.AddChild(appId); profileHeader.AddChild(langCd); profileHeader.AddChild(uName); // SOAP header property set. Once this is complete, add the SOAP header as a child of the Input property set (which contains the SOAP:body). soapHdr.InsertChildAt(profileHeader, 0) Inputs.InsertChildAt(soapHdr, 0); // Convert the property set to a well-defined XML document. // Using the XML Hierarchy Converter: must add a child element of type XMLHierarchy. childPS.SetType("XMLHierarchy"); inPs.SetProperty("EscapeNames", "FALSE"); inPs.SetProperty("GenerateProcessingInstructions", "FALSE"); xmlSvc.InvokeMethod("XMLHierToXMLDoc", inPs, outPs); // Proxy the request through a trace utility to view the SOAP document. // Set custom HTTP header - SOAPAction outPs.SetProperty("HTTPRequestURLTemplate", "http://localhost:9000/search/beta2"); outPs.SetProperty("HTTPRequestMethod", "POST"); outPs.SetProperty("HTTPContentType", "text/xml; charset=UTF-8"); outPs.SetProperty("HDR.SOAPAction","customSOAPActionValue"); // Invoke the Web service using the standard HTTP protocol. httpSvc.InvokeMethod("SendReceive", outPs, hpOut); // Convert the SOAP document to a property set using the XML Converter, returning the SOAP header and SOAP body. xmlCtr.InvokeMethod("XMLToPropSet", hpOut, Outputs); After you have created your business service, compile it into the Siebel SRF. |
Integration Platform Technologies: Siebel Enterprise Application Integration | Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |