Web Services - 2nd Level Variables

I have used the “Library” capability with a WSDL to create the end points.
How do you set values for ComplexTypes that are 2nd level?

The facility correctly creates first level complexTypes, but does not appear to provide a mechanism to handle the situation where the ComplexTypes do not resolve to string type variables.
In the WSDL : https://uat.e-customs.descartes.com/WebServices/ECustomsExchange.asmx?WSDL

The confirmCredentials end point, correctly that a variable “MessageSecurity” but it does not see that in turn needs “tns:WebServicesSecurity” which actually contains the individual variables.

<s:element name=“ConfirmCredentials”>
<s:element minOccurs=“0” maxOccurs=“1” name=“MessageSecurity” type=“tns:WebServicesSecurity”/>

<s:complexType name=“WebServicesSecurity”>
<s:element minOccurs=“0” maxOccurs=“1” name=“CompanyName” type=“s:string”/>
<s:element minOccurs=“0” maxOccurs=“1” name=“UserId” type=“s:string”/>
<s:element minOccurs=“0” maxOccurs=“1” name=“CompanyPassword” type=“s:string”/>
<s:element minOccurs=“0” maxOccurs=“1” name=“UserPassword” type=“s:string”/>

Hello @DavidMartin!

It seems that you have trouble getting an answer to your question in the first 24 hours.
Let us give you a few hints and helpful links.

First, make sure you browsed through our Forum FAQ Beginner’s Guide. It will teach you what should be included in your topic.

You can check out some of our resources directly, see below:

  1. Always search first. It is the best way to quickly find your answer. Check out the image icon for that.
    Clicking the options button will let you set more specific topic search filters, i.e. only the ones with a solution.

  2. Topic that contains most common solutions with example project files can be found here.

  3. Read our official documentation where you can find a lot of information and instructions about each of our products:

  4. Watch the videos on our official YouTube channel for more visual tutorials.

  5. Meet us and our users on our Community Slack and ask your question there.

Hopefully this will let you easily find the solution/information you need. Once you have it, we would be happy if you could share your findings here and mark it as a solution. This will help other users find it in the future.

Thank you for helping us build our UiPath Community!

Cheers from your friendly

Hi @DavidMartin

Something like that I think:

Thanks for the response.
I can appreciate some of what you are showing in the screenshot, but I do not know how you have managed to set the “Variable Type” to the values shown. When I try to enter the values displayed it gives an error.
Please could you explain?
I am also not seeing a “SOAP Request” icon in the activities displayed. Where you example says “ConfirmCredentials” what action is that associated to?

1 Like

Oh, I though you are already using the library functionality :slight_smile:

Could you let me know what is your version of Studio? Any newer version will have the option to create a Library type project.

In such project, you will have an option to create a Library service from your WDSL url. My screenshot is what the end result looks like - it creates Activities and namespaces for the endpoints available in the service definition and then allows you to pass request and response variables which can be adjusted as above.

You can search our documentation for “library service” for more information.

Thanks. I had also tried the Library approach but without success.
I will have another look at using Library, perhaps I have missed something.

1 Like

Currently using Studio 20.10.0 - enterprise licence.

1 Like

It should be goto method to consume soap services. Please use the screenshot above as reference. Feel free to ask if something will not be clear or not working as expected.

Thanks, that is starting to work. I can see the request is being constructed.
I am not yet getting a valid response but that might something missing in my request.

No problem.

After it starts working, make sure to read on how the library type project works. It basically makes an activity for Studio out of each XAML file that is in it. You would then add some In and Out arguments to these XAML files, and all of that will turn into an activity with input and output properties when you publish such project and then install it from the Package Manager in your actual project.

This might sound like a lot, but in short - library project basically makes reusable activity package for your service’s endpoints.

Yes, I can see the logic for using a Library.
The challenge has now become a message about a response type mismatch “IsContentTypeSupported”. I think that means I need to set something in “Headers” although when using SOAPUI, the call works perfectly.
I am trying to find information on Headers so far all references are to the HTTP Request activity, not the Web Services activity.

Could you try as per below screenshot?
Changes vs previous screenshot:

  • reshuffled activities (previously the call to the service was before the actual assignment of the values :roll_eyes:)
  • initialized the request variable before assigning values to it

This way returned the expected:

Yes, I had already worked out the variables needed to be set before the call.
The change I needed to make was to set the “content-type” value in the dictionary to “text/xml” which is slightly strange as SOAPUI sets it to “application/soap+xml”.

The main thing is that it now works. Thanks for your help.

Hopefully the post will help others who want to make use of SOAP calls.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.