49
Views
11
Comments
Consume soap web service by wsdl file

Hello guys

I'm trying to consume web service by wsdl file, I tried by url, but I have some error, because an attribute data type structure is not set.

Error when consume web service by endpoint

 

Now I'm trying to consume the service by wsdl file

the definitions for this type on the xsd file are

 

I'm trying to change group by single element like that 


but when I consume the wsdl file and publish the module I have compilation error


Internal Error


Compilation Error.

CustomClients\IUtilityFacadeInterfaceService_IUtilityFacadeInter\Structures.STAddressTypeStructure.cs(766,18): error CS1502: The best overloaded method match for 'ssNewUPUtility_eSign_IS.CcIUtilityFacadeInterfaceService_IUtilityFacadeInter.SOAPOpenEnum.FromProxyStructure(ssNewUPUtility_eSign_IS.ssProxy.OpenEnum)' has some invalid arguments

record.ssvalue = SOAPOpenEnum.FromProxyStructure((string) proxyObj.Value);

CustomClients\IUtilityFacadeInterfaceService_IUtilityFacadeInter\Structures.STAddressTypeStructure.cs(766,51): error CS1503: Argument 1: cannot convert from 'string' to 'ssNewUPUtility_eSign_IS.ssProxy.OpenEnum'

record.ssvalue = SOAPOpenEnum.FromProxyStructure((string) proxyObj.Value);

CustomClients\IUtilityFacadeInterfaceService_IUtilityFacadeInter\Structures.STAddressTypeStructure.cs(773,16): error CS0029: Cannot implicitly convert type 'ssNewUPUtility_eSign_IS.ssProxy.OpenEnum' to 'string'

record.Value = SOAPOpenEnum.ToProxyStructure(obj.ssvalue);

CustomClients\IUtilityFacadeInterfaceService_IUtilityFacadeInter\Structures.STAirBagTypeStructure.cs(766,18): error CS1502: The best overloaded method match for 'ssNewUPUtility_eSign_IS.CcIUtilityFacadeInterfaceService_IUtilityFacadeInter.SOAPOpenEnum.FromProxyStructure(ssNewUPUtility_eSign_IS.ssProxy.OpenEnum)' has some invalid arguments

record.ssvalue = SOAPOpenEnum.FromProxyStructure((string) proxyObj.Value);

CustomClients\IUtilityFacadeInterfaceService_IUtilityFacadeInter\Structures.STAirBagTypeStructure.cs(766,51): error CS1503: Argument 1: cannot convert from 'string' to 'ssNewUPUtility_eSign_IS.ssProxy.OpenEnum'

record.ssvalue = SOAPOpenEnum.FromProxyStructure((string) proxyObj.Value);

CustomClients\IUtilityFacadeInterfaceService_IUtilityFacadeInter\Structures.STAirBagTypeStructure.cs(773,16): error CS0029: Cannot implicitly convert type 'ssNewUPUtility_eSign_IS.ssProxy.OpenEnum' to 'string'

record.Value = SOAPOpenEnum.ToProxyStructure(obj.ssvalue);

.

.

.

exist any workaround for do this?

Thanks in advanced

2021-04-12 11-47-04
Bart Nooijens

Hi @Artemio Sampayo Olivares,

What happens when you use SoapUI or Postman to consume the webservice? Does this work? 

Why is the structure of address1 different from that of address2?

Best regards,

Bart

2023-04-28 15-39-13
Artemio Sampayo Olivares

Hello @Bart Nooijens 

Thank you for you support

Yes when I use SoapUi I can get the response without issue

the problem is whit addr1 is defined as group in this case as EXAMPLE_CHOICE and addr2 is defined as string

The definition for the request (Addr1)was defined by other team

2021-10-09 07-57-44
Stefan Weber
 
MVP

SOAP is really pain in the ... in OutSystems. I never had a wsdl so far where i was able to simply import it. You may check the Unsupported cases and potential workarounds in the documentation https://success.outsystems.com/documentation/11/extensibility_and_integration/soap/consuming_soap_web_services/unsupported_soap_use_cases/ if that helps.

From my personal perspective. For simple SOAP based endpoints it is sometimes easier to consume the endpoint as a REST endpoint. You would then need to construct the XML request on your own and send in the request body along with correct content-type header.

For more complex integration you may consider creating a custom extension and create c# code from the wsdl using dotnet svcutil.


2023-04-28 15-39-13
Artemio Sampayo Olivares

hello @Stefan Weber 


Thank you for you support

I am trying to create an extension only with the method where I have the issue, but unfortunately in C# I can't get this method, I don't know what the problem is.

I don't know if problem with the web service methos definition

2021-10-09 07-57-44
Stefan Weber
 
MVP

If you can provide some more details on the wsdl and how you tried to create a c# method i may can help you.

2023-04-28 15-39-13
Artemio Sampayo Olivares

Hello Stefan 


How Can I do that?

"You would then need to construct the XML request on your own and send in the request body along with correct content-type header. "

2021-10-09 07-57-44
Stefan Weber
 
MVP

Hi,

  • Create a rest consume that targets a soap method.
  • Create an input parameter e.g. request and set its data type to Text
  • Create a response parameter e.g. response and set ist data type to Text.
  • At the endpoints properties add a header "Content-Type" and set it to "application/xml".

Then add a wrapper server action. In that wrapper action you first build up a text variable with the request xml. You can do it by using string concatenation to add dynamic values to the request xml. 

Something like this

Then call the REST consume with the request xml.

When retrieving use the actions from the Xml extension to retrieve all the values you need from the response. But as said. This only makes sense for simple calls. If it gets complicated e.g. because the response is quite complex to parse then you would be better off to create a custom code extension.

Best

Stefan

2021-01-28 10-02-59
Muhammad Mahmudul Hasan

@Artemio Sampayo Olivares 

Please add type="xsd:string" in your element then try. In some cases you may have to replace ref="Addr1" with  name="Addr1".


We had similar scenarios,, adding only  type="xsd:string" worked for us. 

2023-04-28 15-39-13
Artemio Sampayo Olivares

Hello 

Thank you for you support 


I changed 

<xsd:element ref="Addr1" minOccurs="0" maxOccurs="1"/>


<xsd:element name="Addr1" type="xsd:string"/>

but still the Compilation Error. 

2021-01-28 10-02-59
Muhammad Mahmudul Hasan

Hi, 

Was you able to resolve? 

Can try with below


<xsd:element name ="Addr1" type="xsd:string"  minOccurs="0" maxOccurs="1"/> 

2022-12-28 12-37-38
Luis Dinis

Hi Artemio,

Can you please share the original wsdl so I can try to understand by my side?

Thanks

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.