我正在尝试从retrieveTenants
访问TenantMgtAdminService
方法。
为此,我在EI 6.6.0中使用以下代码创建了自定义代理:
<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="http://ws.apache.org/ns/synapse" name="Proxy_RetrieveTenants" startOnLoad="true" statistics="disable" trace="disable" transports="http,https">
<target>
<inSequence>
<property name="POST_TO_URI" scope="axis2" value="true"/>
<property xmlns:ns="http://org.apache.synapse/xsd" expression="fn:concat('Basic ', base64Encode('ws.palmsoft:YWRtaW46YWRtaW4'))" name="Authorization" scope="transport"/>
<call>
<endpoint>
<wsdl uri="https://localhost:9443/services/TenantMgtAdminService.TenantMgtAdminServiceHttpsSoap12Endpoint HTTP/1.1"/>
<property name="action" scope="axis2" value="urn:retrieveTenants"/>
<property name="Host" scope="axis2" value="localhost:9443"/>
<property name="Content-Type" scope="axis2" value="application/soap+xml"/>
</endpoint>
</call>
</inSequence>
<outSequence>
<call/>
</outSequence>
<faultSequence/>
</target>
<description/>
</proxy>
当我尝试代理时,出现以下错误:
[2020-03-16 12:33:49,874] ERROR {org.apache.axis2.description.ClientUtils} - The system cannot infer the transport information from the /services/Proxy_RetrieveTenants.Proxy_RetrieveTenantsHttpSoap12Endpoint URL.
[2020-03-16 12:33:49,877] ERROR {org.apache.synapse.core.axis2.Axis2Sender} - Unexpected error during sending message out org.apache.axis2.AxisFault: The system cannot infer the transport information from the /services/Proxy_RetrieveTenants.Proxy_RetrieveTenantsHttpSoap12Endpoint URL.
我可以通过SoapUI访问相同的方法。
请问我的代理有什么问题?
思考 埃里科
答案 0 :(得分:1)
您能否按照以下说明修改代理服务,然后重试。
<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="http://ws.apache.org/ns/synapse" name="Proxy_RetrieveTenants" startOnLoad="true" statistics="disable" trace="disable" transports="http,https">
<target>
<inSequence>
<property name="POST_TO_URI" scope="axis2" value="true"/>
<property xmlns:ns="http://org.apache.synapse/xsd" expression="fn:concat('Basic ', base64Encode('admin:admin'))" name="Authorization" scope="transport"/>
<property name="ContentType" scope="axis2" value="text/xml"/>
<property name="SOAPAction" scope="transport" value="urn:retrieveTenants"/>
<payloadFactory media-type="xml">
<format>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ser="http://services.mgt.tenant.carbon.wso2.org">
<soap:Header/>
<soap:Body>
<ser:retrieveTenants/>
</soap:Body>
</soap:Envelope>
</format>
<args/>
</payloadFactory>
<call>
<endpoint>
<address format="soap12" uri="https://localhost:9443/services/TenantMgtAdminService.TenantMgtAdminServiceHttpsSoap12Endpoint"/>
</endpoint>
</call>
<respond/>
</inSequence>
<outSequence>
<send/>
</outSequence>
<faultSequence/>
</target>
<description/>