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
jadenjaden 

Callout to webservice SOAP Failure

I am trying to call the webservice and getting the following error:

First error: Web service callout failed: WebService returned a SOAP Fault: Server did not recognize the value of HTTP Header SOAPAction: 

 

Here is the apex from the wsdl:

public class wsEdrnetComEnterpriseservicesAbsdata {
    public class APIGetAccount_element {
        private String[] apex_schema_type_info = new String[]{'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','true','false'};
        private String[] field_order_type_info = new String[]{};
    }
    public class APIUpdateAccount_element {
        public wsEdrnetComEnterpriseservicesAbsdata.APIExistingCustomer existingCustomer;
        private String[] existingCustomer_type_info = new String[]{'existingCustomer','http://Stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','APIExistingCustomer','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://Stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','true','false'};
        private String[] field_order_type_info = new String[]{'existingCustomer'};
    }
    public class APIUpdateAccountResult {
        private String[] apex_schema_type_info = new String[]{'http://Stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','true','false'};
        private String[] field_order_type_info = new String[]{};
    }
    public class APIAddNewAccountResponse_element {
        public wsEdrnetComEnterpriseservicesAbsdata.APIAddNewAccountResult APIAddNewAccountResult;
        private String[] APIAddNewAccountResult_type_info = new String[]{'APIAddNewAccountResult','http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','APIAddNewAccountResult','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','true','false'};
        private String[] field_order_type_info = new String[]{'APIAddNewAccountResult'};
    }
    public class APINewCustomer {
        public String CompanyName;
        public String ContactFirstName;
        public String ContactLastName;
        public String Address1;
        public String City;
        public String State;
        public String ZipCode;
        public String Country;
        public String Phone;
        public String Industry;
        private String[] CompanyName_type_info = new String[]{'CompanyName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] ContactFirstName_type_info = new String[]{'ContactFirstName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] ContactLastName_type_info = new String[]{'ContactLastName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Address1_type_info = new String[]{'Address1','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] City_type_info = new String[]{'City','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] State_type_info = new String[]{'State','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] ZipCode_type_info = new String[]{'ZipCode','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Country_type_info = new String[]{'Country','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Phone_type_info = new String[]{'Phone','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Industry_type_info = new String[]{'Industry','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','true','false'};
        private String[] field_order_type_info = new String[]{'CompanyName','ContactFirstName','ContactLastName','Address1','City','State','ZipCode','Country','Phone','Industry'};
    }
    public class SalesForceServiceSoap {
        public String endpoint_x = 'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice.asmx';
        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[]{'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice', 'wsEdrnetComEnterpriseservicesAbsdata'};
        public wsEdrnetComEnterpriseservicesAbsdata.APIUpdateAccountResult APIUpdateAccount(wsEdrnetComEnterpriseservicesAbsdata.APIExistingCustomer existingCustomer) {
            wsEdrnetComEnterpriseservicesAbsdata.APIUpdateAccount_element request_x = new wsEdrnetComEnterpriseservicesAbsdata.APIUpdateAccount_element();
            wsEdrnetComEnterpriseservicesAbsdata.APIUpdateAccountResponse_element response_x;
            request_x.existingCustomer = existingCustomer;
            Map<String, wsEdrnetComEnterpriseservicesAbsdata.APIUpdateAccountResponse_element> response_map_x = new Map<String, wsEdrnetComEnterpriseservicesAbsdata.APIUpdateAccountResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x, 
              //For testing the http is http://Stagews.edrnet	
              //For production the http is http://ws.edrnet
              'http://Stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice/APIUpdateAccount',
              'http://Stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice',
              'APIUpdateAccount',
              'http://Stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice',
              'APIUpdateAccountResponse',
              'wsEdrnetComEnterpriseservicesAbsdata.APIUpdateAccountResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.APIUpdateAccountResult;
        }
        public wsEdrnetComEnterpriseservicesAbsdata.APIAddNewAccountResult APIAddNewAccount(wsEdrnetComEnterpriseservicesAbsdata.APINewCustomer newCustomer) {
            wsEdrnetComEnterpriseservicesAbsdata.APIAddNewAccount_element request_x = new wsEdrnetComEnterpriseservicesAbsdata.APIAddNewAccount_element();
            wsEdrnetComEnterpriseservicesAbsdata.APIAddNewAccountResponse_element response_x;
            request_x.newCustomer = newCustomer;
            Map<String, wsEdrnetComEnterpriseservicesAbsdata.APIAddNewAccountResponse_element> response_map_x = new Map<String, wsEdrnetComEnterpriseservicesAbsdata.APIAddNewAccountResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice/APIAddNewAccount',
              'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice',
              'APIAddNewAccount',
              'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice',
              'APIAddNewAccountResponse',
              'wsEdrnetComEnterpriseservicesAbsdata.APIAddNewAccountResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.APIAddNewAccountResult;
        }
        public wsEdrnetComEnterpriseservicesAbsdata.APIGetAccountResult APIGetAccount() {
            wsEdrnetComEnterpriseservicesAbsdata.APIGetAccount_element request_x = new wsEdrnetComEnterpriseservicesAbsdata.APIGetAccount_element();
            wsEdrnetComEnterpriseservicesAbsdata.APIGetAccountResponse_element response_x;
            Map<String, wsEdrnetComEnterpriseservicesAbsdata.APIGetAccountResponse_element> response_map_x = new Map<String, wsEdrnetComEnterpriseservicesAbsdata.APIGetAccountResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice/APIGetAccount',
              'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice',
              'APIGetAccount',
              'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice',
              'APIGetAccountResponse',
              'wsEdrnetComEnterpriseservicesAbsdata.APIGetAccountResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.APIGetAccountResult;
        }
    }
    public class APIAddNewAccount_element {
        public wsEdrnetComEnterpriseservicesAbsdata.APINewCustomer newCustomer;
        private String[] newCustomer_type_info = new String[]{'newCustomer','http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','APINewCustomer','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','true','false'};
        private String[] field_order_type_info = new String[]{'newCustomer'};
    }
    public class APIAddNewAccountResult {
        private String[] apex_schema_type_info = new String[]{'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','true','false'};
        private String[] field_order_type_info = new String[]{};
    }
    public class APIUpdateAccountResponse_element {
        public wsEdrnetComEnterpriseservicesAbsdata.APIUpdateAccountResult APIUpdateAccountResult;
        private String[] APIUpdateAccountResult_type_info = new String[]{'APIUpdateAccountResult','http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','APIUpdateAccountResult','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','true','false'};
        private String[] field_order_type_info = new String[]{'APIUpdateAccountResult'};
    }
    public class APIExistingCustomer {
        public String AccountNumber;
        public String Password;
        public String Email;
        public String Address2;
        public String Fax;
        public String AEName;
        public String Initials;
        private String[] AccountNumber_type_info = new String[]{'AccountNumber','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Password_type_info = new String[]{'Password','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Email_type_info = new String[]{'Email','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Address2_type_info = new String[]{'Address2','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Fax_type_info = new String[]{'Fax','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] AEName_type_info = new String[]{'AEName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Initials_type_info = new String[]{'Initials','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','true','false'};
        private String[] field_order_type_info = new String[]{'AccountNumber','Password','Email','Address2','Fax','AEName','Initials'};
    }
    public class APIResponse {
        public Boolean Successful;
        public String Message;
        public String Code;
        private String[] Successful_type_info = new String[]{'Successful','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'};
        private String[] Message_type_info = new String[]{'Message','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Code_type_info = new String[]{'Code','http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','ReturnCodes','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','true','false'};
        private String[] field_order_type_info = new String[]{'Successful','Message','Code'};
    }
    public class APIGetAccountResponse_element {
        public wsEdrnetComEnterpriseservicesAbsdata.APIGetAccountResult APIGetAccountResult;
        private String[] APIGetAccountResult_type_info = new String[]{'APIGetAccountResult','http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','APIGetAccountResult','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','true','false'};
        private String[] field_order_type_info = new String[]{'APIGetAccountResult'};
    }
    public class APIGetAccountResult {
        private String[] apex_schema_type_info = new String[]{'http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice','true','false'};
        private String[] field_order_type_info = new String[]{};
    }
}

 

Here is my class to call it:

public class ABSCalloutClass  {

    public static void CallABSWS(Set<Id> idsn){
		list <Account> acctRecs;
		string AccttoUpdateID;
		string ConFirstName;
		string ConLastName;
		string ConEmail;
		string AcctOwner;
		
         //Creating a List from a SOQL query using idsn
          acctRecs  = [SELECT acc.Id, acc.ownerid FROM Account acc WHERE acc.ID in :Idsn];
            
    	system.debug('The acctrecs is ' + acctRecs);
    	
    	if (acctRecs.size() == 0)
        	return;  
        	
		list<id> owner_ids = new List<id>();
		For(Account a: acctRecs)
		{
			Owner_ids.add(a.OwnerID);
		} 
		Map<id,User> owners = new Map<id,User>([SELECT ID, Name from User WHERE id in :owner_ids]);
		system.debug('map of owners ' + owners);
		list <AccountContactRole> Contacts = 
			[SELECT id, contactId, role, contact.ID, contact.AccountID, contact.FirstName, contact.LastName, contact.Email
			 from AccountContactRole  
			 Where contact.Accountid in :idsn and contact.Primary_Contact__c = :true and (role = 'Billing' or role = 'Accounting' or role = 'Primary')]; 

		system.debug(' the contact list is ' + Contacts);
		
        //iterate thru the ids	
        for (Account Acct: acctRecs) {	
         	AccttoUpdateID = Acct.Id;
			If(owners.containskey(Acct.Ownerid))
				AcctOwner=owners.get(Acct.Ownerid).Name;
				
         	system.debug('the contacts are ' + Contacts);
         	for (AccountContactRole con: Contacts) { 
         		if (con.contact.AccountID == AccttoUpdateID) {
         			ConFirstName = Con.contact.Firstname;
         			ConLastName = Con.contact.Lastname;
         			ConEmail = Con.contact.Email;
         		}
         	}
         	system.debug('about to invoke call, the account is   ' + AccttoUpdateID + ' and the owner is ' + AcctOwner);
        	CallUpdateInvokeWebService(AccttoUpdateID, ConFirstName, ConLastName, ConEmail, AcctOwner);	
        }
    }  
    @future(callout=true)  	  
	public static void CallUpdateInvokeWebService(String AccttoUpdateID, String ConFirstName, String ConLastName, String ConEmail, string AcctOwner) {
	 	Account AccttoUpdate;
	 	
         // Need to add other fields once resolved.
	 	AccttoUpdate = [SELECT acc.Id, acc.Name, acc.AccountNumber, acc.EDR_Password__c, acc.Industry, acc.Phone, acc.Fax,
	 					acc.Ownerid, acc.ShippingStreet,acc.Shippingcity, acc.ShippingState, acc.ShippingCountry, acc.ShippingPostalCode,
						acc.BillingStreet,acc.BillingCity, acc.BillingState, acc.BillingCountry, acc.BillingPostalCode
            			FROM Account acc  
            			WHERE acc.ID = :AccttoUpdateID];
   	
        system.debug('The name is ' + AccttoUpdate.name + ' the number is ' + AccttoUpdate.AccountNumber);
		
//        If(trigger.isUpdate) {     
            //Create Instance of service call 
        	wsEdrnetComEnterpriseservicesAbsdata.APIExistingCustomer edrCustomer = new
            wsEdrnetComEnterpriseservicesAbsdata.APIExistingCustomer();
            
        	wsEdrnetComEnterpriseservicesAbsdata.APINewCustomer edrNewCustomer = new
            wsEdrnetComEnterpriseservicesAbsdata.APINewCustomer();
            
            wsEdrnetComEnterpriseservicesAbsdata.APIResponse edrAPIResponse = new
            wsEdrnetComEnterpriseservicesAbsdata.APIResponse();
                   
            edrCustomer.AccountNumber = AccttoUpdate.AccountNumber;
            edrCustomer.Password=AccttoUpdate.EDR_Password__c; 
            edrNewCustomer.CompanyName = AccttoUpdate.Name; 
			edrNewCustomer.ContactFirstName=ConFirstName;
            
	        edrNewCustomer.ContactLastName = ConLastName;
        	edrNewCustomer.City = AccttoUpdate.BillingCity;
        	edrNewCustomer.State = AccttoUpdate.BillingState;
        	edrNewCustomer.ZipCode = AccttoUpdate.BillingPostalCode;
        	edrNewCustomer.Country = AccttoUpdate.BillingCountry;
        	edrNewCustomer.Phone = AccttoUpdate.Phone;
        	edrNewCustomer.Industry = AccttoUpdate.Industry;
        	edrCustomer.Email = ConEmail;
        	edrCustomer.Fax = AccttoUpdate.Fax;
        	edrCustomer.AEName=AcctOwner;
       		
       		//Split SF Street into 2 fields
       		List<string> address_parts = new List<String>();
			Address_parts=AccttoUpdate.BillingStreet.split('\n');

			If(address_parts.size()>=1)
			  edrNewCustomer.Address1=address_parts[0];
			  
			  system.debug('the address 1 is ' + edrNewCustomer.Address1); 
			  
			If(address_parts.size()>=2)
			  edrCustomer.Address2=address_parts[1];
			  
			  system.debug('the address 2 is ' + edrCustomer.Address2); 
			//If(address_parts.size()>=3)
			//Address3=address_parts[2];
       	
             wsEdrnetComEnterpriseservicesAbsdata.SalesForceServiceSoap edrNet = 
             new wsEdrnetComEnterpriseservicesAbsdata.SalesForceServiceSoap();
                 
             system.debug('about to call update');
               
             wsEdrnetComEnterpriseservicesAbsdata.APIUpdateAccountResult result = 
             edrNet.APIUpdateAccount(edrCustomer);
             system.debug('back from call update'); 
           
             
//        } // If trigger upadte    
	}	
}

 Thank you for time if you can help with this.

sdetweilsdetweil

and the wsdl source?

 

if this is a new service, you could use SoapUI to test sending messages to verify operation before calling from SF..

 

a google search (bing, yahoo...) wil find soapui.. not free, but the trial version will last long enough

Sam

jadenjaden

Here is the wsdl.

 

I will take a look at soupui

 

Thanks, I do appreciate the help.

 

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://ws.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://ws.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Sales Force Service Integration</wsdl:documentation>
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://ws.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice">
      <s:element name="APIAddNewAccount">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="newCustomer" type="tns:APINewCustomer" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="APINewCustomer">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="CompanyName" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="ContactFirstName" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="ContactLastName" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="Address1" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="City" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="State" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="ZipCode" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="Country" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="Phone" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="Industry" type="s:string" />
        </s:sequence>
      </s:complexType>
      <s:element name="APIAddNewAccountResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="APIAddNewAccountResult" type="tns:APIAddNewAccountResult" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="APIAddNewAccountResult">
        <s:complexContent mixed="false">
          <s:extension base="tns:APIResponse" />
        </s:complexContent>
      </s:complexType>
      <s:complexType name="APIResponse">
        <s:sequence>
          <s:element minOccurs="1" maxOccurs="1" name="Successful" type="s:boolean" />
          <s:element minOccurs="0" maxOccurs="1" name="Message" type="s:string" />
          <s:element minOccurs="1" maxOccurs="1" name="Code" type="tns:ReturnCodes" />
        </s:sequence>
      </s:complexType>
      <s:simpleType name="ReturnCodes">
        <s:restriction base="s:string">
          <s:enumeration value="Unknown" />
          <s:enumeration value="Successful" />
          <s:enumeration value="MaintenanceInProgress" />
          <s:enumeration value="WebOrdersDatabaseFailure" />
          <s:enumeration value="SessionDatabaseFailure" />
          <s:enumeration value="ABSDatabaseFailure" />
          <s:enumeration value="ReportDatabaseFailure" />
          <s:enumeration value="InvalidCredentials" />
          <s:enumeration value="InvalidSystemID" />
          <s:enumeration value="InvalidRequest" />
          <s:enumeration value="UnexpectedException" />
          <s:enumeration value="ApplicationException" />
        </s:restriction>
      </s:simpleType>
      <s:complexType name="APIGetAccountResult">
        <s:complexContent mixed="false">
          <s:extension base="tns:APIResponse" />
        </s:complexContent>
      </s:complexType>
      <s:complexType name="APIUpdateAccountResult">
        <s:complexContent mixed="false">
          <s:extension base="tns:APIResponse" />
        </s:complexContent>
      </s:complexType>
      <s:element name="APIUpdateAccount">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="existingCustomer" type="tns:APIExistingCustomer" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="APIExistingCustomer">
        <s:complexContent mixed="false">
          <s:extension base="tns:APINewCustomer">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" name="AccountNumber" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="Email" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="Address2" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="Fax" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="AEName" type="s:string" />
              <s:element minOccurs="0" maxOccurs="1" name="Initials" type="s:string" />
            </s:sequence>
          </s:extension>
        </s:complexContent>
      </s:complexType>
      <s:element name="APIUpdateAccountResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="APIUpdateAccountResult" type="tns:APIUpdateAccountResult" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="APIGetAccount">
        <s:complexType />
      </s:element>
      <s:element name="APIGetAccountResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="APIGetAccountResult" type="tns:APIGetAccountResult" />
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="APIAddNewAccountSoapIn">
    <wsdl:part name="parameters" element="tns:APIAddNewAccount" />
  </wsdl:message>
  <wsdl:message name="APIAddNewAccountSoapOut">
    <wsdl:part name="parameters" element="tns:APIAddNewAccountResponse" />
  </wsdl:message>
  <wsdl:message name="APIUpdateAccountSoapIn">
    <wsdl:part name="parameters" element="tns:APIUpdateAccount" />
  </wsdl:message>
  <wsdl:message name="APIUpdateAccountSoapOut">
    <wsdl:part name="parameters" element="tns:APIUpdateAccountResponse" />
  </wsdl:message>
  <wsdl:message name="APIGetAccountSoapIn">
    <wsdl:part name="parameters" element="tns:APIGetAccount" />
  </wsdl:message>
  <wsdl:message name="APIGetAccountSoapOut">
    <wsdl:part name="parameters" element="tns:APIGetAccountResponse" />
  </wsdl:message>
  <wsdl:portType name="SalesForceServiceSoap">
    <wsdl:operation name="APIAddNewAccount">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Sends an AddNewAccount request by email.</wsdl:documentation>
      <wsdl:input message="tns:APIAddNewAccountSoapIn" />
      <wsdl:output message="tns:APIAddNewAccountSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="APIUpdateAccount">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Sends an UpdateAccount request by email.</wsdl:documentation>
      <wsdl:input message="tns:APIUpdateAccountSoapIn" />
      <wsdl:output message="tns:APIUpdateAccountSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="APIGetAccount">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Gets account information.</wsdl:documentation>
      <wsdl:input message="tns:APIGetAccountSoapIn" />
      <wsdl:output message="tns:APIGetAccountSoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="SalesForceServiceSoap" type="tns:SalesForceServiceSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="APIAddNewAccount">
      <soap:operation soapAction="http://ws.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice/APIAddNewAccount" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="APIUpdateAccount">
      <soap:operation soapAction="http://ws.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice/APIUpdateAccount" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="APIGetAccount">
      <soap:operation soapAction="http://ws.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice/APIGetAccount" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="SalesForceService">
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Sales Force Service Integration</wsdl:documentation>
    <wsdl:port name="SalesForceServiceSoap" binding="tns:SalesForceServiceSoap">
      <soap:address location="http://stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice.asmx" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

 

sdetweilsdetweil

does it fail if u call the web service class from an apex controller class used by a VF page (without the @future)..

 

I found this the best way to test my web service method. 

I then created an asynch path thru the code, but left the default as a synch path for other uses and testing.

 

Sam

jadenjaden

Could you explain further your test method; maybe an example; I am still a newbie (in my mind anyway) and this is my first webservice work.

 

Thank you for your time

 

 

sdetweilsdetweil

i use the webservice thru a trigger in normal mode.. but i created a VF page an apex controller to exercise the web service without using the trigger..

 

this allows me to make sure the data part works, without adding the trigger complexities...

 

this is easy, cause you just use the web service as created by the wsdl2apex generated code.

 

Sam

jadenjaden

I took your suggestion and created the VF page to call the webservice without the trigger.

 

It still fails, here is teh clip from the sytem log:

06:59:19.265 (265210000)|CALLOUT_REQUEST|[67]|wsEdrnetComEnterpriseservicesAbsdata.APIUpdateAccount_element request_x::SFDC_STACK_DEPTH=1 SOAPAction="http://Stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice/APIUpdateAccount" User-Agent=SFDC-Callout/23.0 Accept=text/xml Content-Type=text/xml; charset=UTF-8

06:59:19.334 (334161000)|EXCEPTION_THROWN|[67]|System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: Server did not recognize the value of HTTP Header SOAPAction: http://Stagews.edrnet.com/enterpriseservices/absdataintegrationservices/salesforceservice/APIUpdateAccount. faultcode=soap:Client faultactor=

06:59:19.334 (334477000)|SYSTEM_METHOD_EXIT|[67]|WebServiceCallout.invoke(APEX_OBJECT, APEX_OBJECT, MAP, LIST)

06:59:19.334 (334590000)|METHOD_EXIT|[113]|01pM00000008fYv|wsEdrnetComEnterpriseservicesAbsdata.SalesForceServiceSoap.APIUpdateAccount(wsEdrnetComEnterpriseservicesAbsdata.APIExistingCustomer)

06:59:19.334 (334665000)|METHOD_EXIT|[48]|01pM00000008fYz|ABSCalloutClass.CallUpdateInvokeWebService(String, String, String, String, String)

 

 

I notice that the InputHttpHeader; should I be setting something up and setting values for that?   

 

Would I put something like this:

edrNet.inputHttpHeaders_x = new Map<String, String>();

edrNet.inputHttpHeaders_x.put('myHeader', 'myValue');

 

Here is my calling statement

 

             wsEdrnetComEnterpriseservicesAbsdata.SalesForceServiceSoap edrNet =

             new wsEdrnetComEnterpriseservicesAbsdata.SalesForceServiceSoap();

 

Thank you

sdetweilsdetweil

I'm not sure where u are getting that call from

 

usually I see

 

class_of_webservice var_name = new class_of_webservice();

var_name.method( parms);

 

so in your case it would be

 

var_name.APIAddNewAccount();

 

I would get the SoapUI tool (use google) to make sure your webservice server  is responding as u expect.

jadenjaden

The call to webservice is this:

             wsEdrnetComEnterpriseservicesAbsdata.APIUpdateAcco​untResult result =
             edrNet.APIUpdateAccount(edrCustomer);

 

Full class listed in previous post;  I am trying to figure our what I should be setting up for the inputheader.

 

Thanks

sdetweilsdetweil

you should not have to define that ,.. the soap protocol should handle it all..

 

just to give u more importance on using SoapUI, I had to change my implementation because we added more data to the api.

I edited the Wsdl, generated a new class, generated a new server, and suddenly nothing would work..

server received unexpected param..

 

i worked for over a week trying to figure out what data was missing.. my old code, unchanged for a year,  failed the same way. (SF had a system upgrade since the last time I had done any testing, so maybe something changed) finally after a weekend away doing something else, I dragged out SoapUI, and it told me the server was not running.. sure enough..   the error message was the problem.

 

Sam