早期アクセス
QntrlでインバウンドSOAP Webサービスを作成するには、次の手順を実行します。
True
設定済みの要求パラメーターとレスポンスパラメーターのみが許可されます。受信した要求に追加のパラメーターが含まれている場合、その要求は拒否されます。
設定されていない出力パラメーターはレスポンスから除外されます。
要求内の操作名は、WSDLで定義された名前と完全に一致している必要があります。一致しない場合、要求は失敗します。
False
WSDLで定義されていないパラメーターが含まれている場合でも、システムは外部からの要求を受け付けます。
ただし、設定済みのパラメーターには検証ルールが適用されます。
Qntrlは、エンドポイントURL、操作名、設定済みの要求/レスポンスパラメーターに基づいてWSDLを自動生成します。これらの設定を変更すると、WSDLも自動的に更新されます。
スクリプトでは、操作名、要求パラメーター、要求ヘッダー、完全なSOAPペイロード、エンドポイントURLにアクセスして処理できます。
レスポンスパラメーター、レスポンスヘッダーパラメーター、フォールトコード、フォールトメッセージを定義できます。また、完全なXMLレスポンスを定義することもできます。
エラーが発生した場合は、クライアントに返すエラーコードとメッセージを定義できます。
Qntrlでは、受信SOAP APIでFunctionリソースを構築するために、次の言語に対応しています。
JavaScript(NativeまたはCodexエンジン)
その他のクラウド関数– Python、Java、Node.jsに対応しています。
例(JavaScript):入力パラメーターの読み取りとレスポンスの書き込み
/*** @param {SOAPRequest} soapRequest* @param {SOAPResponse} soapResponse*/function execute(soapRequest, soapResponse) {try {const operationName = soapRequest.getOperationName();const endpointUri = soapRequest.getEndpointUri();const requestParams = soapRequest.getRequestParams();const requestHeaders = soapRequest.getHeaderParams();console.log('SOAP 要求 Received:');console.log('Operation:', operationName);console.log('Endpoint URI:', endpointUri);console.log('要求 Params:', JSON.stringify(requestParams));console.log('要求 Headers:', JSON.stringify(requestHeaders));// === Business logic こちら ===// (For now we're mocking processing)const processedParam1 = 'processed_value_1';const processedParam2 = 'processed_value_2';// Add response headerssoapResponse.addResponseHeaderParam('server', 'InternalGateway');soapResponse.addResponseHeaderParam('要求-id', requestHeaders?.['要求-id'] || 'N/A');soapResponse.addResponseHeaderParam('timestamp', new Date().toISOString());// Add response paramssoapResponse.addResponseParam('result_code', 'SUCCESS');soapResponse.addResponseParam('processed_param1', processedParam1);soapResponse.addResponseParam('processed_param2', processedParam2);} catch (e) {console.error('Error while processing SOAP 要求', e);soapResponse.setFaultCode(500);soapResponse.setFaultMessage(e.message);}}
例(Java):入力パラメーターの読み取りとレスポンスの書き込み
インポート com.zoho.cloud.function.Context;インポート com.zoho.cloud.function.basic.*;インポート org.json.JSONObject;public class SampleSOAPFunction implements ZCFunction {@Overridepublic void runner(Context context, BasicIO basicIO) throws Exception {// Read incoming 要求 parametersString operationName = basicIO.getParameter('operation_name').toString();String requestParams = basicIO.getParameter('request_params').toString();String requestHeaders = basicIO.getParameter('request_headers').toString();String endpointURI = basicIO.getParameter('endpoint_uri').toString();// Prepare ResponseJSONObject responseJSON = new JSONObject();try {JSONObject responseParams = new JSONObject();responseParams.put('customer_id', 'CUST12345');responseParams.put('order_id', 'ORD78910');responseJSON.put('response_params', responseParams);JSONObject responseHeaders = new JSONObject();responseHeaders.put('client-id', 'WEBPORTAL-001');responseHeaders.put('要求-id', 'REQ-20251105-ALPHA99');responseJSON.put('response_header_params', responseHeaders);} catch (Exception e) {// The final XML response will have only fault code and fault message.responseJSON.put('fault_code', '500');responseJSON.put('fault_message', e.getMessage());}// From above constructed response parameter and response header, final response XML will be automatically constructed and written to client.basicIO.write(responseJSON.toString());context.log('Response Sent: ' + responseJSON.toString());}}
メソッド:任意のHTTPメソッド(例:GET)
URL:https://core.qntrl.com/webservice/soap/<org-id>/<source_endpoint>?WSDL
認証(リクエストヘッダーに追加する必要があります)。
メソッド:任意のHTTPメソッド(例:POST)
URL:https://core.qntrl.com/webservice/soap/<org-id>/<source_endpoint>
認証(リクエストヘッダーに追加する必要があります)。
OAuthトークン
ヘッダー形式:Authorization: Zoho-oauthtoken <access_token>
必要なOAuthスコープ:ws_soapinbound.UPDATE
APIキー
ヘッダー形式:Authorization: Bearer <api_key>
基本認証
Authorization: Basic <base64-encoded username:password>
本文:生のXML要求データを含める必要があります。
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:ord='https://98173384.core.localqntrlhost.com/webservice/98173384/orderManagement'> <soapenv:Header> <ord:AuthHeader> <ord:companyName>Zoho Corp</ord:companyName> </ord:AuthHeader> </soapenv:Header> <soapenv:Body> <ord:PlaceOrder> <ord:OrderID>12345</ord:OrderID> <ord:CustomerID>98765</ord:CustomerID> <ord:ProductID>10111</ord:ProductID> <ord:Quantity>3</ord:Quantity> <ord:OrderDate>2025-03-28</ord:OrderDate> </ord:PlaceOrder> </soapenv:Body> </soapenv:Envelope>
設定パネルから、個々のSOAP 要求の有効/無効を切り替えられます。
[設定]→[Webサービス]→[受信]→[SOAP]を選択します。
左パネルのリソースセクションで、SOAPメッセージを探します。
メッセージ名の横にある切り替えボタンを使用して、有効または無効にします。
SOAP 要求を削除するには、次の手順を実行します。
[設定]→[Webサービス]→[受信]→[SOAP]を選択します。
削除するメッセージを選択します。
メッセージの詳細ページの右上にある削除アイコンをクリックします。