【问题标题】:Node Soap request to Siebel system对 Siebel 系统的 Node Soap 请求
【发布时间】:2020-10-18 06:00:57
【问题描述】:

我正在构建一个 Node 系统,根据需要,来自其他来源(Siebel)的 wsdl 正在被消耗。我正在使用soap npm 来构建它,但是在向Siebel 发送请求时,错误显示为“错误:入站SOAP 消息-会话令牌丢失或无效或已过期”。谷歌搜索了一下,看起来与身份验证问题有关,因此在代码中添加了“client.setSecurity(new soap.WSSecurity('username', 'password'))”。最终代码如下:

var soap = require('soap');
  var url = 'http___siebel.com_xml_CustomPay_AAA Payment Service BS.WSDL';
var args = {
                amount:'100',
                transactionReference:'abc123',
                orderId:'50',
                customerId:'112211',
                merchantTransactionDateTime:'22/01/2020',
                RequestHeader: {serviceName:'Pay',
                                operation: 'Create',
                                reqSystemName: 'Node',
                                originatorID: '112205',
                                originatorIP: 'aa.aa.aa.aa',
                                hostName: 'siebelbuild'}
                
            }
    
//client.addSoapHeader(RequestHeader,"","tns","http://siebel.com/xml/CustomPay")

  soap.createClient(url, function(err, client) {  
    client.setSecurity(new soap.WSSecurity('username', '****word'))
    client.Upsert1(args, function(err, result) {
        console.log(result);
    });
  });

WSDL 文件如下所示:

<?xml version="1.0" encoding="UTF-8" ?> 
- <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsdLocal1="http://www.siebel.com/xml/XXXGovPayRequest" targetNamespace="http://siebel.com/xml/CustomPay" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsdLocal2="http://www.siebel.com/xml/XXXGovPayResponse" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://siebel.com/xml/CustomPay">
- <types>
- <xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="http://www.siebel.com/xml/XXXGovPayResponse" xmlns:xsdLocal2="http://www.siebel.com/xml/XXXGovPayResponse" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:annotation>
  <xsd:documentation>Copyright (C) 2001-2004 Siebel Systems, Inc. All rights reserved. Siebel XSD Generation</xsd:documentation> 
  </xsd:annotation>
  <xsd:element name="XXXGovPayResponse" type="xsdLocal2:XXXGovPayResponse" /> 
+ <xsd:complexType name="XXXGovPayResponseTopElmt">
- <xsd:sequence>
  <xsd:element name="XXXGovPayResponse" maxOccurs="1" minOccurs="1" type="xsdLocal2:XXXGovPayResponse" /> 
  </xsd:sequence>
  </xsd:complexType>
- <xsd:complexType name="XXXGovPayResponse">
- <xsd:sequence>
  <xsd:element name="OneOffPaymentDetailResponse" maxOccurs="unbounded" minOccurs="1" type="xsdLocal2:OneOffPaymentDetailResponse" /> 
  </xsd:sequence>
  </xsd:complexType>
- <xsd:complexType name="OneOffPaymentDetailResponse">
- <xsd:sequence>
  <xsd:element name="transactionReference" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="ResponseHeader" maxOccurs="1" minOccurs="0" type="xsdLocal2:ResponseHeader" /> 
  <xsd:element name="Response" maxOccurs="1" minOccurs="0" type="xsdLocal2:Response" /> 
  </xsd:sequence>
  </xsd:complexType>
- <xsd:complexType name="ResponseHeader">
- <xsd:sequence>
  <xsd:element name="sourceObjectId" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  </xsd:sequence>
  </xsd:complexType>
- <xsd:complexType name="Response">
+ <xsd:sequence>
  <xsd:element name="responseCode" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="responseMessage" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="ResponseDetails" maxOccurs="1" minOccurs="0" type="xsdLocal2:ResponseDetails" /> 
  </xsd:sequence>
  </xsd:complexType>
- <xsd:complexType name="ResponseDetails">
- <xsd:sequence>
  <xsd:element name="errorCode" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="errorDescription" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:schema>
- <xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xsdLocal1="http://www.siebel.com/xml/XXXGovPayRequest" targetNamespace="http://www.siebel.com/xml/XXXGovPayRequest" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:annotation>
  <xsd:documentation>Copyright (C) 2001-2004 Siebel Systems, Inc. All rights reserved. Siebel XSD Generation</xsd:documentation> 
  </xsd:annotation>
  <xsd:element name="XXXGovPayRequest" type="xsdLocal1:XXXGovPayRequest" /> 
- <xsd:complexType name="XXXGovPayRequestTopElmt">
- <xsd:sequence>
  <xsd:element name="XXXGovPayRequest" maxOccurs="1" minOccurs="1" type="xsdLocal1:XXXGovPayRequest" /> 
  </xsd:sequence>
  </xsd:complexType>
