This time I will explain how to work with web services inside the Scriptcase, directly with PHP and using the sc_webservice () macro.

First of all we need to understand what web services are.

Web Services

We can define them as a technology that uses a set of protocols and standards that serve to exchange information between applications; regardless of the language or platform that was developed.

In web services we can have: information, calculations, business processes and data.

They are defined in one language, like PHP for example, and we need to consume in other languages or platforms like JavaScript, iOS or Android.

This is because there is a need to build an intercom, and this is exactly where web services are involved.

To improve understanding, look at the layout of the next image:

Among the most widely used protocols for web service management are:

SOAP and REST -> These are used by data exchange languages ​​->

XML and JSON and ultimately consumed by programming languages ​​like PHP or JS.

Simple Object Access Protocol (SOAP)

Simple Object Access Protocol: It is a standard protocol that defines how two objects in different processes can communicate through the exchange of XML data.


  • It is the protocol known as the best known or traditional, so it hits many old school developers, and that represents more reach;
  • It is a W3C standard;
  • XML based;

Some disadvantages we can mention:

  • Problem sending too much metadata, which is not as functional for mobile services as it uses a lot of bandwidth and generates slowness.
  • It is recommended that it be consumed on the same server or domain.

REST (Representational State Transfer) Protocol


  • Simpler alternative compared to SOAP;
  • Uses the HTTP protocol to communicate between systems;
  • Uses different languages ​​like (XML, JSON, plain text);
  • It consumes much less bandwidth;
  • Recommended for external or mobile services;
  • It has grown more recently because it is simpler and more flexible;
  • In this category, we can also mention libraries like cURL and functions like file_get_contents (), which allows us to work side by side with web services. Then I will explain each of them:


t is a library that allows you to make HTTP requests to transfer information with URL syntax. In the context of PHP, it allows you to build a script that literally behaves like a browser to make a request to another remote server.

file_get_contents ():

I passed a complete file to a string. This function is similar to file (), except that file_get_contents () returns the file to a string.

In Scriptcase, we have the sc_webservice () macro, which allows us to use web services in a more practical way.


sc_webservice (“Method”, “URL”, “Port”, “Send Method”, “Matrix Parameters”, “Matrix Settings”, “Timeout”, “Return”)

Example: Using the sc_webservice () Macro with cURL:

$ Answer = sc_webservice (“curl”} {paypal_type, 80, “post” $ parms array (CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false), 30)

Below, if you like, have a video this our Webinar about Web Service:

Scriptcase is the most efficient web development tool on the market. Build complete web systems integrated with Business Intelligence solutions in minutes!

Know the license that best suits your need -> License Options

Download and try our tool! Download Scriptcase

You might also like…

IT and Web Development Trend predictions 2020

Let’s take a look at some strong tendencies in the web development field for 2020. A new year ...

Retrospective of the year 2019

Retrospective of everything that happened on the Blog and our Youtube channel. 2019 was a very...

How the Scriptcase folders work

As a Scriptcase developer, it is convenient to know everything in detail about the environment. Th...

You might also like…

Get new posts, resources, offers and more each week.

We will use the information you provide to update you about our Newsletter and Special Offers. You can unsubscribe any time you want by clinck in a link in the footer of any email you receive from us, or by contacting us at Learn more about our Privacy Police.