<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Data Integration Specialist Superbadge - Step 7 in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Data-Integration-Specialist-Superbadge-Step-7/m-p/71820#M44261</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I'm getting an error message when triggering the SOAP call from the UI via record update:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;System.CalloutException: IO Exception: External server did not return any content&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I import the WSDL into SOAP UI and send the same package body, I receive this message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;HTTP /1.1 500&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Server: Cowboy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Content-Type: application/json;charset=UTF-8&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Transfer-Encoding: chunked&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Date: Mon, 10 Jul 2017 17:58:08 GMT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Via: 1.1 vegur&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Proxy-Connection: Keep-Alive&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Connection: Keep-Alive&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does this mean that the herokuapp needs to be restarted or something? Even when i was getting trained on &lt;A href="https://www.crsinfosolutions.com/salesforce-training-online/" target="_self"&gt;Salesforce&lt;/A&gt; also this topic was not discussed in detailed. I've found a couple of posts with sample code for this challenge and with a few small differences, mine matches from what I can tell. Here's the code I'm using:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;ProjectTrigger&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;trigger ProjectTrigger on Project__c (after update) {
    //Call the Billing Service callout logic here

    if (trigger.isAfter &amp;amp;&amp;amp; trigger.isUpdate) {
        BillingCalloutService.callBillingService(Trigger.new, Trigger.newMap, Trigger.old, Trigger.oldMap);
    }

}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;BillingCalloutService&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;public class BillingCalloutService {
    //Implement business and callout logic methods here
    public static void callBillingService(List&amp;lt;Project__c&amp;gt; newList, Map&amp;lt;Id, Project__c&amp;gt; newMap,
            List&amp;lt;Project__c&amp;gt; oldList, Map&amp;lt;Id, Project__c&amp;gt; oldMap) {

        if(!newList.isEmpty()) {
            Project__c project = newList[0];
            if (project.Status__c == 'Billable' &amp;amp;&amp;amp; oldMap.get(project.Id).Status__c != 'Billable') {
                // Get Service Credentials from custom settings
                ServiceCredentials__c credentials = ServiceCredentials__c.getInstance('BillingServiceCredential');
                billProject(project.ProjectRef__c, project.Billable_Amount__c, credentials.Username__c, credentials.Password__c);
            }
        }
    }

    @Future(callout=true)
    private static void billProject(String projectRef, Decimal billAmount, String username, String password) {

        BillingServiceProxy.project project = new BillingServiceProxy.project();
        project.projectRef = projectRef;
        project.billAmount = billAmount;
        project.username = username;
        project.password = password;

        BillingServiceProxy.InvoicesPortSoap11 invoiceCall = new BillingServiceProxy.InvoicesPortSoap11();
        // Make the callout and update the Status if callout is successful
        String response = invoiceCall.billProject(project);

        List&amp;lt;Project__c&amp;gt; projects = new List&amp;lt;Project__c&amp;gt;();
        if(response != null &amp;amp;&amp;amp; response.equalsIgnoreCase('OK')) {

            projects = [
                    Select Id, Status__c
                    From Project__c
                    Where ProjectRef__c = :projectRef
            ];
            if(!projects.isEmpty()) {
                projects[0].Status__c = 'Billed';
                update projects;
            }
        }

    }
}&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;STRONG&gt;BillingServiceProxy&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;//Generated by wsdl2apex

public class BillingServiceProxy {
    public class billProjectRequest_element {
        public BillingServiceProxy.project project;
        private String[] project_type_info = new String[]{'project','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://salesforce.com/th/invoice-web-service','true','false'};
        private String[] field_order_type_info = new String[]{'project'};
    }
    public class project {
        public String username;
        public String password;
        public String projectRef;
        public Double billAmount;
        private String[] username_type_info = new String[]{'username','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] password_type_info = new String[]{'password','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] projectRef_type_info = new String[]{'projectRef','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] billAmount_type_info = new String[]{'billAmount','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://salesforce.com/th/invoice-web-service','true','false'};
        private String[] field_order_type_info = new String[]{'username','password','projectRef','billAmount'};
    }
    public class billProjectResponse_element {
        public String status;
        private String[] status_type_info = new String[]{'status','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://salesforce.com/th/invoice-web-service','true','false'};
        private String[] field_order_type_info = new String[]{'status'};
    }
    public class InvoicesPortSoap11 {
        public String endpoint_x = 'http://sb-integration-bs.herokuapp.com:80/ws';
        public Map&amp;lt;String,String&amp;gt; inputHttpHeaders_x;
        public Map&amp;lt;String,String&amp;gt; outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://salesforce.com/th/invoice-web-service', 'BillingServiceProxy'};
        public String billProject(BillingServiceProxy.project project) {
            BillingServiceProxy.billProjectRequest_element request_x = new BillingServiceProxy.billProjectRequest_element();
            request_x.project = project;
            BillingServiceProxy.billProjectResponse_element response_x;
            Map&amp;lt;String, BillingServiceProxy.billProjectResponse_element&amp;gt; response_map_x = new Map&amp;lt;String, BillingServiceProxy.billProjectResponse_element&amp;gt;();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://salesforce.com/th/invoice-web-service',
              'billProjectRequest',
              'http://salesforce.com/th/invoice-web-service',
              'billProjectResponse',
              'BillingServiceProxy.billProjectResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.status;
        }
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me where i have done mistake?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Sun, 03 May 2020 20:03:56 GMT</pubDate>
    <dc:creator>meghanchrls6</dc:creator>
    <dc:date>2020-05-03T20:03:56Z</dc:date>
    <item>
      <title>Data Integration Specialist Superbadge - Step 7</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Data-Integration-Specialist-Superbadge-Step-7/m-p/71820#M44261</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'm getting an error message when triggering the SOAP call from the UI via record update:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;System.CalloutException: IO Exception: External server did not return any content&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I import the WSDL into SOAP UI and send the same package body, I receive this message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;HTTP /1.1 500&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Server: Cowboy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Content-Type: application/json;charset=UTF-8&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Transfer-Encoding: chunked&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Date: Mon, 10 Jul 2017 17:58:08 GMT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Via: 1.1 vegur&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Proxy-Connection: Keep-Alive&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Connection: Keep-Alive&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does this mean that the herokuapp needs to be restarted or something? Even when i was getting trained on &lt;A href="https://www.crsinfosolutions.com/salesforce-training-online/" target="_self"&gt;Salesforce&lt;/A&gt; also this topic was not discussed in detailed. I've found a couple of posts with sample code for this challenge and with a few small differences, mine matches from what I can tell. Here's the code I'm using:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;ProjectTrigger&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;trigger ProjectTrigger on Project__c (after update) {
    //Call the Billing Service callout logic here

