0
我試圖通過使用java api在adf mobile上使用wcf webservice方法,如下面的代碼片段所示。 我試圖通過創建web服務代理來運行古典adf通用應用程序。然後我可以得到正確的答覆。但是當我在adfmobile上使用webservice方法時,我得到http 501錯誤響應。我試着用拖放到amx頁面並執行綁定動作,結果是一樣的。 可能是什麼原因? brgds是否可以在adf mobile上調用wcf webservice?
private boolean validateClient()
{
List pnames = new ArrayList();
List pvals = new ArrayList();
List ptypes = new ArrayList();
pnames.add("UserName");
pvals.add("test");
ptypes.add(String.class);
pnames.add("Password");
pvals.add("123");
ptypes.add(String.class);
pnames.add("DeviceID");
pvals.add("123456");
ptypes.add(String.class);
GenericType result = null;
try
{
ClientDetail clientDetail = null;
result = (GenericType)AdfmfJavaUtilities.invokeDataControlMethod("mlService", null, "ValidateClient", pnames, pvals, ptypes);
for (int i = 0; i < result.getAttributeCount(); i++)
{
// Get each individual GenericType instance that holds the attribute key-value pairs
GenericType entityGenericType = (GenericType)result.getAttribute(i);
clientDetail = (ClientDetail)GenericTypeBeanSerializationHelper.fromGenericType(ClientDetail.class, entityGenericType);
}
if (clientDetail != null)
{
if (clientDetail.getIsValidate().booleanValue())
return true;
else
AdfmfContainerUtilities.invokeContainerJavaScriptFunction("com.accmee.menu", "navigator.notification.alert",
new Object[] { "No access",
"No access: ", "Ok" });
} else
{
AdfmfContainerUtilities.invokeContainerJavaScriptFunction("com.accmee.menu", "navigator.notification.alert",
new Object[] { "No access",
"No access: ", "Ok" });
return false;
}
}
catch (AdfInvocationException aie)
{
if (AdfInvocationException.CATEGORY_WEBSERVICE.compareTo(aie.getErrorCategory()) == 0)
{
throw new AdfException("Error with the server. Please try later.", AdfException.ERROR);
}
aie.printStackTrace();
throw new AdfException("Uzak veri sağlayısı çağrılırken hata oluştu", AdfException.ERROR);
}
return false;
}
的測試環境中訪問它似乎不符合JSR-172的兼容性。 (另請參閱:http://stackoverflow.com/questions/7063110/wcf-and-java-interoperability)我必須被要求將ws改爲asmx。所以,我可以再打電話了 – webyildirim