I don't have any control over the webservice I'm calling, but I do have a schema for my xml data.

The format below is exactly what the webservice expects. Although the service elements may change from request to request, the root element <epgateway version="2.1"> always remains the same. Is it possible to do this with Axis?
<?xml version="1.0" encoding="utf-8"?>
 <soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
       <epgateway version="2.1">
		<UserAuthRequest authMethod="LoginCredential">
			<Credential userid="" password=""/>
		</UserAuthRequest>
		<Service>
			<CustomerInquiry>
				<CustomerID></CustomerID>
				<CustomerAction></CustomerAction>
				... other params...
			</CustomerInquiry>
		</Service>
       </epgateway>
   </soap:Body>
 </soap:Envelope>


Anne Thomas Manes wrote:
How did you define your WSDL?
Do you have a schema of your XML data? If so, you want to make sure
that your input message <part> definition points to the root element
of this XML data schema. If you don't have a schema of the data, then
your input message should specify something like:

<wsdl:part name="body" element="xsd:any"/>

Of course, if you don't have a schema of you message element, then you
ought to use the Messaging API rather than wsdl2java.

Anne

On 6/21/05, Niall McLoughlin <[EMAIL PROTECTED]> wrote:
  
 Greetings,
 
 I am calling an existing webservice with no operations defined. We simply
pass some xml. The server expects the request to look like this:
 
 <?xml version="1.0" encoding="utf-8"?>
 <soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
       XML DATA
   </soap:Body>
 </soap:Envelope>
 
 But when I call the service, my request looks like the following. I used
wsdl2java to generate my classes.
 
 <?xml version="1.0" encoding="utf-8"?>
 <soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
     <requests xmlns="webservicenamespace etc">
         MY XML DATA
     </requests>
   </soap:Body>
 </soap:Envelope>
 
 How can I format the request according to what the server is expecting
(i.e. get rid of the requests operation)?
 
 Many thanks!

    

  

Reply via email to