axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Re: Problem invoking Document/literal with XML Document as parameter
Date Wed, 02 Jul 2003 11:10:37 GMT

I changed my code, so it now invokes the service with
org.apache.axis.message.SOAPBodyElement instead of 
org.w3c.dom.Document and now it works fine.

I think next time I should read the JavaDocs more carefully.

Many thanks for your help !

Sven Offermann

--- original ----

I'm not sure if anyone replied to this email or not but anyways....

From the Javadoc of Call.invoke(Object[] params) :

"For Messaging (ie. non-RPC) the params argument should be an array
of SOAPBodyElements.  <b>All</b> of them need to be SOAPBodyElements,
if any of them are not this method will default back to RPC.  In the
Messaging case the return value will be a vector of SOAPBodyElements."

This is also consistent with the JAX-RPC spec. Hence to invoke your
doc/literal web-service, your client code should look like:

org.w3c.dom.Document = ......
org.w3c.dom.Element documentRoot = doc.getDocumentElement();

Call call = ......
call.setProperty(Call.OPERATION_STYLE_PROPERTY, "document");

org.apache.axis.message.SOAPBodyElement soapBodyElement = new
 Vector returnDoc = (Vector)call.invoke(new

- Junaid


i am a newbie to axis and have a problem with calling a soap web service
with a prebuild XML Document as a parameter and hope someone can give me
a hint.

The service i implemented uses message style document/literal and expects
a XML Document as parameter. The service was tested and works fine.
A working and i think correct SOAP request to the service should look
like this:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:SOAP-ENC=""
xmlns:xsi="" xmlns:xsd="">
                <m:BookingRequest xmlns:m="">

Now i want to write a new client which invokes the service with a prebuild
XML Document like this:

<m:BookingRequest xmlns:m="">

I use the following part of code to invoke the service:

        Document doc = ...........
        Document result = (Document) call.invoke( new  Object[] { doc } );

The problem now is, that the generated SOAP request has a additional node
for the parameter, which wrapped the prebuild XML document. The result
is a org.xml.sax.SAXException on the server site. Here is the generated
SOAP request:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv=""
xmlns:xsd="" xmlns:xsi="">

  <ns1:arg0 xmlns:ns1="">

    <m:BookingRequest xmlns:m="">



Is is possible to prevent the generation of the additional
argument/parameter node ?

Many thanks to all hints and helps.

Sven Offermann

60% Onlinekosten sparen!
Jetzt Premium Mitglied bei werden und mit dem 
Tarifnavigator guenstiger surfen.
View raw message