• Marcony
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

Please help!

I’ve created an APEX class

 

 

global class LeadImporterExternal {

       WebService static String importLead(String xmlParameter) {

              leadImporter importer = new leadImporter();

              return importer.importLead(xmlParameter);

       }

}

 

Downloaded WSDL file for this class. Using this file I have generated a C# code for accessing a web service.

In my code, I’m calling this service in the following way:

 

 

 

SforceService SFSevice = new SforceService();

LoginResult loginResult = SFSevice.login(userName, password);

 

LeadImporterExternalService myService = new LeadImporterExternalService();

myService.Url = loginResult.serverUrl;

myService.SessionHeaderValue = new SessionHeader();

myService.SessionHeaderValue.sessionId = loginResult.sessionId;

 

string result = myService.importLead(xmlText);

 

 

 

But I keep getting an error SoapHeaderException: No operation available for request

{http://soap.sforce.com/schemas/class/LeadImporterExternal}importLead.

 

Can someone tell me why this is not working and what I’m doing wrong?

I’ll appreciate any help

Thanks!

I am getting the following error on a custom Visualforce page:

Type is not visible: test

 

Vforce Page:

<apex:page controller="EditCases" tabstyle="Case"> <apex:sectionHeader title="Edit Cases" subtitle="Bug Meeting Mass Update" /> <apex:form > <apex:pageBlock mode="edit" title="Mass Update Cases"> <p><apex:outputText value="{!headerMessage}" /></p> <h3>Report Criteria: </h3> <p></p> <table style="width: 100%"> <tr> <td rowspan="3" width="50px" height="50px"><img src="https://ssl.salesforce.com/servlet/servlet.ImageServer?id=01500000000crMo&oid=00D00000000hZTB&lastMod=1235399976000"></img></td> <td>Sub Status contains <i>bug</i> </td> </tr> <tr> <td>ETA is <i>NULL</i></td> </tr> <tr> <td>Status is <i>Pending</i> or <i>Suspended</i></td> </tr> </table> <br /> <apex:pageblockSection id="Cases" columns="1" title="Bug Meeting Cases" rendered="{!canEdit}"> <apex:pageblocktable align="center" value="{!Cases}" var="Case" title="Cases" width="100%"> <apex:column headerValue="Case Number" width="10%"><apex:outputLink value="/{!Case.ID}">{!Case.CaseNumber}</apex:outputlink></apex:column> <apex:column headerValue="Account" width="15%"><apex:outputLink value="/{!Case.Account.ID}">{!Case.Account.Name}</apex:outputlink></apex:column> <apex:column headerValue="Bug ID" width="50%"><apex:inputField value="{!Case.Bug_ID__c}" /></apex:column> <apex:column headerValue="Subject" width="50%"><apex:inputField value="{!Case.Subject}"/></apex:column> <apex:column headerValue="Bug Description" width="50%"><apex:inputField value="{!Case.Bug_Description__c}" /></apex:column> <apex:column headerValue="Summary" width="50%"><apex:inputField value="{!Case.Bug_Meeting_Summary__c}" /></apex:column> <apex:column headerValue="ETA" width="50%"><apex:inputField value="{!Case.ETA_version__c}" /></apex:column> <apex:column headerValue="Assigned To" width="50%"><apex:inputField value="{!Case.Bug_Assigned__c}" /></apex:column> <apex:column headerValue="Status" width="15%"><apex:inputField value="{!Case.Status}"/></apex:column> <apex:column headerValue="Sub Status" width="15%"><apex:inputField value="{!Case.Sub_Condition__c}"/></apex:column> </apex:pageblockTable> </apex:pageblockSection> <p/> <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save Cases" rendered="{!canEdit}" /> <apex:commandButton action="{!cancel}" value="Cancel" /> </apex:pageblockButtons> </apex:pageBlock> </apex:form> </apex:page>

 

 

Apex Class+Test:

public class EditCases { List<Case> cases; String headerMessage; Boolean canEdit = true; public EditCases() { cases = getcases();+ headerMessage = getHeaderMessage(); canEdit = getCanEdit(); } public List<Case> getCases() { if (cases == null) { cases = [ select Id, CaseNumber, Priority, Status, Subject, Case.Account.ID,Case.Account.Name,Case.Bug_ID__c,Case.Bug_Description__c,Case.Bug_Meeting_Summary__c,Case.ETA_version__c, CreatedDate,Sub_Condition__c, Bug_Assigned__c from Case where sub_condition__C like '%Bug%' and ETA_version__C = null and (Status = 'Pending' or Status = 'Suspended') order by CaseNumber]; return cases; } else { return cases; } } public String getHeaderMessage() { String message = ''; if (cases.size() == 0) { message = 'There are no cases to edit.'; canEdit = false; } else { canEdit = true; } return message; } public Boolean getCanEdit() { return canEdit; } // Action that is executed if Save button is clicked public PageReference save() { // Return to Cases tab page after editing PageReference returnPage = new PageReference('/500/o'); // Save all changes update cases; return returnPage; } // Action that is executed if Cancel button is clicked. public PageReference cancel() { // Return to Cases tab page after editing PageReference returnPage = new PageReference('/500/o'); return returnPage; } public static testMethod void tesEditCases() { // Create the necessary records to test automatic order creation // Create a case // This assumes that the pick list values used exist for // - Priority (High) // - Status (New) // - Origin (Phone) Case testCase = new Case( Priority = 'High', Subject = 'Test Subject', Status = 'Pending', LPTicket__c = 'LTK12345X', sub_condition__C = 'Bug Meeting', // ETA_version__C = '8.4', // Bug_ID__C = '1234', Origin = 'Phone'); insert testCase; //************************** // Test EditCases controller //************************** PageReference pageRef = Page.EditCases; Test.setCurrentPage(pageRef); // Create an instance of the controller EditCases editCasesController = new EditCases(); // Get the list of cases from the controller List<Case> casesToEdit = editCasesController.getCases(); // Verify that there is at least one case to edit system.assertEquals(casesToEdit.size() > 0, true); // Retrieve the header message String editCasesMessage = editCasesController.getHeaderMessage(); // Verify that the header message is blank system.assertEquals(editCasesMessage, ''); // Check the Cancel action String canceleditCasesPage = editCasesController.cancel().getUrl(); // Check the save action String editCasesPage = editCasesController.save().getUrl(); } }

 

Nothing has changed in my environment or in my apex class and Vforce pages. Any help or suggestions welcome.

Hi,

I am getting the error specified as the subject when i create a Campaign in VC#. There is no issue of access rights in this case for sure, since I am the System Administrator.

The code is pretty simple. I just create a Campaign object, and call binding.create method with the campaign object as an sObject array. The binding is correct, because I am using it to query the Campaign object earlier as well, that returns correct results

Thanks,
  • October 14, 2008
  • Like
  • 0