• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

Webservice content property

Status
Not open for further replies.

[email protected]

Customer
Joined
Dec 11, 2015
Messages
16
Reaction score
0
Hi! Can anyone tell me what I have to fill in in the 'Content' property on a Webservice Post control ? In v14 this property wasn't there, now it is and it is required.

Greets, Mark.
 
The Content property is the information that you will send. It depends on what you need to do. It could be the JSON data in a POST request for example....
 
I was already a bit afraid that this was going to be the answer. But there is also a property 'WebserviceName' and that represents the webservice method to be called. So there is no need (imo) to spell out the exact post data. Perhaps in a HttpWebRequest, but not in a specific Webservice Post control like 3cx is offering. And until this version this whole property didn't exist so 3cx has enough info without this property...?! I don't get it ;)
 
Here you have the documentation of the Web Service POST component:
https://www.3cx.com/docs/manual/cfd-components/#h.cmx1a5ssdgps

In the old VAD for v14, the Content was built from the form data grid that this component had in that version. But that's not enough for modern web services, which don't use form data anymore, and now use JSON or XML. Then, we added the Content property, so you have freedom to build the data to send as you need.

You need to know the interface of the web service you're dealing with. Then, you should be able to define an expression to create the Content to send. The properties of the component have changed, yes, but this is very basic information that you need to know in order to make it work.
 
Hi Ernesto, sure I have red the documentation. What I don't understand is that there is still a 'header' collection available. But there is also an option (optional?) to exactly setup the content to be sent. But I don't need that, the 'headers' worked fine. So can you try to explain why headers are still available? It seems we now have 'headers' and 'content'. But they should both result into content.... so…?
 
Headers are a totally different thing. Those are the headers to send in the HTTP request. That's totally different than the Content...
 
Hmm then I'm misled by the migration, because the previous named 'Properties' are migrated by 3cx to 'Headers' while (according to your response) it's something totally different.

If you are correct that Headers are now HttpHeaders then I can't use those anymore. But in that case, where is the help which explains how to insert stuff like variables into the 'Content' property? To be honest, this is not an improvent in functionality or useability...
 
Sorry, to add to this; why is there still a 'WebserviceName' while I need to define the whole soap body myself? That would already include the webserviceName…?
 
In v14 you configured properties, and those properties were mapped to url-encoded form data. There was no way to configure headers. Now you have more options.

You can also use the Web Service REST component, or the HTTP Request component to create the request controlling all the details.

The thing is, first you need to understand the interface of your web service, and then you configure the component to target it.
 
Ernesto, sorry to bother you again. I have also created a ticket at 3cx, but the question is which route works faster :)

I can prove that properties in v14 are auto-converted to headers in the current version. But let's leave that issue. Unfort you don't give an answer to my question how to use variables in Content and why there is still also a WebserviceName property? I cant use REST, I just want to use Webservice Soap...

BTW I know the interface of my web service, we have created it ourselves;;;
 
The Content is just a string. If you want to send the text Hello you can use the expression:
"Hello"

If you need to concatenate a variable like the caller number you use:
CONCATENATE("Hello",session.ani)

This is not something specific for the Content property, every string expression works like that. If you play a bit with the CFD, read the examples and tutorials we provide, you will quickly understand how everything works.
 
Status
Not open for further replies.

Getting Started - Admin

Latest Posts

Forum statistics

Threads
141,616
Messages
748,822
Members
144,726
Latest member
NGPMH
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.