You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Wimmer, Matthias" <ma...@scr.siemens.com> on 2002/06/07 17:49:08 UTC

sending XML data

Hi,

I am just creating a few examples to become familiar with Axis. The call to
services using RPC works quite well. But now I would like to send structured
data to a service. So the SOAP-Body should look something like that:
    <SOAP-ENV:Body>
     <setTime>
       <hour>9</hour>
       <minute>12</minute>
       <second>35</second>
     </setTime>
    </SOAP-ENV:Body>

That's a difference to the RPC calls. In case of the RPC calls you can just
specify the name and the arguments of the RPC method. But what I want is
being able to create cascaded XML tags. (As written above)

I deployed a service with this method:
    public Document setTime( MessageContext messageContext, Document inDoc )
{...}

The file deploy.wsdd looks like this:
      <service name="MyService" pivot="MsgDispatcher">
         <parameter name="className"
value="de.wimmisoft.webservice.service.MyService"/>
         <parameter name="methodName" value="setTime" />
      </service>

I also wrote a client that tries to access this method. The SOAP file is
created correctly (as written above). But I get an exception by this line:
     SOAPEnvelope returnEnvelope = call.invoke( sendEnvelope );


The Exception is the following:
    Exception in thread "main" org.xml.sax.SAXParseException: Document root
element is missing.
        org.xml.sax.SAXParseException: Document root element is missing.

Here is my question:
Did I miss something? Have I forgotten to specify / setup something?  When I
try to watch the WSDL file with 
http://localhost/axis/services/MyService?WSDL  (as usual) I also receive an
error. As I didn't write a WSDL file this error is expectable. What does
this invoke() method do? Does it expect a WSDL file an does it parse this
file?


Thank you in advance
Matthias Wimmer