> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/readme/files/dir_30aba3d9bf6279a25d84abe4015711f7/dir_f7a957c8f5c8e80b5a8d4b37f193d419/dir_e8da2933844aa72825eccee783cf08f3/_web_service_wrappers_8c.md).

# WebServiceWrappers.c

[Macros](#define-members) | [Functions](#func-members)

`#include "../inc/VHQTypes.h"` `#include "VHQConfig.h"` `#include "VHQIoInternals.h"` `#include "VHQDebug.h"` `#include "../inc/VHQIo.h"` `#include <libxml/uri.h>` `#include "VHQPosIPC.h"` `#include "VHQFileNames.h"` `#include "VHQUtils.h"` `#include <stdio.h>`

Include dependency graph for WebServiceWrappers.c:

![](/files/i0XwtWMqmUl9IYPataEJ)

|         |                                                               |
| ------- | ------------------------------------------------------------- |
| Macros  |                                                               |
| #define | [\_MAIN\_LOOP\_EXTERNS\_](#a0c0b5276fb82904fa5f9885c7f8e58ba) |
| #define | [LF\_ERROR](#a4433ee04f3fb4f8a246fee30fc8a4829)   1           |
| #define | [LF\_INFO](#ae47d0ee7f867d23a564d391850602e70)   2            |
| #define | [LF\_DETAIL](#a2f8640511499099f8c1b105d3fb3587a)   3          |

|                |                                                                                                                                                                                  |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Functions      |                                                                                                                                                                                  |
| bool           | [isbase64](#a5887f31e1cbe65c00807a2605075acdd) (char c)                                                                                                                          |
| char           | [value](#a6e248376c0290338633d8137822eb209) (char c)                                                                                                                             |
| int            | [UnBase64](#a43a36d429fa3d939ffc2ae91532541a6) (unsigned char \*dest, const unsigned char \*src, int srclen)                                                                     |
| bool           | [TryMessageType](#a0e5085ec3a406927825307c114b37b05) (const char \*pszMsgType, char \*pszPayload, char \*\*ppszStart, char \*\*ppszEnd)                                          |
| vhq\_result\_t | [PostPayload](#a02b30940054f1980e6eb755934e10952) (const char \*pszPayload, char \*\*pszReturnPayload)                                                                           |
| vhq\_result\_t | [PostUpload](#accfb9c141193e73bee596406d96fbd31) (const char \*pszURL, const char \*pszWebMethod, const char \*\*pszUpload, char \*\*pszReturnPayload, const char \*pszFileName) |

### DetailedDescription <a href="#detailed-description" id="detailed-description"></a>

Implements the wrappers for web services exported by VHQ server

### MacroDefinition Documentation <a href="#macro-definition-documentation" id="macro-definition-documentation"></a>

### \_MAIN\_LOOP\_EXTERNS\_ <a href="#a0c0b5276fb82904fa5f9885c7f8e58ba" id="a0c0b5276fb82904fa5f9885c7f8e58ba"></a>

\#define \\\_MAIN\_LOOP\_EXTERNS\\\_

### LF\_DETAIL <a href="#a2f8640511499099f8c1b105d3fb3587a" id="a2f8640511499099f8c1b105d3fb3587a"></a>

\#define LF\_DETAIL   3

### LF\_ERROR <a href="#a4433ee04f3fb4f8a246fee30fc8a4829" id="a4433ee04f3fb4f8a246fee30fc8a4829"></a>

\#define LF\_ERROR   1

### LF\_INFO <a href="#ae47d0ee7f867d23a564d391850602e70" id="ae47d0ee7f867d23a564d391850602e70"></a>

\#define LF\_INFO   2

### FunctionDocumentation <a href="#function-documentation" id="function-documentation"></a>

### isbase64() <a href="#a5887f31e1cbe65c00807a2605075acdd" id="a5887f31e1cbe65c00807a2605075acdd"></a>

bool isbase64

### PostPayload() <a href="#a02b30940054f1980e6eb755934e10952" id="a02b30940054f1980e6eb755934e10952"></a>

vhq\_result\_t PostPayload

This function passes the device message and fetches response from server in pszReturnPayload buffer.

**Parameters**

\[in] **pszPayload** = device message buffer to be send. \[out] **pszReturnPayload** = points to buffer in which server message is to be saved.

#### Returns

TRUE, if success; FALSE, otherwise

### PostUpload() <a href="#accfb9c141193e73bee596406d96fbd31" id="accfb9c141193e73bee596406d96fbd31"></a>

vhq\_result\_t PostUpload

This function does the upload to the server.

**Parameters**

\[in] **pszURL** = server address \[in] **pszWebMethod** = transfer method \[in] **pszUpload** = header information for transmission \[in] **pszReturnPayload** = server response to be stored \[in] **pszFileName** = local filename

#### Returns

TRUE, if success; FALSE, otherwise

### TryMessageType() <a href="#a0e5085ec3a406927825307c114b37b05" id="a0e5085ec3a406927825307c114b37b05"></a>

bool TryMessageType

This function checks the server response message type.

**Parameters**

\[in] **pszMsgType** = incoming message tag type to compare. \[in] **pszPayload** = response from server \[out] **ppszStart** = pointer to starting of server response \[out] **ppszEnd** = pounter to end of response

#### Returns

TRUE, if SUCCESS; FALSE, otherwise

### UnBase64() <a href="#a43a36d429fa3d939ffc2ae91532541a6" id="a43a36d429fa3d939ffc2ae91532541a6"></a>

int UnBase64

### value() <a href="#a6e248376c0290338633d8137822eb209" id="a6e248376c0290338633d8137822eb209"></a>

char value

inline

#### Examples

[demo-sysinfo.cpp](/adk-5.0-programmers-guide/readme/examples/demo-sysinfo_8cpp-example.md#a14), [mac\_demo1.cpp](/adk-5.0-programmers-guide/readme/examples/mac_demo1_8cpp-example.md#a0), and [mac\_demo2.cpp](/adk-5.0-programmers-guide/readme/examples/mac_demo2_8cpp-example.md#a0).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/readme/files/dir_30aba3d9bf6279a25d84abe4015711f7/dir_f7a957c8f5c8e80b5a8d4b37f193d419/dir_e8da2933844aa72825eccee783cf08f3/_web_service_wrappers_8c.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
