On 6/19/06, Sai Arunachalam <[EMAIL PROTECTED]> wrote:
Hi,
I am changing a piece of code of mine to use Axis 2 instead of Commons HttpClient. I am able to connect to an existing web service using HttpClient. In my current code the SOAP envelope generated is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/ "
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance ">
<soapenv:Header />
But when I use Axis2, I don't know how to set the xmlns:xsd and xmlns:xsi property. So the SOAP envelope gets generated as follows:
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header />
I am currently getting the SOAP envelope by using:
SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
SOAPEnvelope envelope = factory.getDefaultEnvelope();
Can somebody tell me how to set xmlns:xsd and xmlns:xsi properties? I checked that the service returns an error code if I don't set these properties.
--------------
Ques 2:
In the continuation of the SOAP request, I get the following:
<ns1:ShowChart xmlns:ns1=" http://someurl">
I get this by doing:
OMNamespace namespace = factory.createOMNamespace("http://someurl","ns1");
OMElement params = factory.createOMElement("ShowChart", namespace);
I would like to set an extra attribute of the following:
"soapenv:encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/"
in the above OMElement.
How can I do this?
Thanks,Sai