1
我試圖使用WebSphere 6.1的Java2WSDL Ant任務生成WSDL使用Websphere 6.1不產生序列參數正確
端點被編碼爲
class MySvcEndpoint implements MySvc_SEI {
public SomeOtherComplexType[] myCall(String[] argStrings)
throws javax.xml.soap.SOAPException
{
.
.
}
}
界面生成從端點類WSDL文件:
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>
正如你所看到的,產生了用簡單參數的方法確定,但與數組參數的方法進行旋。
我弄明白了。原來,我是從6.1.0.0生成WSDL的。我將修復程序23應用於基本安裝,並且WSDL現在可以正確安裝。 – GKelly
由於問題不再公開,我應該自己回答問題並接受該問題嗎? – GKelly
請做那個。否則,這會留在未答覆的類別中。 – user918176