Title: WSDL2Java sending incorrect data.
Digging deeper, it looks like the 'Parameter' object is created correctly 'initially'.
That meaning the 'localPart' of the QName 'is' 'consultData'.
Tracing through code changes, it looks like the following code 'resets' the Parameter's QName to the 'type' instead of the 'name' attribute as it did before.
 
 
The call appears to happen in the SymbolTable in the 'addInishParm' method.
The following is a cutout of the the call.
        // If this is a collection we want the XML to reflect the type in
        // the collection, not foo[unbounded]. 
        // Same check is made in addOutParam below.
        if (p.getType() instanceof CollectionTE) {
            p.setQName(p.getType().getRefType().getQName()); 
above<<<resets the QName of Parameter
 
 
It looks like the code change took place in SymbolTable.
On September 24 in Revision 1.39.
An excert from the comments is:

SymbolTable
- Scan parameter names and prevent duplicates
- When dealing with Collection types, make the XML name
  the type in the collection, not the internal bracket
  notation (i.e. foo[unbounded])
 
Question:
Is this correct?
Is it in the standard?
Axis was doing it the other way first.
.NET continues to do it the other way.
Need to know either way so that we can 'change' our own provider in the correct manner if this is a valid change.
 
thanks,
 chris
 
 
 
-----Original Message-----
From: Peake, Chris
Sent: Monday, October 28, 2002 12:05 PM
To: [EMAIL PROTECTED]
Subject: RE: WSDL2Java sending incorrect data.

I've done a little more research and I see where the problem is 'starting'.
 
In the generated code, in the generate *Stub.java source file.
The 'method' call uses the 'type' name for the parameter name to the method and then the QName gets generated with same name.

// as in below, 'Pattern' is the name used for the
public localhost.ValueStressTypes.ValueNeugentConsultResult consult(localhost.ValueStressTypes.Pattern[] pattern) throws java.rmi.RemoteException {
apache.axis.client.Call _call = createCall();

// I change to 'consultData' for the QName and now data is correct on wire

// Soap envelope appears as I expect it to.
_call.addParameter(new javax.xml.namespace.QName("urn:ValueStressTypes.localhost", "consultData"), new javax.xml.namespace.QName("urn:ValueStressTypes.localhost", "Pattern"), localhost.ValueStressTypes.Pattern[].class, javax.xml.rpc.ParameterMode.IN);

// this is the default generated one.  It uses the 'type' name for the parm QName.
//generated one _call.addParameter(new javax.xml.namespace.QName("urn:ValueStressTypes.localhost", "Pattern"), new javax.xml.namespace.QName("urn:ValueStressTypes.localhost", "Pattern"), localhost.ValueStressTypes.Pattern[].class, javax.xml.rpc.ParameterMode.IN)

This has changed in not too distant past.
I'm not sure exactly when though.
.
.
fyi,

 chris

 
-----Original Message-----
From: Peake, Chris
Sent: Monday, October 28, 2002 11:02 AM
To: [EMAIL PROTECTED]
Subject: 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


Reply via email to