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


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.

1 Answer 1


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. Apr 2, 2018 at 7:09
  • yes they need to get the token first and they can use our custom we service. Apr 2, 2018 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! Apr 2, 2018 at 9:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .