• Scapelli77
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies

Hi,

is possible to create a visualforce page that onload callout an external webservice  and when webservice return a byte[] view directly the PDF Document?

Is is possible there is any limit for do that?

 

Thanks

Simone

Hi,

I'm using this class generated by wsdl2apex

public class EAI_CallOutServices {
    public class Field {
        public String name;
        public String value;
        private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] value_type_info = new String[]{'value','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'name','value'};
    }
    public class SoftResponse {
        public EAI_CallOutServices.Return_x outSoft;
        private String[] outSoft_type_info = new String[]{'outSoft','http://tempuri.org/','Return','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'outSoft'};
    }
    public class SwitchInSLResponse {
        public EAI_CallOutServices.Return_x outSwitchInSL;
        private String[] outSwitchInSL_type_info = new String[]{'outSwitchInSL','http://tempuri.org/','Return','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'outSwitchInSL'};
    }
    public class SwitchInSL {
        public EAI_CallOutServices.SendObj inSwitchInSL;
        private String[] inSwitchInSL_type_info = new String[]{'inSwitchInSL','http://tempuri.org/','SendObj','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'inSwitchInSL'};
    }
    public class fieldsList {
        public EAI_CallOutServices.ArrayOfField Field;
        private String[] Field_type_info = new String[]{'Field','http://tempuri.org/','ArrayOfField','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'Field'};
    }
    public class Soft {
        public EAI_CallOutServices.SendObj inSoft;
        private String[] inSoft_type_info = new String[]{'inSoft','http://tempuri.org/','SendObj','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'inSoft'};
    }
    public class SwitchInTT {
        public EAI_CallOutServices.SendObj inSwitchInTT;
        private String[] inSwitchInTT_type_info = new String[]{'inSwitchInTT','http://tempuri.org/','SendObj','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'inSwitchInTT'};
    }
    public class SalesForce_ws_provider_SalesForceCallOut_Port {
        public String endpoint_x = 'http://localhost:8081/ws/SalesForce.ws.provider:SalesForceCallOut';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://tempuri.org/', 'EAI_CallOutServices'};
        public EAI_CallOutServices.Return_x SwitchInTT(EAI_CallOutServices.SendObj inSwitchInTT) {
            EAI_CallOutServices.SwitchInTT request_x = new EAI_CallOutServices.SwitchInTT();
            EAI_CallOutServices.SwitchInTTResponse response_x;
            request_x.inSwitchInTT = inSwitchInTT;
            Map<String, EAI_CallOutServices.SwitchInTTResponse> response_map_x = new Map<String, EAI_CallOutServices.SwitchInTTResponse>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'SalesForce_ws_provider_SalesForceCallOut_Binder_SwitchInTT',
              'http://tempuri.org/',
              'SwitchInTT',
              'http://tempuri.org/',
              'SwitchInTTResponse',
              'EAI_CallOutServices.SwitchInTTResponse'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.outSwitchInTT;
        }
        public EAI_CallOutServices.Return_x SwitchInSL(EAI_CallOutServices.SendObj inSwitchInSL) {
            EAI_CallOutServices.SwitchInSL request_x = new EAI_CallOutServices.SwitchInSL();
            EAI_CallOutServices.SwitchInSLResponse response_x;
            request_x.inSwitchInSL = inSwitchInSL;
            Map<String, EAI_CallOutServices.SwitchInSLResponse> response_map_x = new Map<String, EAI_CallOutServices.SwitchInSLResponse>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'SalesForce_ws_provider_SalesForceCallOut_Binder_SwitchInSL',
              'http://tempuri.org/',
              'SwitchInSL',
              'http://tempuri.org/',
              'SwitchInSLResponse',
              'EAI_CallOutServices.SwitchInSLResponse'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.outSwitchInSL;
        }
        public EAI_CallOutServices.Return_x Soft(EAI_CallOutServices.SendObj inSoft) {
            EAI_CallOutServices.Soft request_x = new EAI_CallOutServices.Soft();
            EAI_CallOutServices.SoftResponse response_x;
            request_x.inSoft = inSoft;
            Map<String, EAI_CallOutServices.SoftResponse> response_map_x = new Map<String, EAI_CallOutServices.SoftResponse>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'SalesForce_ws_provider_SalesForceCallOut_Binder_Soft',
              'http://tempuri.org/',
              'Soft',
              'http://tempuri.org/',
              'SoftResponse',
              'EAI_CallOutServices.SoftResponse'
              }
            );
            response_x = response_map_x.get('response_x');
            return response_x.outSoft;
        }
    }
    public class SFObj {
        public String objType;
        public String sfId;
        public EAI_CallOutServices.fieldsList fieldsList;
        private String[] objType_type_info = new String[]{'objType','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] sfId_type_info = new String[]{'sfId','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] fieldsList_type_info = new String[]{'fieldsList','http://tempuri.org/','fieldsList','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'objType','sfId','fieldsList'};
    }
    public class Return_x {
        public String result;
        public String description;
        private String[] result_type_info = new String[]{'result','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'result','description'};
    }
    public class ArrayOfField {
        public EAI_CallOutServices.Field[] ArrayOfFieldItem;
        private String[] ArrayOfFieldItem_type_info = new String[]{'ArrayOfFieldItem','http://tempuri.org/','Field','1','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'ArrayOfFieldItem'};
    }
    public class SendObj {
        public EAI_CallOutServices.docTypeRef_dx_cObj cObj;
        private String[] cObj_type_info = new String[]{'cObj','http://tempuri.org/','docTypeRef_dx_cObj','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'cObj'};
    }
    public class docTypeRef_dx_cObj {
        public EAI_CallOutServices.SFObj SFObj;
        private String[] SFObj_type_info = new String[]{'SFObj','http://tempuri.org/','SFObj','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'SFObj'};
    }
    public class SwitchInTTResponse {
        public EAI_CallOutServices.Return_x outSwitchInTT;
        private String[] outSwitchInTT_type_info = new String[]{'outSwitchInTT','http://tempuri.org/','Return','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'outSwitchInTT'};
    }
}
 

when we call the postSoft callout function we get the following exception:

 

System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element http://tempuri.org/=result Class.EAI_CallOutServices.SalesForce_ws_provider_SalesForceCallOut_Port.Soft: line 104, column 13 Class.OutBoundServices.postSoft: line 275, column 40

this is the response from the external server:

HTTP/1.1 200 OK
Content-Length: 712
Set-Cookie: ssnid=361ddb908e5e11debdf9b47ec05fba6f; path=/; HttpOnly
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/"></SOAP-ENV:Header><SOAP-ENV:Body>
<ser-root:SoftResponse xmlns:ser-root="
http://tempuri.org/">
<outSoft xmlns:dx="
http://tempuri.org/">
<dx:result>1</dx:result>
<dx:description>simulation</dx:description></outSoft></ser-root:SoftResponse></SOAP-ENV:Body>
</SOAP-ENV:Envelope>

we can't figure out what's going wrong... any help would be much appreciated ;D
thanks in advance!

Hi,i have just develope my first trigger, bu i cannot deploy it in to Unlimited Edition, why?
When i try to deploy the trigger, Eclipse failure the coverage test...

this is my trigger:

