chinmaya sn (chins) wrote:
Hi,
I have a WSDL + XSD file. I used axis to implement a server for the
given WSDL.
So I used the Java Objects and Skeleton generated by Axis' wsdl2java.
Now I have a requirement where I have a soap XML file which will be
same as
SOAP request XML. Only difference is instead of getting it over HTTP
I will be reading it from a flat file.
Now I want to use Axis to execute SOAP operation based on this XML file.
So.. Can I feed this SOAP xml file to any AXIS APIs so that it calls
my current server implementation (the one which implements skeleton).
Thanks
Chinmaya
Hi Chinmaya,
If you have a file containing a SOAP message you can use the
Call class to invoke the operation for you. For this, you will have to
create a SOAPMessage instance from your file, then use a Call object do
the invocation. Step by step:
1) Create a SOAPMessage from a file:
There's a constructor in the Message class (extends SOAPMessage)
that can be given an InputStream and will give you the instance you need
from the file you have.
See
<http://ws.apache.org/axis/java/apiDocs/org/apache/axis/Message.html#Message(java.lang.Object,%20boolean)>.
2) Actual invocation:
Message m;
// Step 1 ...
javax.xml.rpc.Service s = new Service();
org.apache.axis.client.Call c = (Call) s.createCall();
SOAPEnvelope operationReturn = c.invoke(m);
// End
I have never done the step 1 reading from a file, but I hope you will
have no problems.
See ya.
Andre Cardoso de Souza
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]