• Neha@Sfdc
  • NEWBIE
  • 40 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 28
    Replies
Hi all,

i need to invoke a webservice that can be accssed by specifying the credentials.
However i do not find an appropriate way to specify the credentials 
in my WSDLToApex class.Below is my Auto generated WSDLToApex class
 
//Generated by wsdl2apex

public class mmmmmSfdcOrdersinbound {
    public class OrderResponse_element {
        public String External_Reference_xc;
        public String SAP_SalesOrder_Id_xc;
        private String[] External_Reference_xc_type_info = new String[]{'External_Reference__c','urn:mmmmm:sfdc:ordersinbound',null,'0','1','true'};
        .....
	........

    public class Order_Line_Item_xc {
        public Integer Line;
        public String Product_xc;
        public String Product_Description_xc;
        public Double Quantity_xc;
        public String Expected_Delivery_date_xc;
        public String Sales_Unit_xc;
        public Boolean FOC_xc;
        private String[] Line_type_info = new String[]{'Line','urn:mmmmm:sfdc:ordersinbound',null,'0','1','true'};
        ......
 	......

    public class OrderRequest_element {
        public String CreatedBy;
        public String LastModifiedBy;
        public String Owner;
        public String RecordType;
        public String Account_Owner_xc;
        public String Business_Partner_xc;
        public String Contact_Person_xc;
        public String Delivery_date_xc;
        public String Description_xc;
        public String External_Reference_xc;
        public Double Net_Value_xc;
        public String Partner_Id_xc;
        public String Sales_Organisation_xc;
        public String Status_xc;
        public String Visit_xc;
        public String Wholesaler_xc;
        public mmmmmSfdcOrdersinbound.Order_Line_Item_xc[] Order_Line_Item_xc;
        private String[] CreatedBy_type_info = new String[]{'CreatedBy','urn:mmmmm:sfdc:ordersinbound',null,'0','1','true'};
        private String[] LastModifiedBy_type_info = new String[]{'LastModifiedBy','urn:mmmmm:sfdc:ordersinbound',null,'0','1','true'};
        .........
	.........

    public class Soap {
        public String endpoint_x = 'XXXxXXXXXXXX';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> 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[]{'urn:mmmmm:sfdc:ordersinbound', 'mmmmmSfdcOrdersinbound'};

        public mmmmmSfdcOrdersinbound.OrderResponse_element MIOA_SFDC_to_SAP_Order(String CreatedBy,String LastModifiedBy,String Owner,String RecordType,String Account_Owner_xc,String Business_Partner_xc,String Contact_Person_xc,String Delivery_date_xc,String Description_xc,String External_Reference_xc,Double Net_Value_xc,String Partner_Id_xc,String Sales_Organisation_xc,String Status_xc,String Visit_xc,String Wholesaler_xc,mmmmmSfdcOrdersinbound.Order_Line_Item_xc[] Order_Line_Item_xc) {
            mmmmmSfdcOrdersinbound.OrderRequest_element request_x = new mmmmmSfdcOrdersinbound.OrderRequest_element();
            request_x.CreatedBy = CreatedBy;
            request_x.LastModifiedBy = LastModifiedBy;
            request_x.Owner = Owner;
             ....
            ......
            .......

            request_x.Order_Line_Item_xc = Order_Line_Item_xc;
            mmmmmSfdcOrdersinbound.OrderResponse_element response_x;
            Map<String, mmmmmSfdcOrdersinbound.OrderResponse_element> response_map_x = new Map<String, mmmmmSfdcOrdersinbound.OrderResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'urn:mmmmm:sfdc:ordersinbound',
              'OrderRequest',
              'urn:mmmmm:sfdc:ordersinbound',
              'OrderResponse',
              'mmmmmSfdcOrdersinbound.OrderResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x;
        }
    }
}
Can anyone please let me know as to how and where do i specify the credentials?
Or what adjustments do i need to make in the auto generated apex class?


Thanks
hi all,
  1. Can anyone explain what exactly is force.com builder?
  2. What all can be done using the force.com builder?
Hi All,
  • i have a scenario where i want to access List<List<SObject>> lst=[FIND :inputText RETURNING Account(name),Product2(name)]
  • lst contains list of two different types and i want to anyhow show this list values on  a visual force page
  • I assume that it is possible to do so by the following
for(List<sObject> obj:showContent)
 {
    for(sObject accSobj:obj)
     {   
        
        contentData.add(accSobj);
       
   }
}

But i am unable to access contentData on my vf

Any help would be appreciated

Thanks,
Neha 
I was setting up live agent in my org.
  • i copied the button create code and the deployment code and pasted it in my VF page(home page of my force.com site)
  • When i click on the online icon it opens a pop up with the below error:
  • HTTP ERROR: 500

    Problem accessing /content/s/prechatVisitor. Reason:

    This is not a JSON Array.
  • When i copy the same code in an html file and try for a live chat it seems to be working fine
  • Then why not with my VF page?
Any help Would be appreciated

Thanks,
Neha Patil

  •  
I would like to know if there is any way to  render the images in a pdf file?

Thanks,
Neha
my apex class method is trying to call an external webservice function, and it gives this
 
Failed to invoke future method 'public static void mycall()'

Debug Log:
System.CalloutException: Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':html'
 
any idea of how to fix this? what should I do to make it work?