I would say right now 75% of my time programming is Consuming a web service in 2E. Some soap and some XML.
Right now I use HTTPAPI from scott for XML used with
www.IContact.com and WSDL2RPG for soap.
I put ever thing in Execute user source with parms then all of then in a Execute external function.
I have no really programs except when 2E does not support Free Rpg to with parms that well
EUS01 Header Execute user source
D/copy /BRC/stub/ICAPI/ICAPISoap.rpgleinc
D WsStub DS likeds(This_t)
D OrderHeader DS likeds(OrderHeader_t)
D ServerHeader DS likeds(ServerHeader_t)
D StartOrder DS likeds(StartOrder_t)
D OrderReturn DS likeds(OrderReturn_t)
D xsd_stringI DS likeds(xsd_string)
D xsd_stringO DS likeds(xsd_string)
D HelloReturn DS likeds(HelloReturn_t)
D ServiceOrder DS likeds(ServiceOrder_t)
D CampaignInput DS likeds(CampaignInput_t)
D packageInput DS likeds(packageInput_t)
D hitInput DS likeds(hitInput_t)
D hitReturn DS likeds(hitReturn_t)
EUS02 Stub Config Create Execute user source
/free
clear WsStub;
WsStub.endpoint = %trim(#IR9A3);
#OS3CD = stub_create_ICAPISoap(WsStub);
/end-free
EUS03 Stub Config Destroy
/free
#OS3CD = stub_destroy_ICAPISoap(WsStub);
/end-free
EUS15 Add Campaign
D proCode S 10A
D grpCode S 7p 0
C MOVEL #ILVJ5 grpCode
C MOVEL #ILWJ5 proCode
/free
clear CampaignInput;
clear OrderReturn;
CampaignInput.groupCode.value = %char(grpCode);
CampaignInput.promotionCode.value = proCode;
if (stub_op_AddcampaignOrder(WsStub:
OrderHeader:
CampaignInput:
OrderReturn) = *ON);
OrderHeader = OrderReturn.OrderHeader_Ref;
#ORUA3 = OrderReturn.Status.value;
#OMNH1 = OrderReturn.Message.value;
else;
#ORUA3 = 'EX';
#OMNH1 = 'stub_op_AddcampaignOrder failed';
endif;
/end-free