WSO2 中的 Lotus Domino Web 服务通过代理服务
Lotus Domino Web Service in WSO2 Pass Through Proxy Service
我在 WSO2 上为 Lotus Domino Web 服务创建了一个直通代理。
这是该服务的 WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace="urn:DefaultNamespace"
xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="urn:DefaultNamespace" xmlns:intf="urn:DefaultNamespace"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema targetNamespace="urn:DefaultNamespace" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="DODAJNAPIS">
<complexType>
<sequence>
<element name="WST1INPUT1" type="impl:WST1INPUT" />
</sequence>
</complexType>
</element>
<complexType name="WST1INPUT">
<sequence>
<element name="INPUT1" nillable="true" type="xsd:string" />
<element name="INPUT2" nillable="true" type="xsd:string" />
</sequence>
</complexType>
<element name="DODAJNAPISResponse">
<complexType>
<sequence>
<element name="DODAJNAPISReturn" type="impl:WST1OUTPUT" />
</sequence>
</complexType>
</element>
<complexType name="WST1OUTPUT">
<sequence>
<element name="OUTPUT1" nillable="true" type="xsd:string" />
<element name="OUTPUT2" nillable="true" type="xsd:string" />
</sequence>
</complexType>
</schema>
</wsdl:types>
<message name="DODAJNAPISResponse">
<part element="impl:DODAJNAPISResponse" name="parameters" />
</message>
<message name="DODAJNAPISRequest">
<part element="impl:DODAJNAPIS" name="parameters" />
</message>
<portType name="WSO2ProviderClass">
<operation name="DODAJNAPIS">
<input message="impl:DODAJNAPISRequest" name="DODAJNAPISRequest" />
<output message="impl:DODAJNAPISResponse" name="DODAJNAPISResponse" />
</operation>
</portType>
<binding name="DominoSoapBinding" type="impl:WSO2ProviderClass">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="DODAJNAPIS">
<wsdlsoap:operation soapAction="DODAJNAPIS" />
<input name="DODAJNAPISRequest">
<wsdlsoap:body use="literal" />
</input>
<output name="DODAJNAPISResponse">
<wsdlsoap:body use="literal" />
</output>
</operation>
</binding>
<service name="WSO2ProviderClassService">
<port binding="impl:DominoSoapBinding" name="Domino">
<wsdlsoap:address
location="http://firmaa.mis.eu:80/firmaa/b2b/finanse.nsf/WST1?OpenWebService" />
</port>
</service>
</definitions>
此代理的 WSO2 源视图:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="WSO2DominoWrappedTest"
transports="https,http"
statistics="disable"
trace="enable"
startOnLoad="true">
<target>
<outSequence>
<send/>
</outSequence>
<endpoint>
<address uri="http://firmaa.mis.eu/firmaa/b2b/finanse.nsf/WST1?OpenWebService"/>
</endpoint>
</target>
<publishWSDL uri="http://firmaa.mis.eu/firmaa/b2b/finanse.nsf/WST1?WSDL"/>
<description/>
</proxy>
问题出在我尝试测试它时(通过 WSO2 测试面板 (tryit))。测试留言:
<body>
<p:DODAJNAPIS xmlns:p="urn:DefaultNamespace">
<!--Exactly 1 occurrence-->
<WST1INPUT1>
<!--Exactly 1 occurrence-->
<INPUT1>ABC</INPUT1>
<!--Exactly 1 occurrence-->
<INPUT2>DEF</INPUT2>
</WST1INPUT1>
</p:DODAJNAPIS>
</body>
使用 HttpSoap12Endpoint 响应是:
<TryitProxyError xmlns:h="http://wso2.org/ns/TryitProxy" h:status="SOAP envelope error">org.apache.axis2.AxisFault:
Transport level information does not match with SOAP Message namespace URI</TryitProxyError>
使用 HttpSoap11Endpoint 响应是:
<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode>soapenv:Server.generalException</faultcode>
<faultstring>org.xml.sax.SAXParseException: Premature end of file.</faultstring>
<detail/>
</soapenv:Fault>
Mediation Message Tracer 给我这个:
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO Proxy Service WSO2DominoWrappedTest received a new message from : 192.168.7.247
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO Message To: /services/WSO2DominoWrappedTest.WSO2DominoWrappedTestHttpSoap11Endpoint
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO SOAPAction: DODAJNAPIS
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO WSA-Action: DODAJNAPIS
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO Forwarding the message to the anonymous endpoint of the proxy service
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO Sending message through endpoint : null resolving to address = http://firmaa.mis.eu/firmaa/b2b/finanse.nsf/WST1?OpenWebService
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO SOAPAction: DODAJNAPIS
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO WSA-Action: DODAJNAPIS
07:46:13,133 [-] [PassThroughMessageProcessor-48] INFO Start : Sequence <anonymous>
07:46:13,133 [-] [PassThroughMessageProcessor-48] INFO Sequence <SequenceMediator> :: mediate()
07:46:13,133 [-] [PassThroughMessageProcessor-48] INFO Mediation started from mediator position : 0
07:46:13,133 [-] [PassThroughMessageProcessor-48] INFO Start : Send mediator
07:46:13,133 [-] [PassThroughMessageProcessor-48] INFO Sending response message using implicit message properties.. Sending To: http://www.w3.org/2005/08/addressing/anonymous SOAPAction:
07:46:13,133 [-] [PassThroughMessageProcessor-48] INFO End : Send mediator
07:46:13,133 [-] [PassThroughMessageProcessor-48] INFO End : Sequence <anonymous>
在 WSO2 服务器控制台上我得到这个:
[2015-05-13 07:40:21,024] WARN - TargetHandler http-outgoing-128: Receiving res
ponse while the handler is in an inconsistent state REQUEST_READY
[2015-05-13 07:40:21,024] ERROR - TargetHandler Unexpected error.
[2015-05-13 07:40:21,024] WARN - SynapseCallbackReceiver Synapse received a res
ponse for the request with message Id : urn:uuid:b1275096-2ad4-4d2d-92f4-cca5499
027c8 But a callback is not registered (anymore) to process this response
我注意到没有请求到达 Domino WebService(我根据请求记录了输入值,但日志是空的)。
我不知道问题出在哪里,也不知道如何解决它以使其正常工作...您知道如何处理它吗?
请检查在 firmaa/b2b/finanse.nsf 的 ACL 中允许匿名用户时是否有效。那么你需要解决身份验证问题。
进一步查看 WSDL,我认为 WS 在 Domino 服务器上被定义为 LITERATE 格式,查看 http://www.ibm.com/developerworks/lotus/library/nd7-webservices/ 将其更改为 RPC/encoded。
无需任何身份验证即可访问 Domino Web 服务(在 SOAPUI 中我可以毫无问题地对其进行测试)。
我尝试使用 RPC/encoded wsdl :
<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace="urn:DefaultNamespace"
xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="urn:DefaultNamespace" xmlns:intf="urn:DefaultNamespace"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema targetNamespace="urn:DefaultNamespace" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<complexType name="WST1INPUT">
<sequence>
<element name="INPUT1" nillable="true" type="xsd:string" />
<element name="INPUT2" nillable="true" type="xsd:string" />
</sequence>
</complexType>
<complexType name="WST1OUTPUT">
<sequence>
<element name="OUTPUT1" nillable="true" type="xsd:string" />
<element name="OUTPUT2" nillable="true" type="xsd:string" />
</sequence>
</complexType>
</schema>
</wsdl:types>
<message name="DODAJNAPISResponse">
<part name="DODAJNAPISReturn" type="impl:WST1OUTPUT" />
</message>
<message name="DODAJNAPISRequest">
<part name="WST1INPUT1" type="impl:WST1INPUT" />
</message>
<portType name="WSO2ProviderClass">
<operation name="DODAJNAPIS" parameterOrder="WST1INPUT1">
<input message="impl:DODAJNAPISRequest" name="DODAJNAPISRequest" />
<output message="impl:DODAJNAPISResponse" name="DODAJNAPISResponse" />
</operation>
</portType>
<binding name="DominoSoapBinding" type="impl:WSO2ProviderClass">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="DODAJNAPIS">
<wsdlsoap:operation soapAction="DODAJNAPIS" />
<input name="DODAJNAPISRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:DefaultNamespace" use="encoded" />
</input>
<output name="DODAJNAPISResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:DefaultNamespace" use="encoded" />
</output>
</operation>
</binding>
<service name="WSO2ProviderClassService">
<port binding="impl:DominoSoapBinding" name="Domino">
<wsdlsoap:address
location="http://firmaa.mis.eu:80/firmaa/b2b/finanse.nsf/WST1?OpenWebService" />
</port>
</service>
</definitions>
但得到相同的 SAXParserException:文件过早结束。
在 WSO2 控制台上出现与以前相同的警告和错误。
我为此 Domino Web 服务编写了一些 java "wrapper" 服务。我发现,我必须设置
options.setProperty(HTTPConstants.CHUNKED, "false");
让这个包装器正常工作。在我得到相同的 SAXParserException 之前。是否有任何 WSO2 属性 将 HTTPConstants.CHUNKED 设置为 false?
已解决。我在 inSequence:
中使用 属性 创建了自定义代理(不是 Passthrough!)
<inSequence>
<property name="FORCE_HTTP_1.0" value="true" scope="axis2"/>
</inSequence>
然后一切正常:)
我在 WSO2 上为 Lotus Domino Web 服务创建了一个直通代理。 这是该服务的 WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace="urn:DefaultNamespace"
xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="urn:DefaultNamespace" xmlns:intf="urn:DefaultNamespace"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema targetNamespace="urn:DefaultNamespace" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="DODAJNAPIS">
<complexType>
<sequence>
<element name="WST1INPUT1" type="impl:WST1INPUT" />
</sequence>
</complexType>
</element>
<complexType name="WST1INPUT">
<sequence>
<element name="INPUT1" nillable="true" type="xsd:string" />
<element name="INPUT2" nillable="true" type="xsd:string" />
</sequence>
</complexType>
<element name="DODAJNAPISResponse">
<complexType>
<sequence>
<element name="DODAJNAPISReturn" type="impl:WST1OUTPUT" />
</sequence>
</complexType>
</element>
<complexType name="WST1OUTPUT">
<sequence>
<element name="OUTPUT1" nillable="true" type="xsd:string" />
<element name="OUTPUT2" nillable="true" type="xsd:string" />
</sequence>
</complexType>
</schema>
</wsdl:types>
<message name="DODAJNAPISResponse">
<part element="impl:DODAJNAPISResponse" name="parameters" />
</message>
<message name="DODAJNAPISRequest">
<part element="impl:DODAJNAPIS" name="parameters" />
</message>
<portType name="WSO2ProviderClass">
<operation name="DODAJNAPIS">
<input message="impl:DODAJNAPISRequest" name="DODAJNAPISRequest" />
<output message="impl:DODAJNAPISResponse" name="DODAJNAPISResponse" />
</operation>
</portType>
<binding name="DominoSoapBinding" type="impl:WSO2ProviderClass">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="DODAJNAPIS">
<wsdlsoap:operation soapAction="DODAJNAPIS" />
<input name="DODAJNAPISRequest">
<wsdlsoap:body use="literal" />
</input>
<output name="DODAJNAPISResponse">
<wsdlsoap:body use="literal" />
</output>
</operation>
</binding>
<service name="WSO2ProviderClassService">
<port binding="impl:DominoSoapBinding" name="Domino">
<wsdlsoap:address
location="http://firmaa.mis.eu:80/firmaa/b2b/finanse.nsf/WST1?OpenWebService" />
</port>
</service>
</definitions>
此代理的 WSO2 源视图:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="WSO2DominoWrappedTest"
transports="https,http"
statistics="disable"
trace="enable"
startOnLoad="true">
<target>
<outSequence>
<send/>
</outSequence>
<endpoint>
<address uri="http://firmaa.mis.eu/firmaa/b2b/finanse.nsf/WST1?OpenWebService"/>
</endpoint>
</target>
<publishWSDL uri="http://firmaa.mis.eu/firmaa/b2b/finanse.nsf/WST1?WSDL"/>
<description/>
</proxy>
问题出在我尝试测试它时(通过 WSO2 测试面板 (tryit))。测试留言:
<body>
<p:DODAJNAPIS xmlns:p="urn:DefaultNamespace">
<!--Exactly 1 occurrence-->
<WST1INPUT1>
<!--Exactly 1 occurrence-->
<INPUT1>ABC</INPUT1>
<!--Exactly 1 occurrence-->
<INPUT2>DEF</INPUT2>
</WST1INPUT1>
</p:DODAJNAPIS>
</body>
使用 HttpSoap12Endpoint 响应是:
<TryitProxyError xmlns:h="http://wso2.org/ns/TryitProxy" h:status="SOAP envelope error">org.apache.axis2.AxisFault:
Transport level information does not match with SOAP Message namespace URI</TryitProxyError>
使用 HttpSoap11Endpoint 响应是:
<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode>soapenv:Server.generalException</faultcode>
<faultstring>org.xml.sax.SAXParseException: Premature end of file.</faultstring>
<detail/>
</soapenv:Fault>
Mediation Message Tracer 给我这个:
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO Proxy Service WSO2DominoWrappedTest received a new message from : 192.168.7.247
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO Message To: /services/WSO2DominoWrappedTest.WSO2DominoWrappedTestHttpSoap11Endpoint
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO SOAPAction: DODAJNAPIS
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO WSA-Action: DODAJNAPIS
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO Forwarding the message to the anonymous endpoint of the proxy service
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO Sending message through endpoint : null resolving to address = http://firmaa.mis.eu/firmaa/b2b/finanse.nsf/WST1?OpenWebService
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO SOAPAction: DODAJNAPIS
07:46:13,071 [-] [PassThroughMessageProcessor-46] INFO WSA-Action: DODAJNAPIS
07:46:13,133 [-] [PassThroughMessageProcessor-48] INFO Start : Sequence <anonymous>
07:46:13,133 [-] [PassThroughMessageProcessor-48] INFO Sequence <SequenceMediator> :: mediate()
07:46:13,133 [-] [PassThroughMessageProcessor-48] INFO Mediation started from mediator position : 0
07:46:13,133 [-] [PassThroughMessageProcessor-48] INFO Start : Send mediator
07:46:13,133 [-] [PassThroughMessageProcessor-48] INFO Sending response message using implicit message properties.. Sending To: http://www.w3.org/2005/08/addressing/anonymous SOAPAction:
07:46:13,133 [-] [PassThroughMessageProcessor-48] INFO End : Send mediator
07:46:13,133 [-] [PassThroughMessageProcessor-48] INFO End : Sequence <anonymous>
在 WSO2 服务器控制台上我得到这个:
[2015-05-13 07:40:21,024] WARN - TargetHandler http-outgoing-128: Receiving res
ponse while the handler is in an inconsistent state REQUEST_READY
[2015-05-13 07:40:21,024] ERROR - TargetHandler Unexpected error.
[2015-05-13 07:40:21,024] WARN - SynapseCallbackReceiver Synapse received a res
ponse for the request with message Id : urn:uuid:b1275096-2ad4-4d2d-92f4-cca5499
027c8 But a callback is not registered (anymore) to process this response
我注意到没有请求到达 Domino WebService(我根据请求记录了输入值,但日志是空的)。
我不知道问题出在哪里,也不知道如何解决它以使其正常工作...您知道如何处理它吗?
请检查在 firmaa/b2b/finanse.nsf 的 ACL 中允许匿名用户时是否有效。那么你需要解决身份验证问题。
进一步查看 WSDL,我认为 WS 在 Domino 服务器上被定义为 LITERATE 格式,查看 http://www.ibm.com/developerworks/lotus/library/nd7-webservices/ 将其更改为 RPC/encoded。
无需任何身份验证即可访问 Domino Web 服务(在 SOAPUI 中我可以毫无问题地对其进行测试)。 我尝试使用 RPC/encoded wsdl :
<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace="urn:DefaultNamespace"
xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="urn:DefaultNamespace" xmlns:intf="urn:DefaultNamespace"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema targetNamespace="urn:DefaultNamespace" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<complexType name="WST1INPUT">
<sequence>
<element name="INPUT1" nillable="true" type="xsd:string" />
<element name="INPUT2" nillable="true" type="xsd:string" />
</sequence>
</complexType>
<complexType name="WST1OUTPUT">
<sequence>
<element name="OUTPUT1" nillable="true" type="xsd:string" />
<element name="OUTPUT2" nillable="true" type="xsd:string" />
</sequence>
</complexType>
</schema>
</wsdl:types>
<message name="DODAJNAPISResponse">
<part name="DODAJNAPISReturn" type="impl:WST1OUTPUT" />
</message>
<message name="DODAJNAPISRequest">
<part name="WST1INPUT1" type="impl:WST1INPUT" />
</message>
<portType name="WSO2ProviderClass">
<operation name="DODAJNAPIS" parameterOrder="WST1INPUT1">
<input message="impl:DODAJNAPISRequest" name="DODAJNAPISRequest" />
<output message="impl:DODAJNAPISResponse" name="DODAJNAPISResponse" />
</operation>
</portType>
<binding name="DominoSoapBinding" type="impl:WSO2ProviderClass">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="DODAJNAPIS">
<wsdlsoap:operation soapAction="DODAJNAPIS" />
<input name="DODAJNAPISRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:DefaultNamespace" use="encoded" />
</input>
<output name="DODAJNAPISResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:DefaultNamespace" use="encoded" />
</output>
</operation>
</binding>
<service name="WSO2ProviderClassService">
<port binding="impl:DominoSoapBinding" name="Domino">
<wsdlsoap:address
location="http://firmaa.mis.eu:80/firmaa/b2b/finanse.nsf/WST1?OpenWebService" />
</port>
</service>
</definitions>
但得到相同的 SAXParserException:文件过早结束。 在 WSO2 控制台上出现与以前相同的警告和错误。
我为此 Domino Web 服务编写了一些 java "wrapper" 服务。我发现,我必须设置
options.setProperty(HTTPConstants.CHUNKED, "false");
让这个包装器正常工作。在我得到相同的 SAXParserException 之前。是否有任何 WSO2 属性 将 HTTPConstants.CHUNKED 设置为 false?
已解决。我在 inSequence:
中使用 属性 创建了自定义代理(不是 Passthrough!)<inSequence>
<property name="FORCE_HTTP_1.0" value="true" scope="axis2"/>
</inSequence>
然后一切正常:)