 trigger PaymentTerm on Opportunity (before insert, before update) {
   Opportunity[] MyOp = Trigger.
new;
   for (Opportunity p:MyOp){
       if (p.Description != 'World') {
           p.Description = 'World';
          }

      }
    }

thanks

Simone


Hi,
i haev two questions:
1) from an e-mail template, is possible to include a Case Object's field and its custom related list?
2) from an e-mail template, is possbile include a field that contain a html-code?  i try it but when i send an email, i receive a mail with a my field in txt format.
 
Thank's
Simone (IT)
Hi, is possible to create custom field by code?

Thank's

Simone

Hey

Periodically when running my batch process from a VisualForce page I get a "Read Timed Out" error.

 

I am not calling out to any external systems in my batch.

 

I have gotten this message from code that worked both before and after the problem batch, with no changes to the code in between.

 

Any explanation for this would be highly appreciated!

 

Thanks

Dave

  • November 10, 2009
  • Like
  • 0

Hi,i have just develope my first trigger, bu i cannot deploy it in to Unlimited Edition, why?
When i try to deploy the trigger, Eclipse failure the coverage test...

this is my trigger:

 trigger PaymentTerm on Opportunity (before insert, before update) {
   Opportunity[] MyOp = Trigger.
new;
   for (Opportunity p:MyOp){
       if (p.Description != 'World') {
           p.Description = 'World';
          }

      }
    }

thanks

Simone