Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public with sharing class CallUpdatePersonAttributes_pt {
- @future (callout=true)
- public static void updateCDBPerson(){
- HttpRequest req = new HttpRequest();
- req.setEndpoint('http://192.168.25.175:8011/PersonDS/ProxyService/PersonDS');
- req.setMethod('POST');
- req.setHeader('Content-Type', 'text/xml; charset=utf-8');
- req.setHeader('Authorization', 'OAuth '+UserInfo.getSessionId());
- //req.setHeader('SOAPAction', 'https://api.authorize.net/soap/v1/CreateCustomerProfile');//
- //send the request
- Http http = new Http();
- HttpResponse res = http.send(req);
- string b = '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">'+
- '<soap:Body>'+
- '<ns1:UpdatePersonAttributesRequest xmlns:ns1="urn:engineersaustralia:cdm:generic:common:service:v1">'+
- '<ns1:PersonID>2713020</ns1:PersonID>'+
- '<ns1:Sex>M</ns1:Sex>'+
- '<ns1:UpdatedBy>1111</ns1:UpdatedBy>'+
- '</ns1:UpdatePersonAttributesRequest>'+
- '</soap:Body></soap:Envelope>';
- req.setBody(b);
- try{
- res = http.send(req);
- System.debug(res.toString());
- System.debug('STATUS:'+res.getStatus());
- System.debug('STATUS_CODE:'+res.getStatusCode());
- }
- catch(System.CalloutException e){}
- }
- }
- trigger TestDBAdapTrigger on Contact (after update) {
- for(Contact ct:Trigger.new){
- CallUpdatePersonAttributes_pt.updateCDBPerson();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement