Hello,
 
I've made a simple WebService with .NET (C#, C++) which returns in a function my own defined type called 'UserDefinedType'. The java-client which uses axis-alpha3 and the proxies created with the wsdl2java-tool produces an error after executing the client :
 
'org.xml.sax.SAXException: Invalid element in org.tempuri.UserDefinedType - IntValue'
 
<<SOAP-message from axis-client>>
 
<?xml version="1.0" encoding="UTF-8" ?>
- <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns: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>
  <ns1:getUserDefinedType xmlns:ns1="http://tempuri.org/" />
  </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>
 
<<SOAP-message from WebService>>
 
<?xml version="1.0" encoding="utf-8" ?>
- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:types="http://tempuri.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <types:getUserDefinedTypeResponse>
  <getUserDefinedTypeResult href="#id1" />
  </types:getUserDefinedTypeResponse>
- <types:UserDefinedType id="id1" xsi:type="types:UserDefinedType">
  <IntValue xsi:type="xsd:int">1</IntValue>
  <StringValue xsi:type="xsd:string">Text</StringValue>
  </types:UserDefinedType>
  </soap:Body>
  </soap:Envelope>
 
<<my WebService in C#>>
...
[SoapRpcServiceAttribute]
public class Service1 : System.Web.Services.WebService
{
  public class UserDefinedType
  {
       public int  IntValue;
       public String StringValue;
  }
   ...
  [WebMethod]
  public UserDefinedType getUserDefinedType()
  {
       UserDefinedType t = new UserDefinedType();
       t.IntValue = 1;
       t.StringValue = "Text";
       return t;
  }
}
 
<<my axis-java-client>>
 
public static void main( String[] args)
  {
    try
    {
      Service1 svc = new Service1();
      Service1Soap_Port port = svc.getService1Soap( );
      UserDefinedType ret = port.getUserDefinedType();
      System.out.println("return : " + ret.getIntValue() + " " + ret.getStringValue() );
    }
    catch( Exception e)
    {
      System.out.println( e);
    }
  }

Reply via email to