How to send a soap request(xml) to soap service using wso2 proxy service

白昼怎懂夜的黑 提交于 2019-12-02 15:03:14

问题


I am new to wso2

I have created a Custom Proxy Service to call a backend Soap Service... I need to POST a Soap XML request to back end service,using a proxy service.. I am using REST CLIENT (Mozilla firefox addon) for calling my proxy service

I put the method as POST and content type as text/xml

Below is my proxy service configuration

<target>
    <inSequence>
        <property name="messageType" value="text/xml" scope="axis2" type="STRING"/>
    </inSequence>
    <outSequence>
        <send/>
    </outSequence>
    <faultSequence>
        <log level="full">
            <property name="MESSAGE" value="Executing default &quot;fault&quot; sequence"/>
            <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
            <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
        </log>
    </faultSequence>
    <endpoint>
        <address uri="Soap Service URL"/>
    </endpoint>
</target>

Here is my REQUEST(Rest Client Body) that i passed thru proxy service

<?xml version="1.0" encoding="utf-8"?>
<UserLogin xmlns="http://tempuri.org/">
<LoginID>xxx</LoginID>
<Password>xxx</Password>
</UserLogin>

But i am getting the following error

[2014-03-14 18:01:51,443]  WARN {SERVICE_LOGGER.FilterMediatorProxy} -  Executing fault handler due to exception encountered
[2014-03-14 18:01:51,444]  WARN {SERVICE_LOGGER.FilterMediatorProxy} -  ERROR_CODE : 0 ERROR_MESSAGE : Unexpected error during sending message out
[2014-03-14 18:01:51,445]  INFO {SERVICE_LOGGER.FilterMediatorProxy} -  FaultHandler executing impl: org.apache.synapse.mediators.MediatorFaultHandler
[2014-03-14 18:01:51,445]  WARN {SERVICE_LOGGER.FilterMediatorProxy} -  Executing fault sequence mediator : org.apache.synapse.mediators.base.SequenceMediator
[2014-03-14 18:01:51,445]  INFO {SERVICE_LOGGER.FilterMediatorProxy} -  To: http://10.132.97.131:9763/services/FilterMediatorProxy.FilterMediatorProxyHttpEndpoint/, 
From: 10.132.97.131, Direction: request, MESSAGE = Executing default "fault" sequence, 
ERROR_CODE = 0, ERROR_MESSAGE = Unexpected error during sending message out, Envelope: 
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body><UserLogin xmlns="http://tempuri.org/">
<LoginID>xxx</LoginID>
<Password>xxx</Password>
</UserLogin></soapenv:Body></soapenv:Envelope>`

The formatted XML is not properly going to Soap Service,i think that is the error..

Shall i need to set anything in the above configuration,please help me on this

When i used the console envelope code directly to call the Soap Service,it's working fine

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body><UserLogin xmlns="http://tempuri.org/">
<LoginID>xxx</LoginID>
<Password>xxx</Password>
</UserLogin></soapenv:Body>
</soapenv:Envelope>

Can anyone help me on this

Response is also an XML...

NOTE : Sorry for the long question

来源:https://stackoverflow.com/questions/22405391/how-to-send-a-soap-requestxml-to-soap-service-using-wso2-proxy-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!