You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Peake, Chris" <Ch...@ca.com> on 2002/10/28 18:02:20 UTC

WSDL2Java sending incorrect data.

// posted this to user group with no response.
// time is short for us to release is reason posting directly to you guys.

Now using RC1 Axis.
Below describes the problem.
This has changed post beta2.
.NET still works  (which is usually not the case)
// we generate the WSDL ourselves

// this is the WSDL (or a portion of it)
// Notice that the 'sequence' element name is 'consultData' and the TYPE is 'Pattern'.
// The generated Java code 'used' to produce an element for the 'consult' method whose parameter WAS <consultData>
// .NET is 'still' doing this as well.
// Which used to work for generated Axis Java clients 
// and still works for .NET clients.
// But now, Axis generated Java clients are producing soap messages using the 'type'  (i.e. Pattern) for the element name instead of 'consultData'
// like it should be doing.
// why was this changed?
// do you consider this correct?
//examples follow

// WSDL - no changes in this.
  <?xml version="1.0" encoding="UTF-8" ?> 
- <definitions name="ValueStress" targetNamespace="http://localhost:8080/WSB/soap/ValueStress" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:intf="http://localhost:8080/WSB/soap/ValueStress" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:types="urn:ValueStressTypes.localhost" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <types>
- <xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="urn:ValueStressTypes.localhost">
- <xsd:element name="consult">
- <xsd:complexType>
- <xsd:sequence>
  <xsd:element maxOccurs="unbounded" minOccurs="1" name="consultData" type="types:Pattern" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
- <xsd:complexType name="Pattern">
- <xsd:sequence>
  <xsd:element maxOccurs="1" minOccurs="0" name="myOID" type="xsd:string" /> 
  <xsd:element maxOccurs="unbounded" minOccurs="1" name="fields" type="types:PatternField" /> 
  </xsd:sequence>
  </xsd:complexType>
- <xsd:complexType name="PatternField">
- <xsd:sequence>

// from RC1 we 'NOW' get the following.  Notice the element name is NOW 'Pattern' which is the TYPE itself.
// this is SOAP message sent from generated code from beta 2.
// notice the the method name is <consult> element.  This is good.
// Also, notice the 'data' element is <consultData>.  This is good to.  
// this was the 'name' attribute on the WSDL for this element.
// But this changed in later Axis code.

t message form to: FORM_SOAPENVELOPE (currentMessage is now <SOAP-ENV:Envelope x
mlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.
w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <SOAP-ENV:Body>
  <consult xmlns="http://localhost:8080/WSB/soap/ValueStress">
   <ns1:consultData xmlns:ns1="urn:ValueStressTypes.localhost">
    <ns1:fields>
     <ns1:value>
      <ns1:doubleValue xsi:nil="true"/>
      <ns1:stringValue>
       <ns1:value>record1</ns1:value>


// below is the NEW soap messag being sent by the Axis generated java clients
// notice the element name is now <Pattern> instead of <consultData> even though the WSDL definition is the same.
// this is causing our failure.

343313 [HttpProcessor[8080][5]] DEBUG org.apache.axis.SOAPPart  - setCurrentForm(<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>
  <consult xmlns="urn:ValueStressTypes.localhost">
   <Pattern>
    <fields>
     <label>label</label>
     <value>
      <stringValue>
       <value>record1</value>
      </stringValue>
     </value>
    </fields>

Thanks,
 chris