- <xsd:complexType name="XXXGovPayRequest">
- <xsd:sequence>
  <xsd:element name="oneOffPaymentDetailRequest" maxOccurs="1" minOccurs="1" type="xsdLocal1:oneOffPaymentDetailRequest" /> 
  </xsd:sequence>
  </xsd:complexType>
- <xsd:complexType name="oneOffPaymentDetailRequest">
- <xsd:sequence>
  <xsd:element name="paymentInputs" maxOccurs="1" minOccurs="1" type="xsdLocal1:paymentInputs" /> 
  </xsd:sequence>
  </xsd:complexType>
- <xsd:complexType name="paymentInputs">
- <xsd:sequence>
  <xsd:element name="acquirerResponseCode" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="acquirerResponseDescription" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="amount" maxOccurs="1" minOccurs="1" type="xsd:string" /> 
  <xsd:element name="RequestHeader" maxOccurs="1" minOccurs="0" type="xsdLocal1:RequestHeader" /> 
  <xsd:element name="cardScheme" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="chargeAmount" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="creditDebitIndicator" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="maskedPan" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="merchantTransactionDateTime" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="orderAmount" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="responseCode" maxOccurs="1" minOccurs="1" type="xsd:string" /> 
  <xsd:element name="responseDescription" maxOccurs="1" minOccurs="1" type="xsd:string" /> 
  <xsd:element name="transactionDateTime" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="authorizationCode" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="merchantId" maxOccurs="1" minOccurs="1" type="xsd:string" /> 
  <xsd:element name="transactionReference" maxOccurs="1" minOccurs="1" type="xsd:string" /> 
  <xsd:element name="orderId" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="customerId" maxOccurs="1" minOccurs="1" type="xsd:string" /> 
  </xsd:sequence>
  </xsd:complexType>
- <xsd:complexType name="RequestHeader">
- <xsd:sequence>
  <xsd:element name="serviceName" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="operation" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="reqSystemName" maxOccurs="1" minOccurs="1" type="xsd:string" /> 
  <xsd:element name="originatorID" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="originatorIP" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  <xsd:element name="sourceObjectId" maxOccurs="1" minOccurs="1" type="xsd:string" /> 
  <xsd:element name="hostName" maxOccurs="1" minOccurs="0" type="xsd:string" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:schema>
- <xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="http://siebel.com/xml/CustomPay" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:import namespace="http://www.siebel.com/xml/XXXGovPayResponse" /> 
  <xsd:import namespace="http://www.siebel.com/xml/XXXGovPayRequest" /> 
- <xsd:element name="Upsert1_Input">
- <xsd:complexType>
- <xsd:sequence>
  <xsd:element ref="xsdLocal1:XXXGovPayRequest" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
- <xsd:element name="Upsert1_Output">
- <xsd:complexType>
- <xsd:sequence>
  <xsd:element ref="xsdLocal2:XXXGovPayResponse" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
  </xsd:schema>
  </types>
- <message name="Upsert1_Input">
  <part name="Upsert1_Input" element="tns:Upsert1_Input" /> 
  </message>
- <message name="Upsert1_Output">
  <part name="Upsert1_Output" element="tns:Upsert1_Output" /> 
  </message>
- <portType name="XXXPaymentServiceBS">
- <operation name="Upsert1">
  <input message="tns:Upsert1_Input" /> 
  <output message="tns:Upsert1_Output" /> 
  </operation>
  </portType>
- <binding name="XXXPaymentServiceBS" type="tns:XXXPaymentServiceBS">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> 
- <operation name="Upsert1">
  <soap:operation soapAction="document/http://siebel.com/xml/CustomPay:Upsert1" /> 
- <input>
  <soap:body use="literal" /> 
  </input>
- <output>
  <soap:body use="literal" /> 
  </output>
  </operation>
  </binding>
- <service name="XXX_spcPayment_spcService_spcBS">
- <port binding="tns:XXXPaymentServiceBS" name="XXXPaymentServiceBS">
  <soap:address location="http://aa.aa.bb.bb.:8080/eai_enu/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute&WSSOAP=1" /> 
  </port>
  </service>
  </definitions>

还导入了soapUI工具中的wsdl进行检查,但结果是一样的。 有人可以帮忙吗。

【问题讨论】:

    标签: node.js soap siebel


    【解决方案1】:

    取决于提供商如何设置安全性。尝试将用户 ID 和密码作为 SOAP 标头传递。试试这些肥皂标题

    <UsernameToken>{username}</UsernameToken>
    <PasswordText>{password}<PasswordText>
    

    【讨论】:

    • 这不起作用,在不同的帖子上还有其他可用的建议,但没有一个经过验证,也没有一个工作
    猜你喜欢
    • 2018-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多