繁体   English   中英

对使用curl而不是python的wso2 ESB的Soap请求

[英]Soap request to wso2 ESB working with curl, not with python

我有一个奇怪的问题。 通过使用curl发送肥皂请求来添加ESB连接器时,该连接器已成功添加。 当我使用python发送相同的消息时,出现此奇怪的错误。 我想念什么?

卷曲命令:

curl --basic -u admin:admin -H "Content-Type: application/soap+xml" -k -d @request.xml https://localhost:9443/services/MediationLibraryAdminService.MediationLibraryAdminServiceHttpsSoap12Endpoint

curl命令后的ESB日志:

[2015-03-20 06:09:05,154]  INFO - CarbonAuthenticationUtil 'admin@carbon.super [-1234]' logged in at [2015-03-20 06:09:05,154-0600]
[2015-03-20 06:09:05,156]  INFO - SynapseImportFactory Successfully created Synapse Import: kafka

这是python代码:

   SoapMessage = SOAP_MESSAGE.encode('utf-8')
    url = 'https://localhost:9443/services/MediationLibraryAdminService.MediationLibraryAdminServiceHttpsSoap12Endpoint'
    headers = {'content-type': 'application/soap+xml; charset=UTF-8',
            "Content-Length": len(SoapMessage),
            "SOAPAction": url}
    r = requests.post(url, data=SoapMessage, headers=headers, verify=False, auth=HTTPBasicAuth('admin', 'admin'))

python命令后的ESB日志:

[2015-03-20 06:27:59,346]  INFO - CarbonAuthenticationUtil 'admin@carbon.super [-1234]' logged in at [2015-03-20 06:27:59,345-0600]
[2015-03-20 06:28:08,317]  INFO - LibraryArtifactDeployer Synapse Library named '{org.wso2.carbon.connector}kafka' has been deployed from file : /opt/$
[2015-03-20 06:28:08,318] ERROR - MediatorFactoryFinder Unknown mediator referenced by configuration element : {http://ws.apache.org/ns/synapse}kafka
[2015-03-20 06:28:08,318]  WARN - ProxyServiceDeployer Proxy service hot deployment from file: /opt/wso2esb/wso2esb-4.8.0/repository/deployment/server$
org.apache.synapse.SynapseException: Unknown mediator referenced by configuration element : {http://ws.apache.org/ns/synapse}kafka
        at org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator(MediatorFactoryFinder.java:218)
        at org.apache.synapse.config.xml.AbstractListMediatorFactory.addChildren(AbstractListMediatorFactory.java:41)
        at org.apache.synapse.config.xml.SequenceMediatorFactory.createAnonymousSequence(SequenceMediatorFactory.java:70)
        at org.apache.synapse.config.xml.ProxyServiceFactory.createProxy(ProxyServiceFactory.java:178)
        at org.apache.synapse.deployers.ProxyServiceDeployer.deploySynapseArtifact(ProxyServiceDeployer.java:58)
        at org.wso2.carbon.proxyadmin.ProxyServiceDeployer.deploySynapseArtifact(ProxyServiceDeployer.java:46)
        at org.apache.synapse.deployers.AbstractSynapseArtifactDeployer.deploy(AbstractSynapseArtifactDeployer.java:190)
        at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
        at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:807)
        at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
        at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377)
        at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254)
        at org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:371)
        at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:59)
        at org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:67)
        at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.runAxisDeployment(CarbonDeploymentSchedulerTask.java:79)
        at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.run(CarbonDeploymentSchedulerTask.java:124)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:701)

肥皂留言

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://org.apache.synapse/xsd">
<soap:Header/>
<soap:Body>
        <xsd:updateStatus>
                <xsd:libQName>{org.wso2.carbon.connector}kafka</xsd:libQName>
                <xsd:libName>kafka</xsd:libName>
                <xsd:packageName>org.wso2.carbon.connector</xsd:packageName>
                <xsd:status>enabled</xsd:status>
        </xsd:updateStatus>
</soap:Body>

所以问题是我在</soap:Body>之后输入了回车</soap:Body> 这导致服务崩溃。 卸下回车可解决问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM