public void echo(String request) {
System.out.println(request);
}
If you want to send a simple string , You need to wrap it with CDATA. The the output will be >> "Text Content"
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wso2="http://wso2.org"> <soapenv:Header /> <soapenv:Body> <wso2:echo> <!--Optional:--> <wso2:request><![CDATA[Text Content]]></wso2:request> </wso2:echo> </soapenv:Body> </soapenv:Envelope>
If you want to pass a xml content as a string then you have to use CDATA tag as bellow.Then the output will be >> "<foo>Test</foo>"
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wso2="http://wso2.org">
<soapenv:Header />
<soapenv:Body>
<wso2:echo>
<!--Optional:-->
<wso2:request><![CDATA[<foo>Test</foo>]]></wso2:request>
</wso2:echo>
</soapenv:Body>
</soapenv:Envelope>
You need CDATA tag always to send the String value to a web service operation if they have String type parameter
No comments:
Post a Comment