• bwinklesky
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 6
    Replies
I'm curious if anybody has had issues trying to login to the API using the sandbox account? I can connect to the Apex Explorer with my login and token, but no luck logging into the API. Any help is greatly appreciated. 
Does anybody know the exact syntax (VB or C#) to send an email using the email api?  so far i have something like this, but I can't get the "result" part to work correctly. Any help is appreciated!! 
 

Dim messages As SingleEmailMessage = New SingleEmailMessage()

messages.bccAddresses("test@test.com").ToString()

messages.toAddresses("test@test.com").ToString()

messages.plainTextBody = "test"

Dim result As sforce.SendEmailResult()

result = sfWebHost.sendEmail(messages)

blank_page

Hi all-

 

I'm wondering if someone can help me figure out the solution to my problem.  I generated an apex class from the WSDL class generator, and this is part of the output. However, I have been told that I will need to ensure the the SOAP responses are described in the WSDL.  I'm not a SOAP expert so I don't know where to begin...  So, I have posted the two types of responses that come back from our web service provider as well as how its defined in the WSDL.   ANY help is greatly appreciated...

 

 

public csCallCenterWS.CreateNewAccountResult_element CreateNewAccount(String strUser,String strPin,Integer lngSiteID,String strFirstName,String strLastName,String strAccountName,String strAccountType,String strAddress1,String strAddress2,String strCity,String strState,String strZip,String strEmail,String strHomePhone) { csCallCenterWS.CreateNewAccount_element request_x = new csCallCenterWS.CreateNewAccount_element(); csCallCenterWS.CreateNewAccountResponse_element response_x; request_x.strUser = strUser; request_x.strPin = strPin; request_x.lngSiteID = lngSiteID; request_x.strFirstName = strFirstName; request_x.strLastName = strLastName; request_x.strAccountName = strAccountName; request_x.strAccountType = strAccountType; request_x.strAddress1 = strAddress1; request_x.strAddress2 = strAddress2; request_x.strCity = strCity; request_x.strState = strState; request_x.strZip = strZip; request_x.strEmail = strEmail; request_x.strHomePhone = strHomePhone; Map<String, csCallCenterWS.CreateNewAccountResponse_element> response_map_x = new Map<String, csCallCenterWS.CreateNewAccountResponse_element>(); response_map_x.put('response_x', response_x); WebServiceCallout.invoke( this, request_x, response_map_x, new String[]{endpoint_x, 'http://centershift.com/csCallCenter/csCallCenterService/CreateNewAccount', 'http://centershift.com/csCallCenter/csCallCenterService', 'CreateNewAccount', 'http://centershift.com/csCallCenter/csCallCenterService', 'CreateNewAccountResponse', 'csCallCenterWS.CreateNewAccountResponse_element'} ); response_x = response_map_x.get('response_x'); return response_x.CreateNewAccountResult; }

 

 

 

EXPECTED XML RESPONSE

 

ERROR

 

      <Error>
        <ErrorCode>100</ErrorCode>
        <Line>445</Line>
        <Message>Failed to log in User:  Either Username or Password is incorrect or User does not have permission</Message>
      </Error>

 

SUCCESS

 

      <Account>
        <FIRST_NAME>frank</FIRST_NAME>
        <LAST_NAME>sinatra</LAST_NAME>
        <EMAIL_ADDRESS>test@example.com</EMAIL_ADDESS>
        <PASSWORD>438500</PASSWORD>
        <CONTACT_ID>5662413</CONTACT_ID>
        <ACCOUNT_ID>3072405</ACCOUNT_ID>
      </Account>

 

 

HERE IS HOW THE RESPONSE IS DEFINED IN THE WSDL

 

      <s:element name="CreateNewAccountResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="CreateNewAccountResult">
              <s:complexType mixed="true">
                <s:sequence>
                  <s:any />
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>

Message Edited by savvyboarder on 02-02-2009 09:03 AM
Message Edited by savvyboarder on 02-02-2009 09:58 AM

Hi all-

 

I'm wondering if anybody knows a good place to start finding ways to access and execute an external web service using Apex.  Any help is appreciated!!

 

BW

I'm curious if anybody has had issues trying to login to the API using the sandbox account? I can connect to the Apex Explorer with my login and token, but no luck logging into the API. Any help is greatly appreciated.