Hi Community,

 

I'm having troubles generating a request with the following XML body, using the "Call Web Service" integration tool.

<soapenv:Envelope xmlns:soap="" xmlns:cam="" xmlns:soapenv="">
	<soapenv:Header />
	<soapenv:Body>
		<cam:startProcessCampanhasaaaaa>
			<soap:request>
				<soap:agencia>1</soap:agencia>
				<soap:argumentarioVenda>A</soap:argumentarioVenda>
				<soap:nomeCampanha>A</soap:nomeCampanha>
				<soap:nomeEntidade>A</soap:nomeEntidade>
				<soap:notasAdicionais>A</soap:notasAdicionais>
				<soap:numeroEntidade>A</soap:numeroEntidade>
				<soap:requestId>A</soap:requestId>
				<soap:validadeTarefa>1</soap:validadeTarefa>
				<soap:gestorEntidade>A</soap:gestorEntidade>
			</soap:request>
		</cam:startProcessCampanhasaaaaa>
	</soapenv:Body>
</soapenv:Envelope>

Basically, when I tried to add the necessary parameters for the request, I've noticed that I can't add an object parameter without defining it as an array.

This setting is blocking me from following the structure of the request above. Because the "request" parameter is not an array. I also tried to import the wsdl, and it didn't work either.

 

Is there a way to bypass this? Should I create a script task instead?

 

Thank you in advance.

 

Best Regards,

Pedro Pinheiro

Like 1

Like

3 comments

Hello,

 

You can create this service manually.

Because this is an OOTB behavior with the value "is array".

Hi Kalymbet Anastasia,

 

Sorry, but I didn't understand your answer. The property "Is array" is true by default.

 

Do I need to create the soap request using a script task? 

 

Best Regards,

Pedro Pinheiro

Pedro Pinheiro,

 

Yes, you're right. When the request parameter is of type object the collection is considered a typed array and the checkbox is checked by default and not editable.



In this case, using a script task for the SOAP service would solve the case.



BR,

Bhoobalan Palanivelu.

Show all comments

I created a custom web service to accept xml from one of our lead aggregators. However, it is not deserializing the request body, and all I get in response is a Null Object Reference error. Am I missing something?

 

My custom web service:

namespace Terrasoft.Configuration.UsrMyLeadImportNamespace
{
    using System.Collections.Generic;
    using System.IO;
    using System.Xml;
    using System;
    using System.Runtime.Serialization;
    using System.ServiceModel;
    using System.ServiceModel.Activation;
    using System.ServiceModel.Web;
    using System.Xml.Serialization;
    using Core;
    using Core.DB;
    using Terrasoft.Web.Common;
 
    [XmlSerializerFormat]
    [ServiceContract]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class UsrMyLeadImport: BaseService
    {
		private SystemUserConnection _systemUserConnection;
		private SystemUserConnection SystemUserConnection
		{
			get
			{
				return _systemUserConnection ?? (_systemUserConnection = (SystemUserConnection)AppConnection.SystemUserConnection);
			}
		}
		// Service operation.
		[OperationContract]
		[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "new")]
		public MyResponse New(LeadInformation leadInformation)
		{
			var response = new MyResponse();
			response.ResponseStatus = "Tracking Number is => " + leadInformation.TrackingNumber;
			return response;
		}
	}
 
 
	[XmlRoot(ElementName = "LeadInformation")]
	public class LeadInformation
	{
		[XmlElement(ElementName = "TrackingNumber")]
		public int TrackingNumber { get; set; }
 
	}
 
	[DataContract(Namespace = "")]
	[Serializable]
	public class MyResponse
	{
		[DataMember]
		public string ResponseStatus { get; set; }
	}
}

Request Body:

<LeadInformation>
    <TrackingNumber>12345</TrackingNumber>
</LeadInformation>

 

Like 0

Like

1 comments
Best reply

I've performed the same setup (additionally to the code you've shared, registered the service as anonymous) and sent the following request in Postman:

As you can see the result is correct so the issue is somewhere in the request you send or in the service settings. You need to double-check them.

I've performed the same setup (additionally to the code you've shared, registered the service as anonymous) and sent the following request in Postman:

As you can see the result is correct so the issue is somewhere in the request you send or in the service settings. You need to double-check them.

Show all comments

Hi,

I checked and tested an example using this documentation (https://academy.bpmonline.com/documents/administration/7-13/web-service-integration). Web service example (http://fixer.io) is JSON formatted and there is no issue to configure in Process library.

I have another web service link which required output is in XML format. I'm not sure if its configurable in Process library or it will be only possible through code customization.

 

Below is screenshot of specific area of output from that web service link

Any help will be highly appreciable. 

 

Regards

Like 0

Like

3 comments

Please deploy the application locally and catch the request and the response with fiddler.

https://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigureDotNEā€¦

This way you'll get more information. 

Hi Eugene,

Thank you for reply.

It means there will be code customization is required?

 

Regards

The code customization is not required. But in order to create an integration with a web service the skill in working with web services is required. 

Show all comments