Before you write the PHP call
- Publish the target Sage X3 customer object or service and configure its SOAP pool and pool alias.
- Use getDescription and the Web Services Tester to confirm the public name, Save signature, keys, required fields, and Object XML.
- Verify the endpoint, WSDL, and authentication model for the specific Sage X3 environment.
- Test the complete request outside PHP first, then compare PHP’s SOAP trace with the validated request.
Use PHP’s SoapClient against the published Sage X3 service and WSDL, then confirm the endpoint, authentication, pool alias, public name, and customer XML before calling Save.
What you need to confirm first
This guide covers a PHP application that consumes Sage X3 SOAP web services to create a customer or client record. It does not cover creating a SOAP server.
Endpoint details and request fields vary by Sage X3 version, deployment, authentication model, publication, and customer-object configuration. Treat these values as environment-specific:
- SOAP endpoint, WSDL, and service namespace
- Published customer service and public name
- SOAP pool and
poolAlias - Authentication method and credentials
- Customer keys, required fields, and Object XML
The reliable sequence is to discover and validate the Sage X3 contract first, then reproduce the verified request with PHP.
Understand the Sage X3 SOAP service
Endpoint, WSDL, and STUB
Sage X3 provides the generic CAdxWebServiceXmlCC SOAP endpoint for published services. The exact URL and WSDL context depend on the deployment, so obtain them from the target configuration or the Sage X3 Web Services Tester rather than hard-coding a universal address.
The WSDL describes the contract that PHP must call. The STUB and service description help identify the operation names, arguments, namespaces, and XML structures.
Object services and subprogram services
Sage X3 service types do not all use the same request shape:
- Object-based services commonly expose
Save,Modify,Read, andQuery. - Subprogram services use
Runto invoke a published program or subprogram.
For an object service, Save creates a record and requires the published public name and Object XML. The request context includes poolAlias. A poolId may also be required when the target contract and configuration support client selection.
Do not transfer the request shape from one service type to another. Use the selected service’s WSDL and description as the contract.
Prepare Sage X3 before writing PHP
Publish the customer service
The target Sage X3 object or program must be published before it can be called through SOAP. Confirm that the customer-facing object or service used by the installation is published and available.
Do not assume that the customer object name, public name, field list, or key format is universal. Confirm each value in the target environment.
Configure the SOAP pool
Check that the relevant Sage X3 web-service pool:
- Exists and is available to the relevant client
- Uses the alias sent as
poolAlias - Can access the published service
- Can be reached from the PHP application host
The Web Services Tester can help expose the service URL, STUB, operations, and request structure.
Confirm the authentication model
Authentication depends on the Sage X3 deployment. Login mapping, connected applications, and JWT-related configuration are different models; they are not interchangeable recipes. Confirm which model the target service supports and implement that model in PHP.
Use HTTPS, protect credentials, and keep production endpoints and SOAP payloads out of public logs. The exact PHP headers, token handling, or credential options must come from the selected Sage X3 authentication configuration.
Discover the customer Save contract
Use getDescription
Before constructing a customer request, use the service’s getDescription capability or equivalent discovery workflow to identify:
- The published customer service and its public name
- The available
Saveoperation and its signature - The key fields
- The required customer fields
- The expected Object XML structure
No universal customer object, key format, field list, or XML payload should be assumed. The target environment’s description and tester output are the contract.
Validate with the Web Services Tester
Use the Sage X3 Web Services Tester to inspect the STUB, obtain the SOAP URL, examine operations, and test the XML request and response. Confirm the poolAlias, public name, authentication, and customer XML before transferring the request into application code.
Configure PHP’s SoapClient
Enable PHP’s SOAP extension and replace every placeholder below with values obtained from the target Sage X3 service:
<?php
$wsdl = 'https://<SAGE_X3_HOST>/<VERIFIED_WSDL_PATH>';
$endpoint = 'https://<SAGE_X3_HOST>/<VERIFIED_SOAP_ENDPOINT>';
$options = [
'location' => $endpoint,
'uri' => '<VERIFIED_SERVICE_NAMESPACE>',
'trace' => true,
'exceptions' => true,
'cache_wsdl' => WSDL_CACHE_NONE,
];
try {
$client = new SoapClient($wsdl, $options);
// Confirm the operation and arguments from the target WSDL.
$response = $client->__soapCall(
'<VERIFIED_OPERATION>',
[<VERIFIED_OPERATION_ARGUMENTS>]
);
} catch (SoapFault $fault) {
error_log('Sage X3 SOAP fault: ' . $fault->getMessage());
throw $fault;
}
The WSDL, endpoint, namespace, operation, and arguments in this example are placeholders, not Sage X3 constants. Replace them with the values and structure published by the target service.
Capture the SOAP exchange during testing
With trace => true, PHP can expose the last request and response for comparison with a request that succeeded in the Web Services Tester:
$lastRequest = $client->__getLastRequest();
$lastResponse = $client->__getLastResponse();
// Treat both values as sensitive integration data.
Use tracing temporarily. Do not retain credentials or business data from SOAP traces in production logs.
Build the customer Save request
An object-based Save creates a new record. Its call context and Object XML must match the discovered customer schema:
$poolAlias = '<VERIFIED_POOL_ALIAS>';
$publicName = '<VERIFIED_CUSTOMER_PUBLIC_NAME>';
$objectXml = '<?xml version="1.0" encoding="UTF-8"?>
<?xml-placeholder-for-customer-object?>';
$request = [
'callContext' => [
'poolAlias' => $poolAlias,
// Add poolId only when the target contract requires it.
],
'publicName' => $publicName,
'objectXml' => $objectXml,
];
try {
$response = $client->__soapCall('Save', [$request]);
} catch (SoapFault $fault) {
error_log('Sage X3 SOAP fault: ' . $fault->getMessage());
throw $fault;
}
This is a request pattern, not a universal customer payload. Replace the operation arguments, element names, nesting, public name, keys, and fields with the structure returned by the target WSDL, getDescription, and Web Services Tester.
| Value | Confirm in the target environment |
|---|---|
| Endpoint and WSDL | The reachable SOAP URL and WSDL for the deployment |
| Service/public name | The published customer object or service name |
poolAlias |
The alias configured in the Sage X3 SOAP pool |
| Authentication | The supported login map, connected application, token, or other configured model |
| Object XML | Keys, required fields, nesting, formats, and accepted values |
Inspect the response
An HTTP success does not by itself prove that Sage X3 created the customer. Inspect the response according to the verified WSDL and check its business status, error details, and any returned key fields.
Do not assume a universal response property. Parse the fields defined by the target service. An HTTP 401 points to an authentication problem; a SOAP fault or other HTTP failure may indicate an incorrect endpoint, inaccessible service, invalid request, or server-side configuration issue.
If the Save response returns the new record’s key or keys, retain them securely. Where the service supports it, use a subsequent Read operation to verify that the expected record can be retrieved.
Test before integrating PHP
- Confirm the endpoint and WSDL or STUB.
- Select the published customer service and
Saveoperation. - Confirm the pool alias and authentication.
- Inspect or generate the required Object XML.
- Submit the request and review the response and business status.
SOAPUI or an equivalent tool provides an independent comparison when the Sage X3 tester is unavailable or PHP behaves differently. Validate the same URL, WSDL, operation, authentication, poolAlias, public name, and XML outside the application first.
After the external request succeeds, compare it with PHP’s __getLastRequest() output. Focus on the endpoint, operation, headers, call context, public name, authentication data, and Object XML.
Troubleshoot common Sage X3 SOAP failures
| Symptom | Check | Validation method |
|---|---|---|
| WSDL or endpoint cannot be reached | Hostname, path, HTTPS access, firewall, or deployment URL | Open the verified WSDL from the PHP host and compare it with the tester |
| Service is unknown or unavailable | The object or program may not be published | Confirm publication and inspect available services in the tester |
| Pool-related error | Incorrect or unavailable poolAlias, pool, client, or optional poolId |
Compare the request context with the configured SOAP pool |
| HTTP 401 | Authentication, user mapping, token, or connected-application configuration | Verify the selected authentication model and compare it with a known-good request |
| SOAP fault or invalid XML | Wrong operation arguments, namespace, Object XML, keys, or required fields | Use getDescription, the WSDL, and the tester to validate the schema |
| HTTP 200 but creation fails | Sage X3 business validation or rejected field values | Read the response body’s business status and error details |
| HTTP 500 stating that no web services are accepted | No web-service child processes are available for the Syracuse load balancer | Check the Sage X3 web-service process configuration and server diagnostics |
When diagnosing PHP, enable SOAP tracing temporarily, capture the request and response safely, compare them with the request accepted by the tester, and remove sensitive traces after troubleshooting.
Final environment checklist
- Sage X3 version and deployment model
- SOAP endpoint, WSDL, and namespace
- Published customer object or service and public name
- SOAP pool,
poolAlias, and any required client selection - Authentication model and protected credentials
Savesignature, keys, required fields, and Object XML- Response structure and business-status fields
The available PHP portal example is a non-production reference for SOAP sales-order and product operations, not evidence of a customer-creation implementation. Do not copy its service name, fields, authentication configuration, or XML into a customer integration without independent confirmation.
The implementation sequence is: publish the customer service, configure and verify the SOAP pool, discover the Save contract, validate the XML in the Web Services Tester or SOAPUI, and reproduce that verified request with PHP’s SoapClient over HTTPS.
