function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion 

Web service execution error

I drew a small webservice out of my dev  org and consumed it into another ...It doesnt have login method so i also  drew a second enterprise type wsdl  and consumed it also into the other dev org ..So the login problem got sorted as i can see my debug log, but my method gives me null poiter dereferencing error "System.NullPointerException: Attempt to de-reference a null object  "  


My method goes like this and its written in future method ...

enterpriseSoapSforceCom.LoginResult lr= new enterpriseSoapSforceCom.LoginResult();
      enterpriseSoapSforceCom.Soap Esoap= new enterpriseSoapSforceCom.Soap();      
    //  try
     // {       
       //MYWebservice34.SessionHeader_element sh = new MYWebservice34.SessionHeader_element();
      // String authEndPoint = Esoap.Url;
    //  }
     // catch (SoapException e)
     // {
       // Console.WriteLine('An unexpected error has occurred: ' + e.Message + '\n' + e.StackTrace);
     // }
      soapSforceComSchemasClassMywebservi.Account myass= new soapSforceComSchemasClassMywebservi.Account();
      Account a=[Select BillingCity,Name,BillingCountry,BillingPostalCode,BillingStreet,Phone,Site from Account where id=:aa Limit 1];
      soapSforceComSchemasClassMywebservi.MyWebService  Serv=new soapSforceComSchemasClassMywebservi.MyWebService ();
      Serv.makeContact('Rick',myass);  //error occurs here ....

 Help needed ....


What could be possible reason .....


Code of my webservice is this ....

global class MyWebService 
    webService static Id makeContact(String lastName, Account a) 
        Contact c = new Contact(lastName = 'Weissman',firstname = a.Name);
        insert c;


It simply receives a string and an account which i am sending  from the other org as given above ..



anyone from integration.....

Abhishek - Any reason why simpler integration concepts like S2S have not been explored. This should make your life easier. HAve a look at the link below to see if it helps?

That i am already done with , but to know integration to some differenct vertical i m doing this ...





this guy has done this but dont know how ...I am trying the same

The response is based on exposing apex classes via sites which itself is a security hazard. What prevents a bot from posting multiple spam leads into your org if you expose it that way? This will certainly be not an acceptable solution for practical deployments. I will investigate your error further and come back...

Hi VBS any solution ???......If you have reached upon ,, and I really dont got your funda of exposing classes via sites, I am not doing anything regarding sites ......I hope u have got my exact problem as described above .....If any more questions and any kind of help u need i am available ....