在 WebLogic (Spring) Web 服务上使用 WSO2 ESB PassThrough 代理 [英] Using WSO2 ESB PassThrough Proxy on WebLogic (Spring) Web Service

查看:24
本文介绍了在 WebLogic (Spring) Web 服务上使用 WSO2 ESB PassThrough 代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试过 PassThroughu 代理教程,并且所有这些都适用于在 Axis (Apache CFX) 上部署目标 Web 服务的内置示例.在 WSO2 ESB 上使用TryIt"很好地测试了源和代理 Web 服务.

I have tried PassThroughu proxy tutorials and all works with build in example where Target Web Service is deployed on Axis (Apache CFX). Source and Proxy Web Service nicely gets tested using "TryIt" on WSO2 ESB.

现在不同的故事 - 我尝试使用非常简单的 Weblogic Spring Web 服务来实现相同的目标(我不相信使用 Spring 和自下而上的方法和注释很重要).它部署在 WebLogic 服务器上(与 WSO2 ESB 在同一主机上运行).不包含任何特殊的 WS-* 扩展.这几乎就是 hello world Web 服务.我可以轻松测试 SoapUi、UniversalTestClient (WebLogic) 并在浏览器中查看 WSDL.

Now different story - I try to achieve the same using very simple Weblogic Spring Web Service (i don't believe usage of Spring and bottom-up approach and annotations matter). It's deployed on the WebLogic server (running on the same host as WSO2 ESB). No any special WS-* extension included. It's almost hello world web service. I can easily test test it SoapUi, UniversalTestClient (WebLogic) and see WSDL in browser.

关于生成的代理 PassThrough Web 服务(遵循教程中的相同步骤)我还可以看到生成的 WSDL:

Regarding generated proxy PassThrough Web Service (followed same steps from tutorial) I can also see generated WSDL:

http://localhost:8280/services/WebServiceAServicePassThroughProxy?wsdl

然而,SoapUI 和 TryIt 都不起作用,并且都返回 FaultString:

However neither SoapUI nor TryIt work and both return FaultString:

The endpoint reference (EPR) for the Operation not found is /services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpSoap11Endpoint and the WSA Action = . If this EPR was previously reachable, please contact the server administrator.

这是我用来测试findContactById"的函数:

Here is function I used for testing "findContactById":

 <body>
   <p:findContactById xmlns:p="http://webservicea.testtoold.xx.yy.zz.eu/">
      <!--Exactly 1 occurrence-->
      <arg0>1</arg0>
   </p:findContactById>
</body>

在代理 Web 服务上运行.我尝试了在代理 Web 服务中生成的所有端点,错误与上述相同,除非我从下拉列表中尝试 httpEndpoint:

which operates on Proxy Web Service. I tried all endpoints that were generated in proxy web service, error is same as above unless if I try httpEndpoint from drop down:

http://localhost:8280/services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpEndpoint 

然后我得到不支持的媒体类型为 TryItProxyError.

then I get Unsupported Media Type as TryItProxyError.

任何人都请帮忙,我对此很生气...应该很简单,而不是噩梦.搜索了所有网络,我看到了几个没有答案的类似问题.

Anyone please help, I am getting nuts with this... should be simple, not the nightmare. Searched all web i saw few similar questions with no answers.

WebLogic 服务 WSDL:

WebLogic Service WSDL:

<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.8-b13937 svn-revision#13942. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.8-b13937 svn-revision#13942. --><definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservicea.testtoold.xx.yy.zz.eu/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://webservicea.testtoold.xx.yy.zz.eu/" name="WebServiceAService">
<types>
  <xsd:schema>
    <xsd:import namespace="http://webservicea.testtoold.xx.yy.zz.eu/" schemaLocation="http://localhost:7001/TestToolD/WebServiceAService?xsd=1"/>
  </xsd:schema>
</types>
<message name="findContactById">
  <part name="parameters" element="tns:findContactById"/>
</message>
<message name="findContactByIdResponse">
  <part name="parameters" element="tns:findContactByIdResponse"/>
</message>
<message name="Exception">
  <part name="fault" element="tns:Exception"/>
</message>
<message name="findAllContacts">
  <part name="parameters" element="tns:findAllContacts"/>
</message>
<message name="findAllContactsResponse">
  <part name="parameters" element="tns:findAllContactsResponse"/>
</message>
<portType name="WebServiceA">
  <operation name="findContactById">
    <input wsam:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findContactByIdRequest" message="tns:findContactById"/>
    <output wsam:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findContactByIdResponse" message="tns:findContactByIdResponse"/>
    <fault message="tns:Exception" name="Exception" wsam:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findContactById/Fault/Exception"/>
  </operation>
  <operation name="findAllContacts">
    <input wsam:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findAllContactsRequest" message="tns:findAllContacts"/>
    <output wsam:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findAllContactsResponse" message="tns:findAllContactsResponse"/>
    <fault message="tns:Exception" name="Exception" wsam:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findAllContacts/Fault/Exception"/>
  </operation>
</portType>
<binding name="WebServiceAPortBinding" type="tns:WebServiceA">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
  <operation name="findContactById">
    <soap:operation soapAction=""/>
    <input>
      <soap:body use="literal"/>
    </input>
    <output>
      <soap:body use="literal"/>
    </output>
    <fault name="Exception">
      <soap:fault name="Exception" use="literal"/>
    </fault>
  </operation>
  <operation name="findAllContacts">
    <soap:operation soapAction=""/>
    <input>
      <soap:body use="literal"/>
    </input>
    <output>
      <soap:body use="literal"/>
    </output>
    <fault name="Exception">
      <soap:fault name="Exception" use="literal"/>
    </fault>
  </operation>
</binding>
<service name="WebServiceAService">
  <port name="WebServiceAPort" binding="tns:WebServiceAPortBinding">
    <soap:address location="http://localhost:7001/TestToolD/WebServiceAService"/>
  </port>
</service>
</definitions>

WSO ESB 生成的 PassThroughProxy.wsdl

WSO ESB Generated PassThroughProxy.wsdl

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:tns="http://webservicea.testtoold.xx.yy.zz.eu/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://webservicea.testtoold.xx.yy.zz.eu/">
   <wsdl:types>
      <xsd:schema attributeFormDefault="unqualified" elementFormDefault="unqualified">
         <xsd:import namespace="http://webservicea.testtoold.xx.yy.zz.eu/" schemaLocation="WebServiceAServicePassThroughProxy?xsd=http://localhost:7001/TestToolD/WebServiceAService?xsd=1.xsd"></xsd:import>
      </xsd:schema>
   </wsdl:types>
   <wsdl:message name="findContactById">
      <wsdl:part name="parameters" element="tns:findContactById"></wsdl:part>
   </wsdl:message>
   <wsdl:message name="findContactByIdResponse">
      <wsdl:part name="parameters" element="tns:findContactByIdResponse"></wsdl:part>
   </wsdl:message>
   <wsdl:message name="findAllContacts">
      <wsdl:part name="parameters" element="tns:findAllContacts"></wsdl:part>
   </wsdl:message>
   <wsdl:message name="findAllContactsResponse">
      <wsdl:part name="parameters" element="tns:findAllContactsResponse"></wsdl:part>
   </wsdl:message>
   <wsdl:portType name="WebServiceAServicePassThroughProxyPortType">
      <wsdl:operation name="findContactById">
         <wsdl:input message="tns:findContactById"></wsdl:input>
         <wsdl:output message="tns:findContactByIdResponse" wsaw:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findContactByIdResponse"></wsdl:output>
         <wsdl:fault message="tns:Exception" name="Exception" wsaw:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findContactById/Fault/Exception"></wsdl:fault>
      </wsdl:operation>
      <wsdl:operation name="findAllContacts">
         <wsdl:input message="tns:findAllContacts"></wsdl:input>
         <wsdl:output message="tns:findAllContactsResponse" wsaw:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findAllContactsResponse"></wsdl:output>
         <wsdl:fault message="tns:Exception" name="Exception" wsaw:Action="http://webservicea.testtoold.xx.yy.zz.eu/WebServiceA/findAllContacts/Fault/Exception"></wsdl:fault>
      </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="WebServiceAServicePassThroughProxySoap11Binding" type="tns:WebServiceAServicePassThroughProxyPortType">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding>
      <wsdl:operation name="findContactById">
         <soap:operation soapAction="" style="document"></soap:operation>
         <wsdl:input>
            <soap:body use="literal"></soap:body>
         </wsdl:input>
         <wsdl:output>
            <soap:body use="literal"></soap:body>
         </wsdl:output>
         <wsdl:fault name="Exception">
            <soap:fault use="literal" name="Exception"></soap:fault>
         </wsdl:fault>
      </wsdl:operation>
      <wsdl:operation name="findAllContacts">
         <soap:operation soapAction="" style="document"></soap:operation>
         <wsdl:input>
            <soap:body use="literal"></soap:body>
         </wsdl:input>
         <wsdl:output>
            <soap:body use="literal"></soap:body>
         </wsdl:output>
         <wsdl:fault name="Exception">
            <soap:fault use="literal" name="Exception"></soap:fault>
         </wsdl:fault>
      </wsdl:operation>
   </wsdl:binding>
   <wsdl:binding name="WebServiceAServicePassThroughProxySoap12Binding" type="tns:WebServiceAServicePassThroughProxyPortType">
      <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap12:binding>
      <wsdl:operation name="findContactById">
         <soap12:operation soapAction="" style="document"></soap12:operation>
         <wsdl:input>
            <soap12:body use="literal"></soap12:body>
         </wsdl:input>
         <wsdl:output>
            <soap12:body use="literal"></soap12:body>
         </wsdl:output>
         <wsdl:fault name="Exception">
            <soap12:fault use="literal" name="Exception"></soap12:fault>
         </wsdl:fault>
      </wsdl:operation>
      <wsdl:operation name="findAllContacts">
         <soap12:operation soapAction="" style="document"></soap12:operation>
         <wsdl:input>
            <soap12:body use="literal"></soap12:body>
         </wsdl:input>
         <wsdl:output>
            <soap12:body use="literal"></soap12:body>
         </wsdl:output>
         <wsdl:fault name="Exception">
            <soap12:fault use="literal" name="Exception"></soap12:fault>
         </wsdl:fault>
      </wsdl:operation>
   </wsdl:binding>
   <wsdl:binding name="WebServiceAServicePassThroughProxyHttpBinding" type="tns:WebServiceAServicePassThroughProxyPortType">
      <http:binding verb="POST"></http:binding>
      <wsdl:operation name="findContactById">
         <http:operation location="findContactById"></http:operation>
         <wsdl:input>
            <mime:content type="text/xml" part="parameters"></mime:content>
         </wsdl:input>
         <wsdl:output>
            <mime:content type="text/xml" part="parameters"></mime:content>
         </wsdl:output>
      </wsdl:operation>
      <wsdl:operation name="findAllContacts">
         <http:operation location="findAllContacts"></http:operation>
         <wsdl:input>
            <mime:content type="text/xml" part="parameters"></mime:content>
         </wsdl:input>
         <wsdl:output>
            <mime:content type="text/xml" part="parameters"></mime:content>
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="WebServiceAServicePassThroughProxy">
      <wsdl:port name="WebServiceAServicePassThroughProxyHttpsSoap11Endpoint" binding="tns:WebServiceAServicePassThroughProxySoap11Binding">
         <soap:address location="https://supercomputer:8243/services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpsSoap11Endpoint"></soap:address>
      </wsdl:port>
      <wsdl:port name="WebServiceAServicePassThroughProxyHttpSoap11Endpoint" binding="tns:WebServiceAServicePassThroughProxySoap11Binding">
         <soap:address location="http://supercomputer:8280/services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpSoap11Endpoint"></soap:address>
      </wsdl:port>
      <wsdl:port name="WebServiceAServicePassThroughProxyHttpSoap12Endpoint" binding="tns:WebServiceAServicePassThroughProxySoap12Binding">
         <soap12:address location="http://supercomputer:8280/services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpSoap12Endpoint"></soap12:address>
      </wsdl:port>
      <wsdl:port name="WebServiceAServicePassThroughProxyHttpsSoap12Endpoint" binding="tns:WebServiceAServicePassThroughProxySoap12Binding">
         <soap12:address location="https://supercomputer:8243/services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpsSoap12Endpoint"></soap12:address>
      </wsdl:port>
      <wsdl:port name="WebServiceAServicePassThroughProxyHttpsEndpoint" binding="tns:WebServiceAServicePassThroughProxyHttpBinding">
         <http:address location="https://supercomputer:8243/services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpsEndpoint"></http:address>
      </wsdl:port>
      <wsdl:port name="WebServiceAServicePassThroughProxyHttpEndpoint" binding="tns:WebServiceAServicePassThroughProxyHttpBinding">
         <http:address location="http://supercomputer:8280/services/WebServiceAServicePassThroughProxy.WebServiceAServicePassThroughProxyHttpEndpoint"></http:address>
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>

一些小评论:

  • 本地主机和超级计算机的差异不是原因 - 教程适用于此类差异
  • 我尝试了很多方法(在注册表中或本地创建端点,在创建代理时是否提供 WSDL 等,但我总是遇到相同的错误).
  • 我已经删减了 30% 的代码行以简化 WSDL(保存和删除功能)以达到允许的帖子大小.
  • 尝试添加动作名称但没有区别(保留没有它们的示例)

推荐答案

自 ESB 4.6 起,默认启用 pass-through 传输 : The message body is not build so, SOAP Body based dispatching is not supported (can't useSOAP 体元素的第一个子节点来确定操作).

Since ESB 4.6, pass-through transport is enabled by default : The message body is not build so, SOAP Body based dispatching is not supported (can't use the first child node of SOAP body element to determine the operation).

这种情况下的错误是 未找到操作的端点引用 (EPR) 是...

在你的情况下,你不能使用 SOAPAction(它是空白的),但你可以:

In your case, you can't use SOAPAction (it's blank), but you can :

  • 将操作名称附加到端点 URL

或者,从 ESB 4.8 开始:

Or, since ESB 4.8 :

  • 在proxy conf中添加这个参数:

修改repository/conf/axis2中的axis2.xml conf替换

modify axis2.xml conf in repository/conf/axis2 replacing

<handler class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher" name="SOAPMessageBodyBasedDispatcher"/>

<handler class="org.apache.synapse.core.axis2.SynapseSOAPMessageBodyBasedDispatcher" name="SOAPMessageBodyBasedDispatcher"/>

这篇关于在 WebLogic (Spring) Web 服务上使用 WSO2 ESB PassThrough 代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