I've been experimenting with doc-lit and wrapped in axis 1.0, and not having much luck.
 
PROBLEM 1:
 
Using wrapped style with the following service definition:
 
public interface Gateway {
 public String Test(String bla);
 public String Test5();
}
 
WSDL2Java throws the following exception:
 
     [java] java.util.NoSuchElementException
     [java]     at java.util.HashMap$HashIterator.nextEntry(HashMap.java:753)
     [java]     at java.util.HashMap$ValueIterator.next(HashMap.java:780)
     [java]     at org.apache.axis.wsdl.toJava.JavaStubWriter.writeOperation(JavaStubWriter.java:614)
     [java]     at org.apache.axis.wsdl.toJava.JavaStubWriter.writeFileBody(JavaStubWriter.java:300)
     [java]     at org.apache.axis.wsdl.toJava.JavaWriter.generate(JavaWriter.java:151)
     [java]     at org.apache.axis.wsdl.toJava.JavaBindingWriter.generate(JavaBindingWriter.java:145)
     [java]     at org.apache.axis.wsdl.toJava.JavaGeneratorFactory$Writers.generate(JavaGeneratorFactory.java:287)
     [java]     at org.apache.axis.wsdl.gen.Parser.generate(Parser.java:320)
     [java]     at org.apache.axis.wsdl.gen.Parser.access$000(Parser.java:80)
     [java]     at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:244)
     [java]     at java.lang.Thread.run(Thread.java:536)
 
 
PROBLEM 2:
 
When I do get wrapped style to work, it does a bit too much wrapping when the return type of a method is my own class, and wraps the class in a response object.  For example, the following interface fed into Java2WSDL:
 
public interface Gateway {
    public MyClass Test();
}
 
Results in a SoapBindingImpl class which looks like this:
 
public class GatewaySoapBindingImpl implements project.ws.Gateway{
    public project.ws.TestResponse test() throws java.rmi.RemoteException {
        return null;
    }
}
 
 
Using doc-literal, I am seeing an assortment of problems.  I have worked around the problem with arrays (bug#13979), but there are still other problems:
 
PROBLEM 3:
- The client throws an exception if a method returning void is called
 
PROBLEM 4:
- I am having the same trouble as Harish, in his unanswered posting to this list titled "Problem with literal encoding??"
My case is a little different.  It works ok using an axis client, but a .NET client causes the same problem.
The axis client sends the following: (which the server has no problem with)
 
<?xml version="1.0" encoding="UTF-8"?>
<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>
  <MyClass xmlns="urn:projectns">
   <text xmlns="">This is text</text>
   <MoreValues xmlns="">a</MoreValues>
   <MoreValues xmlns="">b</MoreValues>
   <MoreValues xmlns="">c</MoreValues>
   <Text2 xmlns="">This is more text</Text2>
  </MyClass>
 </soapenv:Body>
</soapenv:Envelope>
 
The .NET client sends the following, which causes the server to throw an exception:
(stackTrace: org.xml.sax.SAXException: Invalid element in project.ws.MyClass - MoreValues)
 
<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <soap:Body>
  <MyClass xmlns="urn:projectns">
   <text>abc</text>
   <MoreValues>a</MoreValues>
   <MoreValues>b</MoreValues>
   <Text2>def</Text2>
  </MyClass>
 </soap:Body>
</soap:Envelope>
 
 
These test cases are all extremely simple, but AXIS seems to have all sorts of problems with them.  Are document-literal and wrapped styles officially supported in 1.0?  If not, I can just get .NET to generate my WSDL and then feed that into axis, which seems to work perfectly.

Reply via email to