James, One of the primary reasons that you want to use a web services platform like Axis is to let Axis do the Java-to-XML conversions for you. Your application should work with Java objects, and then Axis can automatically convert those Java objects into XML structures and constructs a SOAP envelope around them. The message processing pipeline also processes SOAP headers for you.
But this process doesn't work nearly as well if your application produces results as an string containing XML. In this case the string is opaque, and Axis can't process the XML for you. The only thing Axis can do is stuff the string into an XML element of type xsd:string, and it escapes all the XML. In that case, the client has no information about the structure of the XML you're returning. Axis works using Java objects -- the SOAP message is represented by the SAAJ classes: SOAPMessage, SOAPEnvelope, SOAPPart, SOAPBody, SOAPHeader, ChildElement, etc. Not XML strings. So what that means is that if your current application generates XML strings, you must convert them into value objects so that Axis can work with them. Or you can convert the strings to DOM. Whether or not the service is defined as rpc or document really makes no difference in either case. (although it's always better to use document). Anne On 6/3/05, James Taylor <[EMAIL PROTECTED]> wrote: > Hey folks, > I've a query on a similar issue. I'm using axis's WSDL2Java tool to > make client and server style stubs but my service takes the data from the > client, queries a database but instead of sending back a resultset of found > object sends back an xml String result which is basically a xml document. The > issue is this is not rpc is it. It semms more like sending documents then > objects, but the service is rpc in its wsdd. > I know its a design issue but should I just send back the objects to > the client and let them make xml outa them? Also if i'm sending documents what > would be a better way to do the above? > James. > > Quoting Anne Thomas Manes <[EMAIL PROTECTED]>: > > > The service is defined as document/literal, therefore that's how you > > must encode the messages. But you can still "invoke" it using an RPC > > style -- at least from your application's perspective. This WSDL > > conforms to the "wrapped" convention, so Axis allows you to invoke it > > using an RPC programming style. > > > > The right way to do that is to use WSDL2Java to generate a client > > proxy stub and to invoke methods on the stub. Because the service uses > > anyType, you also need to define custom deserializers. > > > > What exactly are you looking to do? > > > > Anne > > > > On 6/2/05, Ravi Krishnamurthy <[EMAIL PROTECTED]> wrote: > > > Hello: > > > I 'm a newbie to Axis. Was looking into the following wsdl: > > > http://www.atomic-x.com/xmlservices/dnslookupservice.asmx?wsdl > > > > > > Was able to use WSDL2JAVA from Axis to generate the stubs and hence invoke > > the > > > webservice. > > > > > > Wondering is there any other way to invoke the webservice successfully > > > instead of using WSDL2JAVA. The webservices has datatypes that could be > > complex types and would like to invoke RPC as well as Document style. > > > > > > I'm looking only as a client to invoke the webservices. Also any > > suggestions design approach for this is welcome. > > > > > > Thanks for your time. > > > Regards, > > > Ravi > > > > > > > > > > > > > -- > Between the question and the answer lies free will >
