Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

RFZO web servis i cbuilder 2010

[es] :: C/C++ programiranje :: RFZO web servis i cbuilder 2010

[ Pregleda: 2388 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

brenas
srem

Član broj: 50753
Poruke: 110
*.mbb.telenor.rs.



Profil

icon RFZO web servis i cbuilder 201024.04.2014. u 21:22 - pre 75 meseci
da li je neko iz Embarcadera C++ 2010 uspeo da konzumira web servis fonda za zdravstvo?
wsdl je na adresi: https://webapp2.rzzo.rs/rzzo/RzzoService?wsdl na osnovu kod se bez problema generiše interfejs.

moj kod je:

THTTPRIO *httpRZZO;
_di_RzzoService soapInterfejs;

httpRZZO=new THTTPRIO(NULL);
httpRZZO->WSDLLocation="https://webapp2.rzzo.rs:443/rzzo/RzzoService?wsdl";
httpRZZO->Port="RzzoServicePort";
httpRZZO->Service="RzzoServiceService";
httpRZZO->HTTPWebNode->UserName="xxxxxxx";
httpRZZO->HTTPWebNode->Password="xxxxxx";
httpRZZO->QueryInterface(soapInterfejs);
if(soapInterfejs)
{
Memo1->Lines->Text=soapInterfejs->GetInsuranceDataL("10028566023");
}
soapInterfejs->Release();

Ovaj web servis zahteva poziv sa unapred definisanih IP adresa (poziva se sa računara sa kog se taj web servis poziva uredno preko aplikacije rađene u C#).
Međutim ja dobijam poruku "Seurity requirement not met - No securitu header in message".

Da li neko ima ideju.....
 
Odgovor na temu

brenas
srem

Član broj: 50753
Poruke: 110
*.mbb.telenor.rs.



Profil

icon Re: RFZO web servis i cbuilder 201026.04.2014. u 07:42 - pre 75 meseci
Dosta pregleda ali niko ne odgovara.
Evo da nekom olakšam, uradio sam sličnu stvar ali sa Indy komponentama.
kod:

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
#include <memory>
#include <SysUtils.hpp>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "IdBaseComponent"
#pragma link "IdComponent"
#pragma link "IdHTTP"
#pragma link "IdTCPClient"
#pragma link "IdTCPConnection"
#pragma link "IdIOHandler"
#pragma link "IdIOHandlerSocket"
#pragma link "IdIOHandlerStack"
#pragma link "IdSSL"
#pragma link "IdSSLOpenSSL"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
UnicodeString xml="",odgovor="";
TStringStream *parametriU;
TIdSSLIOHandlerSocketOpenSSL *ss;
TIdHTTP *rzzo;
try
{
xml=L"<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:u=\"http://docs.oasis-open.org/wss...wss-wssecurity-utility-1.0.xsd\">";
xml=xml+L"<s:Header>";
xml=xml+L"<o:Security s:mustUnderstand=\"1\" xmlns:o=\"http://docs.oasis-open.org/wss...-wss-wssecurity-secext-1.0.xsd\">";
xml=xml+L"<o:UsernameToken u:Id=\"uuid-cdf8690a-e56a-4efa-923c-760d22b6748d-7\">";
xml=xml+L"<o:Username>**korisnik**</o:Username>";
xml=xml+L"<o:Password>**lozinka**</o:Password>";
xml=xml+L"</o:UsernameToken>";
xml=xml+L"</o:Security>";
xml=xml+L"</s:Header>";
xml=xml+L"<s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">";
xml=xml+L"<GetInsuranceDataF xmlns=\"http://service.rzzo.rs/\">";
xml=xml+L"<req xmlns=\"\">";
xml=xml+L"<lbo/>";
xml=xml+L"<zk>10028566023</zk>";
xml=xml+L"</req>";
xml=xml+L"</GetInsuranceDataF>";
xml=xml+L"</s:Body></s:Envelope>";

parametriU=new TStringStream(xml,TEncoding::UTF8,true);

ss=new TIdSSLIOHandlerSocketOpenSSL(NULL);
ss->SSLOptions->Method=sslvTLSv1;
ss->SSLOptions->Mode=sslmClient;
rzzo=new TIdHTTP(NULL);
rzzo->IOHandler=ss;
rzzo->AllowCookies=true;
rzzo->HTTPOptions=(TIdHTTPOptions) hoInProcessAuth,hoForceEncodeParams,hoKeepOrigProtocol;
rzzo->ConnectTimeout = 15000;
rzzo->ReadTimeout = 60000;
rzzo->HandleRedirects = true;
rzzo->Request->ContentType = "text/xml";
rzzo->Request->CharSet = "utf-8";
odgovor = rzzo->Post("https://webapp2.rzzo.rs:443/rzzo/RzzoService",parametriU);
//Memo1->Lines->Text=odgovor;
delete parametriU;
}
catch(Exception &e)
{
delete parametriU;
ShowMessage(e.Message);

}

}
//---------------------------------------------------------------------------
 
Odgovor na temu

[es] :: C/C++ programiranje :: RFZO web servis i cbuilder 2010

[ Pregleda: 2388 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.