How to pass username and password in SOAP wizard?

I am working with this WSDL link - it requires 3 inputs: Username, Password and po_number (I have tested it on SoapUI and it works fine) but UiPath is only able to see 2 inputs - Logon and po_number. When I try to create the Username and Password fields manually, UiPath says they already exist (I think the default system variables). Is there a way I can pass Username and Password in the ‘Logon’ field?

1 Like

I guess in case of a WSDL whatever input is required will be displayed in the table of the wizard.
Please choose Basic in the authentication option and enter the username/password there and try.

your logon value is a complex type defined like this:

> <Logon>
>         <Username>string</Username>
>         <Password>string</Password>
>       </Logon>

@nadim.warsi. Hi Nadim, I dont see a basic but I did try with ‘Simple’ but it doesnt work…

@bcorrea. Hi Bruno, yes, its a complex type. Is there a way I can enter the username and password using this?

Yes, create a variable of that type (AuthStruct) and then pass the value of Password and Username property…

I dont know what to enter for the property

just hit Control + K and choose a name, the variable will be created for you, then you may use invoke code with in/out parameter to initialize it and choose the username and password.

I made the variable (‘AuthVar’) but don’t see an option to how to input both username and password…

you can do like this:

1 Like

Thanks man! Which variable type did you use for AuthStruct? I am getting this error

Maybe we better dont use this activity and change to Http Request one, there you can send the full Body as XML String… i think there are problems with complex parameter types…

@bcorrea. OK, I will try that. thanks for your help though…I appreciat it :slight_smile:

1 Like

I don’t see an option in http request to send XML string…

Should use the Body in Options, configure type as app/xml.

@bcorrea. OK. I am confused…sorry. I got the WSDL link but cant find the XML to paste in body. basically, the SOAP request I wanted to use was for ‘GetPOdetail’ but I cant find the XML which corresponds to this…:frowning:

see the formats here:

thanks Bruno. I tried pasting this in the body but it throws error -

you cant pass it like that… you need to create a string from it and also replace the words String with your real values, also it starts with the line “<?xml versio…” and not the “POST /vendor”…