Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
To develop interface from VFP to WS but not know how
Message
De
08/10/2020 19:36:00
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Titre:
To develop interface from VFP to WS but not know how
Divers
Thread ID:
01676523
Message ID:
01676523
Vues:
38
Good afternoon to all. I have to develop an interface (prefently COM dll) in VFP to a partner's WS (Web Service). This interface has to send data generated by our applications (customs duties) to a WS in Json format and this WS has to respond if it's okay with a small json string.

They gave me info and instructions on which I have to base my development.

Below is the info:
Description
Insert customs - This endpoint creates a new manifest.

URL
TEST https://api-test.mypartner.com/

Endpoint
POST /wcf-services/service-customs.svc/customs/insert_customs_data
The json string is like this (sensitive data was changed):
{
  "user_info": {
    "user_code": 1,
    "user_key": "ok",
    "app_key": "ok"
  },
  "customs_header": {
    "pch_reference": "Document Reference",
    "country_iso_code": "CL",
    "pch_charged_datetime": "/Date(1579669200000-0500)/",
    "pch_items": [
      {
        "trck_nmr_fol": 12345678,
        "consignee_id": "1234567890",
        "is_additional": false,
        "pcc_charges": [
          {
            "pcc_charge_value": 18.80,
            "pcc_charge_code": 1,
            "pcc_comment": "Comment for this charge"
          }
        ]
      }
    ]
  }
}
I guess I have advanced a little with this:
loHTTP= CREATEOBJECT("MSXML2.ServerXMLHTTP.6.0")
loHTTP.Open("POST", "https://api-test.mypartner.com/", .F.)
loHTTP.Setrequestheader("Content-type", "application/x-www-form-urlencoded")
loHTTP.Send("json=" + m.lcJsonString)
It returns me an html string which says:

Server error
405 - HTTP verb used to access this page is not allowed.
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.


I know that something is wrong but I don't know what. Besides that, I don't know where/how to use the Endpoint address
(/wcf-services/service-customs.svc/customs/insert_customs_data).

Any help would be appreciated.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform