Passing object variables through a SOAP Request

I’m trying to access a certain web service for a robot I’m building, but the call requires an object containing a user name and password as its properties. I’ve been told it’s possible, and I tried creating a custom variable type based on the required object type, but I can’t figure out how to set its properties.

How can I make this work using UiPath?

The image below includes the new SOAP Request screen in UiPath, the XML structure of the command viewed in SoapUI, and working code for Visual Studio (C#) that successfully retrieves the data.

@rpaTM,

If it is possible then you can create individual objects for username and password, then you can pass it from the UiPath.

Thanks for taking the time to reply.

The SOAP service I’m trying to connect to requires an specific object that contains two strings. It doesn’t work when just passing in two strings. Of course, it’s all XML based, so I would imagine that any object matching the same format would work, but I don’t know how to do that in UiPath.

@rpaTM, have you figured this out ?
I’ve the same problem …

Hi all, did anyone find an answer? Thank you.

I had this issue, so i used the http request instead of the SOAP request activity in studio.
Then you are able to define the body of the request.

If the two variables defined in UiPath studio you can just add them to the body of the request:

<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>
<soapenv:Header/>
	<soapenv:Body>
		<!--Optional:-->
		<username>" + variableInStudio + "</username>
		<!--Optional:-->
		<password>" + variableInStudio + "</password>
		</soapenv:Body>
		</soapenv:Envelope>

Hope this helps

If the password is of type secure string, use this:

New System.Net.NetworkCredential(string.Empty, yourPassword).Password

I’ve the same problem with a method of WebService that takes a complex object as Input like :

WebService : carManagement.wsdl
method : addCarModel( CarModel )
With CarModel an object :
CarModel

  • ID
  • Name
  • Constructor
  • Options
    – Option 1
    — Option Name
    — Option price
    […]

How can i call this WebService without building the complex XML payload by hand?

UIPath Studio manage to read the WSDL and i can select the method, it allow me to create a variable with “CarModel” as a type but I don’t manage to set the data into this object and if I close the project and re-open it I’ve an error saying “CarModel object not found”

Did you find a solution for this?
I am having the same problem…

Any updates here? I’m trying the same. I was able to cobble together an HTTP Request, but I would rather use the SOAP Request and bind objects as input parameters versus building the soap envelope with string concatenation. That seems wrong; but I have yet to see anyone getting the SOAP Request activity to work?

Hi,

I was trying to use the SOAP Request to connect to SAP. This is not working, so I have created a library and at least it is generating the service. The problem I have is how to pass the parameters that are expected. I am trying with the request parameter, but unfortunately it is not working. Did anyone manage to solve the problem?

Thanks

BR
Alejandro

Hi
If any one find the answer i am having the problem
when i try to pass the empty or value for the types: (Messaging.Data.Contracts.MessageAttachments ) it shows method not found error

Could you please help to find the solution

You could create an object custom in C# code.

For example:
DLL name: UserCredentialLibrary
using namespace UserCredencialLibrary{
public class UserCredentials{
public string UserName {set; get;}
public string Password {set; get;}
}

Then you download this package custom in UiPath.

Regards,
Gianfranco Drago