WSO2 ESB:自定义URL

时间:2015-08-19 13:48:27

标签: soap wso2 wso2esb ws-security custom-url

我使用自定义网址创建了我的代理,基于:

http://wso2.com/library/knowledge-base/2011/01/custom-urls-wso2-esb-proxy-services/

使用我的SOAP消息调用此自定义URL会导致错误,我仍然可以使用原始URL。

custom:/ services / wss / PlanningOphaalServiceProxy_v1 original:/ services / PlanningOphaalServiceProxy_v1

错误:

TID: [0] [ESB] [2015-08-19 15:47:05,039] ERROR {org.apache.axis2.engine.AxisEngine} -  InvalidSecurity {org.apache.axis2.engine.AxisEngine}
org.apache.axis2.AxisFault: InvalidSecurity
        at org.apache.rampart.handler.PostDispatchVerificationHandler.invoke(PostDispatchVerificationHandler.java:151)
        at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
        at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:167)
        at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:411)
        at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:183)
        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
TID: [0] [ESB] [2015-08-19 15:47:05,041] ERROR {org.apache.synapse.transport.passthru.ServerWorker} -  Error processing POST request for : /services/wss/PlanningOphaalServiceProxy_v1 {org.apache.synapse.transport.passthru.ServerWorker}
org.apache.axis2.AxisFault: InvalidSecurity

2 个答案:

答案 0 :(得分:1)

解决:这是不可能的。根据WSO2支持

,CustomURI不能与WS-Security结合使用

答案 1 :(得分:0)

我尝试了自定义URI,并在添加了在axis2.xml中调度的自定义后正常工作

下面是我的代理的URI

http://localhost:8280/GenericProxy

和代理代码如下:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="CustomProxy"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>
         <property name="messageType"
                   value="application/xml"
                   scope="default"
                   type="STRING"/>
         <log level="full">
            <property name="################## Body - In Seq###################"
                      expression="$body"/>
         </log>
         <send>
            <endpoint>
               <address uri="http://localhost:8090/services/OracleStoredProcedure.SOAP12Endpoint/"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <log level="full">
            <property name="############## Res Seq ############" value="Response"/>
         </log>
      </outSequence>
   </target>
   <parameter name="ServiceURI">/GenericProxy</parameter>
   <description/>
</proxy>

并记录如下

[2015-08-21 16:35:25,173]  INFO - ProxyService Successfully created the Axis2 se
rvice for Proxy service : CustomProxy
[2015-08-21 16:35:41,405]  INFO - LogMediator To: /GenericProxy, MessageID: urn:
uuid:8e35439e-4d28-95be-4e25eb385843, Direction: request, #################
# Body - In Seq################### = <soapenv:Body xmlns:soapenv="http://schemas
.xmlsoap.org/soap/envelope/"><emp>
<ID>sample</ID>
</emp></soapenv:Body>, Envelope: <?xml version="1.0" encoding="utf-8"?><soapenv:
Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body
><emp>
<ID>sample</ID>
</emp></soapenv:Body></soapenv:Envelope>
[2015-08-21 16:35:42,200]  INFO - LogMediator To: http://www.w3.org/2005/08/addr
essing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:0431fb5f-4b03-47
41-727bdb3637d8, Direction: response, ############## Res Seq ############ =
 Response, Envelope: <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xml
ns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:En
velope>