    if (trigger.isAfter &amp;amp;&amp;amp; trigger.isUpdate) {
        BillingCalloutService.callBillingService(Trigger.new, Trigger.newMap, Trigger.old, Trigger.oldMap);
    }

}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;BillingCalloutService&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;public class BillingCalloutService {
    //Implement business and callout logic methods here
    public static void callBillingService(List&amp;lt;Project__c&amp;gt; newList, Map&amp;lt;Id, Project__c&amp;gt; newMap,
            List&amp;lt;Project__c&amp;gt; oldList, Map&amp;lt;Id, Project__c&amp;gt; oldMap) {

        if(!newList.isEmpty()) {
            Project__c project = newList[0];
            if (project.Status__c == 'Billable' &amp;amp;&amp;amp; oldMap.get(project.Id).Status__c != 'Billable') {
                // Get Service Credentials from custom settings
                ServiceCredentials__c credentials = ServiceCredentials__c.getInstance('BillingServiceCredential');
                billProject(project.ProjectRef__c, project.Billable_Amount__c, credentials.Username__c, credentials.Password__c);
            }
        }
    }

    @Future(callout=true)
    private static void billProject(String projectRef, Decimal billAmount, String username, String password) {

        BillingServiceProxy.project project = new BillingServiceProxy.project();
        project.projectRef = projectRef;
        project.billAmount = billAmount;
        project.username = username;
        project.password = password;

        BillingServiceProxy.InvoicesPortSoap11 invoiceCall = new BillingServiceProxy.InvoicesPortSoap11();
        // Make the callout and update the Status if callout is successful
        String response = invoiceCall.billProject(project);

        List&amp;lt;Project__c&amp;gt; projects = new List&amp;lt;Project__c&amp;gt;();
        if(response != null &amp;amp;&amp;amp; response.equalsIgnoreCase('OK')) {

            projects = [
                    Select Id, Status__c
                    From Project__c
                    Where ProjectRef__c = :projectRef
            ];
            if(!projects.isEmpty()) {
                projects[0].Status__c = 'Billed';
                update projects;
            }
        }

    }
}&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;STRONG&gt;BillingServiceProxy&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;//Generated by wsdl2apex

public class BillingServiceProxy {
    public class billProjectRequest_element {
        public BillingServiceProxy.project project;
        private String[] project_type_info = new String[]{'project','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://salesforce.com/th/invoice-web-service','true','false'};
        private String[] field_order_type_info = new String[]{'project'};
    }
    public class project {
        public String username;
        public String password;
        public String projectRef;
        public Double billAmount;
        private String[] username_type_info = new String[]{'username','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] password_type_info = new String[]{'password','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] projectRef_type_info = new String[]{'projectRef','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] billAmount_type_info = new String[]{'billAmount','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://salesforce.com/th/invoice-web-service','true','false'};
        private String[] field_order_type_info = new String[]{'username','password','projectRef','billAmount'};
    }
    public class billProjectResponse_element {
        public String status;
        private String[] status_type_info = new String[]{'status','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://salesforce.com/th/invoice-web-service','true','false'};
        private String[] field_order_type_info = new String[]{'status'};
    }
    public class InvoicesPortSoap11 {
        public String endpoint_x = 'http://sb-integration-bs.herokuapp.com:80/ws';
        public Map&amp;lt;String,String&amp;gt; inputHttpHeaders_x;
        public Map&amp;lt;String,String&amp;gt; outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://salesforce.com/th/invoice-web-service', 'BillingServiceProxy'};
        public String billProject(BillingServiceProxy.project project) {
            BillingServiceProxy.billProjectRequest_element request_x = new BillingServiceProxy.billProjectRequest_element();
            request_x.project = project;
            BillingServiceProxy.billProjectResponse_element response_x;
            Map&amp;lt;String, BillingServiceProxy.billProjectResponse_element&amp;gt; response_map_x = new Map&amp;lt;String, BillingServiceProxy.billProjectResponse_element&amp;gt;();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://salesforce.com/th/invoice-web-service',
              'billProjectRequest',
              'http://salesforce.com/th/invoice-web-service',
              'billProjectResponse',
              'BillingServiceProxy.billProjectResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.status;
        }
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me where i have done mistake?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 03 May 2020 20:03:56 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Data-Integration-Specialist-Superbadge-Step-7/m-p/71820#M44261</guid>
      <dc:creator>meghanchrls6</dc:creator>
      <dc:date>2020-05-03T20:03:56Z</dc:date>
    </item>
  </channel>
</rss>

