Hi,

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="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
        <SOAP-ENV:Body>
                <m:BookingRequest xmlns:m="http://my.domain.org/booking";>
                        <location>String</location>
                        <startDate>1998-08-13</startDate>
                        <endDate>1998-08-14</endDate>
                </m:BookingRequest>
        </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


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

<m:BookingRequest xmlns:m="http://my.domain.org/booking";>
        <location>City</location>
        <startDate>2001-08-13</startDate>
        <endDate>2001-08-15</endDate>
</m:BookingRequest>


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

       .
       .
       .
        Document doc = ...........
        call.setOperationStyle(Style.DOCUMENT);
        call.setEncodingStyle("literal");
        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="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
 <soapenv:Body>

  <ns1:arg0 xmlns:ns1="http://my.domain.org/booking";>

    <m:BookingRequest xmlns:m="http://my.domain.org/booking";>
        <location>City</location>
        <startDate>2001-08-13</startDate>
        <endDate>2001-08-15</endDate>
     </m:BookingRequest>

 </ns1:arg0>

</soapenv:Body>
</soapenv:Envelope>


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 freenet.de werden und mit dem 
Tarifnavigator guenstiger surfen.
http://www.freenet.de/tipp/premium/tarif/index.html

Reply via email to