开发者

Generating WSDL using Websphere 6.1 not generating sequence arguments correctly

开发者 https://www.devze.com 2023-03-21 19:06 出处:网络
I am trying to generate a WSDL file from an Endpoint class using the Websphere 6.1 Java2Wsdl ant task

I am trying to generate a WSDL file from an Endpoint class using the Websphere 6.1 Java2Wsdl ant task

The Endpoint is coded as

class MySvcEndpoint implements MySvc_SEI {
   public SomeOtherComplexType[] myCall(String[] argStrings) 
         throws javax.xml.soap.SOAPException
   {
      .
      .
   }
}

interface is:

public interface MySvc_SEI extends java.rmi.Remote {
   public SomeOtherComplexType[] myCall(String[] argStrings) 
         throws javax.xml.soap.SOAPException;
}

The WSDL generated contains the following entries:

<element name="myCall">
   <complexType>
      <sequence/>
   </complexType>
</element>
<element name="myCallResponse">
   <complexType>
      <sequence/>
   </complexType>
</element>

As you can see, the 'argStrings' argument has disappeared, though it seems to recognize something should be there. Also, the return type seems to have disappeared too.

Anyway, when I generate stubs based on the WSDL, the interface generated is:

public interface MySvc {
   public void myCall() throws java.rmi.RemoteException;
}

Has anyone come across this issue before, and if so how was it solved?

Thanks

[Edit] OK, it seems to be when there is an array as the input argument. I've tried the following:

public int m1(String s1) throws SOAPException {
   return 0;
}

public int[] m2(String s1) throws SOAPException {
   int[] a = { 0 };
   return a;
}

public int m3(String[] sArr) throws SOAPException {
   return 0;
}

public int[] m4(String[] sArr) throws SOAPException {
   int[] a = { 0 };
   return a;
}

and gotten the following WSDL output:

<element name="m1">
 <complexType>
  <sequence>
    <element name="s1" nillable="true" type="xsd:string"/>
  </sequence>
 </complexType>
</element>
&l开发者_StackOverflowt;element name="m1Response">
 <complexType>
  <sequence>
   <element name="m1Return" type="xsd:int"/>
  </sequence>
 </complexType>
</element>
<element name="m2">
 <complexType>
  <sequence>
   <element name="s1" nillable="true" type="xsd:string"/>
  </sequence>
 </complexType>
</element>
<element name="m2Response">
 <complexType>
  <sequence>
   <element name="m2Return" nillable="true" type="impl:ArrayOf_1368777266_int"/>
  </sequence>
 </complexType>
</element>
<element name="m3">
 <complexType>
  <sequence/>
 </complexType>
</element>
<element name="m3Response">
 <complexType>
  <sequence/>
 </complexType>
</element>
<element name="m4">
 <complexType>
  <sequence/>
 </complexType>
</element>
<element name="m4Response">
 <complexType>
  <sequence/>
 </complexType>
</element>

As you can see, the methods with simple arguments were generated OK, but the methods with array arguments were screwed.


Turns out this was due to the patch versions of the WebSphere Application Server. On investigating, the installed WebSphere was 6.1.0.0. On upgrading to patch level 23 or above, this issue was fixed.

Make sure you are at the latest patch version, that's all I can say!

0

精彩评论

暂无评论...
验证码 换一张
取 消