在wso2 esb中的有效负载工厂中删除了Soap Header

时间:2017-09-18 04:46:58

标签: wso2 wso2esb

我正在使用WSO2 Payload工厂创建一个soap请求,其中一些信息被发送给第三方。此有效内容删除我的soap标头值。任何人都可以帮我解决这个问题。我只能看到身体被传递,头部被移除。

我必须使用以下请求获取一些令牌

     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:oas="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:sec="http://schemas.cdi.ltsa.govt.nz/SecurityService.xsd" xmlns:sec1="http://schemas.cdi.ltsa.govt.nz/SecurityService" xmlns:oas1="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:acc="http://schemas.cdi.ltsa.govt.nz/Security/AccessControl/" xmlns:sec2="http://localhost/Schema/SecurityService">
       <soapenv:Header>
          <oas:Security>
             <oas:UserNameToken>
                <oas:UserName>XXXX</oas:UserName>
                <oas:Password>XXXX</oas:Password>
             </oas:UserNameToken>
           </oas:Security>
       </soapenv:Header>
       <soapenv:Body>
          <acc:AuthenticateClient>
             <sec2:AuthenticateClientRequest>
                <sec2:RequestBody></sec2:RequestBody>
             </sec2:AuthenticateClientRequest>
          </acc:AuthenticateClient>
       </soapenv:Body>
    </soapenv:Envelope>







<header name="SOAPAction" scope="transport" value="http://schemas.cdi.ltsa.govt.nz/Security/AccessControl/AuthenticateClient"/>
    <script language="js"><![CDATA[var envelope = mc.getEnvelopeXML();
    var oas = new Namespace('http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'); 
mc.addHeader(false, <oas:Security xmlns:oas="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<oas:UserNameToken>
            <oas:UserName>XXXX</oas:UserName>
            <oas:Password>XXXX</oas:Password>
         </oas:UserNameToken>
       </oas:Security>
);]]></script>
    <payloadFactory media-type="xml">
        <format>
            <Body>
                <AuthenticateClient>
                    <AuthenticateClientRequest>
                        <RequestBody/>
                    </AuthenticateClientRequest>
                </AuthenticateClient>
            </Body>
        </format>
        <args>
            <arg evaluator="xml" expression="$ctx:UserName" xmlns:ns="http://org.apache.synapse/xsd"/>
            <arg evaluator="xml" expression="$ctx:Password" xmlns:ns="http://org.apache.synapse/xsd"/>
        </args>
    </payloadFactory>
    <log level="full"/>
    <call>
        <endpoint>
            <address trace="disable" uri="http://XXXX:28080/services/XXXX"/>
        </endpoint>
    </call>
    <respond/>

日志:

wire << "POST /services/B2BProxyVechicle HTTP/1.1[\r][\n]"
[2017-09-18 16:38:12,230] DEBUG - wire << "SOAPAction: http://XXXXX/AccessControl/AuthenticateClient[\r][\n]"
[2017-09-18 16:38:12,225] DEBUG - SequenceMediator End : Sequence key=<Value {name ='null', keyValue ='PPSR_VehicleInfo_IN_SEQ'}>
[2017-09-18 16:38:12,245] DEBUG - SequenceMediator End : Sequence <anonymous>
[2017-09-18 16:38:12,238] DEBUG - wire << "Accept-Encoding: gzip,deflate[\r][\n]"
[2017-09-18 16:38:12,253] DEBUG - wire << "Content-Type: text/xml; charset=UTF-8[\r][\n]"
[2017-09-18 16:38:12,257] DEBUG - wire << "Transfer-Encoding: chunked[\r][\n]"
[2017-09-18 16:38:12,261] DEBUG - wire << "Host: 172.17.134.192:28080[\r][\n]"
[2017-09-18 16:38:12,265] DEBUG - wire << "Connection: Keep-Alive[\r][\n]"
[2017-09-18 16:38:12,268] DEBUG - wire << "User-Agent: Synapse-PT-HttpComponents-NIO[\r][\n]"
[2017-09-18 16:38:12,273] DEBUG - wire << "[\r][\n]"
[2017-09-18 16:38:12,275] DEBUG - wire << "a3[\r][\n]"
[2017-09-18 16:38:12,278] DEBUG - wire << "<Body xmlns="http://ws.apache.org/ns/synapse"><AuthenticateClient><AuthenticateClientRequest><RequestBody/></AuthenticateClientRequest></AuthenticateClient></Body>[\r][\n]"
[2017-09-18 16:38:12,292] DEBUG - wire << "0[\r][\n]"
[2017-09-18 16:38:12,294] DEBUG - wire << "[\r][\n]"
[2017-09-18 16:38:12,305] DEBUG - wire >> "HTTP/1.1 200 OK[\r][\n]"
[2017-09-18 16:38:12,309] DEBUG - wire >> "Host: lux2253.extnp.wd.govt.nz:8243[\r][\n]"
[2017-09-18 16:38:12,313] DEBUG - wire >> "SOAPAction: "http://XXXXXX/AccessControl/AuthenticateClient"[\r][\n]"
[2017-09-18 16:38:12,321] DEBUG - wire >> "Accept-Encoding: gzip,deflate[\r][\n]"
[2017-09-18 16:38:12,325] DEBUG - wire >> "Content-Type: text/xml; charset=UTF-8[\r][\n]"
[2017-09-18 16:38:12,330] DEBUG - wire >> "Date: Mon, 18 Sep 2017 04:38:12 GMT[\r][\n]"
[2017-09-18 16:38:12,334] DEBUG - wire >> "Transfer-Encoding: chunked[\r][\n]"
[2017-09-18 16:38:12,337] DEBUG - wire >> "Connection: Keep-Alive[\r][\n]"
[2017-09-18 16:38:12,341] DEBUG - wire >> "[\r][\n]"
[2017-09-18 16:38:12,343] DEBUG - wire >> "94[\r][\n]"
[2017-09-18 16:38:12,346] DEBUG - wire >> "<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope>[\r][\n]"
[2017-09-18 16:38:12,360] DEBUG - wire >> "0[\r][\n]"
[2017-09-18 16:38:12,362] DEBUG - wire >> "[\r][\n]"
[2017-09-18 16:38:12,364] DEBUG - SynapseCallbackReceiver Callback removed for request message id : urn:uuid:52234a6e-398c-4a19-aa3a-c66eaf170873. Pending callbacks count : 0
[2017-09-18 16:38:12,375] DEBUG - SynapseCallbackReceiver Synapse received an asynchronous response message

1 个答案:

答案 0 :(得分:1)

尝试添加以下属性。

$scope.changetab = function(nav){
    if(nav == 'n')
      $scope.myTabIndex = $scope.myTabIndex +1;
    else
      $scope.myTabIndex = $scope.myTabIndex -1;
}

您还可以添加自定义标头,如此处所述。

https://docs.wso2.com/display/ESB490/Custom+SOAP+Headers