axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cun Yong Tan" <cyong...@hotmail.com>
Subject Java2WSDL and mapping of names interop
Date Thu, 01 Jan 1970 00:00:00 GMT

I have an Axis WS method that returns a complex type (JavaBean).
If my bean is coded like so:

public class KeyValPair
{
  private String _key;              // NOTE the underscores !
  private String _val;

  public KeyValPair(){}
  public String getKey() {return _key;}
  public String getVal() {return _val;}
  public void setKey(String keyIn) {_key = keyIn; }
  public void setVal(String valIn) {_val = valIn; }
}

then the WSDL generated has uppercase for "Key", "Val":

   <complexType name="KeyValPair">
    <sequence>
     <element name="Key" nillable="true" type="xsd:string"/>
     <element name="Val" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
   <element name="KeyValPair" nillable="true" type="tns1:KeyValPair"/>

but if the bean is coded like so:

public class KeyValPair
{
  private String key;                   // No underscores here
  private String val;

  public KeyValPair(){}
  public String getKey() {return key;}
  public String getVal() {return val;}
  public void setKey(String keyIn) {key = keyIn;}
  public void setVal(String valIn) {val = valIn;}
}

then the WSDL generated has lower case:

   <complexType name="KeyValPair">
    <sequence>
     <element name="key" nillable="true" type="xsd:string"/>
     <element name="val" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
   <element name="KeyValPair" nillable="true" type="tns1:KeyValPair"/>


Does anyone know why this is so ? Why does the underscore affect the
mapping of the names ?

The reason it is important is that when I used a .NET client to
call the method, it works with the SECOND case (no underscore) but not the 
FIRST one. For the one with underscore, the response on the
wire from the method looks correct but the C# client interprets the
values as nulls.

Any insight is appreciated !








I used a C# .Net client to access the method. The client is

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


Mime
View raw message