1

So I have created a simple webservice apex class that follows the second example for webservice on this link:

https://developer.salesforce.com/page/Apex_Web_Services_and_Callouts#Apex_Web_Services

global class MyWebService_DUMMY {
webservice static String makeContact(String contactLastName) {
    contactLastName = 'testing';
    return contactLastName;
    }
}

I then generated the class' WSDL and added it to SOAP-UI tool just so I could look on how to access it. I assume that I just need to supply the Username and Password in the request but looking at the WSDL, I can't find any tag for Username and Password.

How do you supply the Username and Password in order to access the Apex webservice above?

I did found a tag for 'sessionId' in the Header part of the WSDL but I also don't know what to do on this.

3

You also need to generate one additional Enterprise or Partner WSDL to make login request. There you will supply your credentials and will get security token in response. enter image description here

Next you will use that response and will make request.

  • Oh I see. so does this mean that the third party must first connect via Partner WSDL before connecting to the Apex Webservice class? Ok will see check this one out in SOAP-UI. – Jerard Dela Victoria Apr 2 '18 at 7:09
  • yes they need to get the token first and they can use our custom we service. – Tushar Sharma Apr 2 '18 at 7:14
  • 1
    Thank you so much for the answer. I just tested in SOAP-UI and I was definitely able to access the dummy webservice class. What I did was first requested the sessionID via Partner WSDL username and password Request then once I got the sessionID, I then used this on the WSDL generated for the APEX Class and it worked! Again thank you so much! – Jerard Dela Victoria Apr 2 '18 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.