Página 1 de 1

tinternet:postrequest

Publicado: Mar Oct 07, 2008 8:17 pm
por Pedro Sousa e Faro
Hi
Can anyone could send a small example how to call a webservices with method
Post
hData := :PostRequest(
"http://192.168.1.6/SIGEHPService.asmx/S ... ent",<?xml version="1.0"
encoding="ISO-8859-1"?><PATIENT_SEARCH>
<INTERNAL_NUMBER>680905F6</INTERNAL_NUMBER></PATIENT_SEARCH > ) )
I supose the sintax is 1º parameter = Url and the second is xth XML right
?
best regards
Pedro Faro

tinternet:postrequest

Publicado: Mié Oct 08, 2008 3:41 pm
por notengo
Pedro,
> I supose the sintax is 1º parameter = Url and the second is xth XML
> right ?
Yes, although the second parameter can be any kind of data. Just send it in
the format expected by the url.
IF you need to know how things gone:
LOCAL hRequest := oInet:PostRequest( ... )
LOCAL cBuffer := Space( 1024 )
LOCAL cData := ""
IF !Empty( hRequest )
WHILE oInet:ReadFile( hRequest, @cBuffer, 1024 )
cData += cBuffer
cBuffer := Space( 1024 )
END
oInet:CloseRequest( hRequest )
ENDIF
I wrote this sample from the top of my head but it should work that way.
Regards,
José Lalí­n

tinternet:postrequest

Publicado: Jue Oct 09, 2008 5:30 pm
por Pedro Sousa e Faro
Hi Jose
Tanx for you response
The problem is that i need to send a "SOAP" (envelope)message and i think
XAILER can't handle this
the message is like:
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns3:denyP1 xmlns:ns3="http://ws.p1.alsc">
<ns3:originInstitutionId>863</ns3:originInstitutionId>
<ns3:p1Code>123792</ns3:p1Code>
<ns3:sendFacility>DEFAULT</ns3:sendFacility>
<ns3:receiveFacility>DEFAULT</ns3:receiveFacility>
<ns3:sendApplication>SHILEIRIA</ns3:sendApplication>
<ns3:receiveApplication>ALERTP1</ns3:receiveApplication>
<ns3:messageXml><P1Row
value="123792" ><P1_CODE>123792</P1_CODE&gt ;<P1_INSTITUTION>863</P1_INSTITUTION&am p;gt;<P1_REFERENCE_ES>37</P1_REFERENCE_ ES><PATIENT_CODE>187571</PATIENT _CODE><SPECIALITY_CODE>6431</SPE CIALITY_CODE><HEALTH_CARE_UNIT_CODE>113 0900</HEALTH_CARE_UNIT_CODE><PROFESSITI ONAL_ORDER_NUMBER>1607</PROFESSITIONAL_ORDER_N UMBER><PROFESSITIONAL_NAME>IPOP,&lt ;/PROFESSITIONAL_NAME><SCHEDULE_DATE>&a mp;lt;YEAR>2009</YEAR><MONTH&amp ;gt;3</MONTH><DAY>16</DAY ><HOUR>9</HOUR><MI NUTE>10</MINUTE><SECOND>0 </SECOND></SCHEDULE_DATE>&lt ;REFUSAL_CODE>5</REFUSAL_CODE></ P1Row> </ns3:messageXml>
</ns3:denyP1>
</soapenv:Body>
</soapenv:Envelope>
How can i do that ?
Best regards
Pedro Faro
"José Lalí­n" <notengo@correo.com> escreveu na mensagem
news:48ecb8fb$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>
> Pedro,
>
>> I supose the sintax is 1º parameter = Url and the second is xth XML
>> right ?
>
> Yes, although the second parameter can be any kind of data. Just send it
> in the format expected by the url.
>
> IF you need to know how things gone:
>
> LOCAL hRequest := oInet:PostRequest( ... )
> LOCAL cBuffer := Space( 1024 )
> LOCAL cData := ""
>
> IF !Empty( hRequest )
> WHILE oInet:ReadFile( hRequest, @cBuffer, 1024 )
> cData += cBuffer
> cBuffer := Space( 1024 )
> END
> oInet:CloseRequest( hRequest )
> ENDIF
>
> I wrote this sample from the top of my head but it should work that way.
>
> Regards,
> José Lalí­n
>

tinternet:postrequest

Publicado: Mar Oct 14, 2008 4:19 pm
por notengo
Pedro,
> The problem is that i need to send a "SOAP" (envelope)message and i
> think XAILER can't handle this
Never used SOAP with Xailer so I can't help on this, sorry.
BTW, in local.olivares2000.xbase forum there are some messages from Rafa
explaining how to use SOAP. Maybe they are usefull for you.
Regards,
José Lalí­n