Hi Mikko, yes I have.
The process was a little involved but I'll outline the main steps below to point you in the right direction.
What I had to do is the following:
1. Create a service reference for the Web Service in Visual Studio and add it to AX. See the link posted by Martin above.
2. Create your own AIF Adapter in AX. For this part I copied and modified one of the existing classes. Have a look at AIFWcfAdapter and AIFWcfSendAdapter for reference. Make sure that AIFMyAdapter.getSendAdapter() returns AIFMySendAdapter(). Change AIFMySendAdapter.sendMessage() accordingly.
As an example, something like this:
public void sendMessage(AifGatewayMessage gatewayMessage)
{
// Variable for service client type.
MY.ServiceReference.WMS.OutboundClient outboundClient;
// Variable for the service client.
ClrObject clientType;
//.Net exception handler
System.Exception ex;
//XML String handler
System.String xml; ;
//Check for adapter
if (!adapterIntialized)
throw error("@SYS95134");
try
{
//Get interop permission
new InteropPermission(InteropKind::ClrInterop).assert();
//ReadXMMessage
xml = gatewayMessage.parmMessageXml();
clientType = CLRInterop::getType("MY.ServiceReference.WMS.OutboundClient");
outboundClient = AifUtil::createServiceClient(clientType);
outboundClient.ShipmentCreateTXT(xml);
break;
}
catch(Exception::CLRError)
{
// Handle the exception and display message in the InfoLog.
ex = CLRInterop::getLastException();
}
}
3. Register your adapter. You can do this in a job. Google for more info but it should be something like this:
static void STX_RegisterAdapters()
{
AifAdapter AifAdapter;
;
aifAdapter::registerAdapters();
}
4. You should now see your adapter in the outbound adapter list when creating an outbound port. Select a service operation and you should be good to go. It should work with the standard out of the box services.
5. If you want to send picklists for example, you can add a snippet like this to \Classes\SalesPickingListJournalPost.endPost()
if (wmsPickingRoute.canXMLBeSent())
{
wmsPickingRoute.sendElectronically(XMLDocPurpose::Original);
}
Not sure if I listed all the steps, but this should put you on the right track at least.
Good luck.