eCommunications Industry | Day 2 - Topic 4

Web Services Integration

Siebel Web Services Overview

Siebel exposes business objects (Accounts, Contacts, Opportunities, SRs) via SOAP and REST Web Services, enabling external applications to create, read, update, and delete data programmatically.

SOAP vs. REST

SOAP (Legacy, XML-based)

  • Protocol: XML over HTTP
  • WSDL: Machine-readable service definition
  • Use case: Enterprise integrations requiring strict contracts
  • Example: Java application calls Siebel SOAP service to create account

REST (Modern, JSON-based)

  • Protocol: JSON over HTTP (GET, POST, PUT, DELETE)
  • Lightweight: Easier to consume from web/mobile apps
  • Use case: Website forms submitting leads to Siebel
  • Example: JavaScript app posts lead data to Siebel REST API

Inbound Web Services (Siebel as Server)

External systems call Siebel to manipulate data.

SOAP Example: Create Account

POST /siebel/app/eai/enu?SWEExtSource=WebService&SWEExtCmd=Execute
Content-Type: text/xml

<soapenv:Envelope>
  <soapenv:Body>
    <CreateAccount>
      <Name>Acme Corp</Name>
      <Location>New York</Location>
      <Type>Prospect</Type>
    </CreateAccount>
  </soapenv:Body>
</soapenv:Envelope>
                    

Response: Returns Account ID (e.g., "1-ABC123")

REST Example: Query Opportunities

GET /siebel/v1.0/data/Opportunity?searchspec=[Sales%20Stage]='Negotiation'
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5...

Response (JSON):
{
  "items": [
    { "Id": "1-XYZ", "Name": "HealthCorp Deal", "Revenue": 500000, "Stage": "Negotiation" },
    { "Id": "1-ABC", "Name": "RetailCo Upgrade", "Revenue": 300000, "Stage": "Negotiation" }
  ]
}
                    

Outbound Web Services (Siebel as Client)

Siebel calls external APIs to fetch/send data.

Example: Address Validation

  • Scenario: User enters address in Account form
  • Trigger: OnFieldUpdate event fires Business Service "ValidateAddress"
  • Business Service calls USPS API:
    POST https://api.usps.com/validate
    {
      "address1": "123 Main St",
      "city": "Springfield",
      "state": "IL",
      "zip": "62701"
    }
                                
  • USPS Response: Corrected address ("123 MAIN ST", validated ZIP: "62701-1234")
  • Siebel updates Account: Sets ZIP to "62701-1234"

Authentication

Security Methods:
  • Basic Auth: Username/password in header (Base64 encoded)
  • Token-Based (OAuth): Bearer token (modern, more secure)
  • Session-Based: Login once, receive session ID, use in subsequent calls

Common Use Cases

1. Website Lead Capture

  • Customer fills "Request Demo" form on company website
  • JavaScript posts data to Siebel REST API
  • Siebel creates Lead, auto-assigns to sales rep

2. Mobile App Integration

  • Field tech mobile app queries assigned work orders via REST
  • App displays job list, tech updates status "Completed"
  • App POSTs status update to Siebel

3. Partner Portal Sync

  • Partner portal shows opportunities for channel partners
  • Nightly batch job calls Siebel SOAP to fetch new opportunities
  • Partner updates deal status in portal → Syncs back to Siebel via SOAP

4. Real-Time Inventory Check

  • Sales rep configures quote in Siebel
  • Siebel calls ERP REST API: "Check stock for iPhone 15 Pro"
  • ERP responds: "50 units in warehouse"
  • Siebel displays availability to rep

Error Handling

  • HTTP 200 OK: Success
  • HTTP 400 Bad Request: Invalid data (e.g., missing required field)
  • HTTP 401 Unauthorized: Authentication failed
  • HTTP 404 Not Found: Resource doesn't exist (e.g., Account ID invalid)
  • HTTP 500 Internal Error: Siebel server error (check logs)

Performance Considerations

Best Practices:
  • Batch Operations: Create 100 accounts in 1 call (not 100 individual calls)
  • Pagination: Query large datasets in pages (50 records at a time)
  • Caching: Cache rarely-changing data (product catalog) to avoid repeated API calls
  • Async Processing: For bulk operations, use asynchronous batch jobs (not real-time APIs)
  • Rate Limiting: Respect API call limits (e.g., 1,000 calls/hour)