Я пытаюсь сгенерировать файл WSDL из класса Endpoint с помощью задачи Ant2 Java2Wsdl Websphere 6.1
Конечная точка закодирована как
class MySvcEndpoint implements MySvc_SEI {
public SomeOtherComplexType[] myCall(String[] argStrings)
throws javax.xml.soap.SOAPException
{
.
.
}
}
интерфейс:
public interface MySvc_SEI extends java.rmi.Remote {
public SomeOtherComplexType[] myCall(String[] argStrings)
throws javax.xml.soap.SOAPException;
}
Сгенерированный WSDL содержит следующие записи:
<element name="myCall">
<complexType>
<sequence/>
</complexType>
</element>
<element name="myCallResponse">
<complexType>
<sequence/>
</complexType>
</element>
Как вы можете видеть, аргумент 'argStrings' исчез, хотя, кажется, он распознает что-то должно быть там.Кроме того, тип возвращаемого значения, похоже, тоже исчез.
В любом случае, когда я генерирую заглушки на основе WSDL, генерируется интерфейс:
public interface MySvc {
public void myCall() throws java.rmi.RemoteException;
}
Кто-нибудь сталкивался с этой проблемой раньше,и если да, то как это было решено?
Спасибо
[Правка] Хорошо, похоже, когда в качестве входного аргумента используется массив.Я попробовал следующее:
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;
}
и получил следующий вывод WSDL:
<element name="m1">
<complexType>
<sequence>
<element name="s1" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</element>
<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>
Как вы можете видеть, методы с простыми аргументами были сгенерированы нормально, но методы саргументы массива были испорчены.