This is a Test Sample code to call Web service Reference object in axapta. If you created any web service out side axapta and want to call that web service method to do some activity then this code sample can help you a lot.
TestRefObject.RefObject_PortClient RefObject1;
str errDesc;
boolean ret;
;
try
{
new InteropPermission(InteropKind::ClrInterop).assert();
RefObject1 = new TestRefObject.RefObject_PortClient("RefObject_Port");
RefObject1.Test_Method(para1,par2..);
CodeAccessPermission::revertAssert();
ret = true;
}
catch(Exception::CLRError)
{
errDesc = strfmt("Error message %1,AifUtil::getClrErrorMessage());
ErrorLog::LogError("Error ",errDesc,SourceType::System);
ret = checkfailed(errDesc);
}
return ret;