0
我真的很努力讓我的第一個AXIS SOAP客戶端工作。我正在使用Axis v1.4。Axis 1.4:無法獲得SOAP請求工作
我們的WSDL包含此:
....
<element name="GetParameters">
<complexType>
<sequence>
<element name="param1" type="codeapi:SomeParam"/>
<element name="param2" type="unsignedShort" minOccurs="0"/>
<element name="param3" type="string" minOccurs="0"/>
<element name="param4" type="unsignedShort" minOccurs="0"/>
<element name="param5" type="unsignedShort" minOccurs="0"/>
<element name="param6" type="string" minOccurs="0"/>
<element name="param7" type="string" minOccurs="0"/>
<element name="param8" type="string" minOccurs="0"/>
<element name="param9" type="codeapi:AnotherParam" minOccurs="0"/>
</sequence>
</complexType>
</element>
....
我已經跑的WSDL2Java生成代碼。
-
我初始化端口:
SimpleProvider conf = new SimpleProvider(new BasicClientConfig());
conf.setGlobalRequest(new LoggingHandler(LOG, Level.FINE,
"Request sent:\n"));
conf.setGlobalResponse(new LoggingHandler(LOG, Level.FINE,
"Response received:\n"));
MyService = new MyServiceLocator(conf);
URL myServiceURL = "http://<removed>";
MyServicePort myServicePort = myService.getMyServiceSOAPPort(myServiceUrl);
-
我第一次嘗試的訪問請求:
SomeParam param1 = new SomeParam();
param1.setParamA("blah"); // this is the only needed parameter
Entry[] allEntries = myServicePort.getParameters(param1, null, null, null, null, null, null, null, null);
這導致空指針異常(在客戶端),即使所有的null參數都是可選的。
-
我的第二次嘗試:
SomeParam param1 = new SomeParam();
param1.setParamA("blah");
Entry[] allEntries = myServicePort.listCodes(param1, new UnsignedShort(), new StringHolder(), new UnsignedShort(), new UnsignedShort(), new String(), new String(), new String(), new AnotherParam());
這導致也不例外,但空值回到allEntries,我不知道一個SOAP請求是否實際發送(最有可能不)。
代碼運行在Oracle AS之上。在任何一種情況下,即使所有不同的調試類都已在Oracle中激活,並且LoggingHandlers已初始化,調試信息的任何一行都不會被Axis寫入日誌。
我在這裏做錯了什麼?
這似乎是這種情況。謝謝! – tputkonen 2009-05-28 10:19:52