Real Software Forums
http://forums.realsoftware.com/

Soap call without using soapmethod(directly with httpsocket)
http://forums.realsoftware.com/viewtopic.php?f=2&t=47345
Page 1 of 1

Author:  jcgarrido [ Wed Mar 20, 2013 7:48 am ]
Post subject:  Soap call without using soapmethod(directly with httpsocket)

Somebody knows how to do that?
Where Can I find some code example?
Thanks in advance.

Author:  Goofie [ Wed Mar 20, 2013 8:02 am ]
Post subject:  Re: Soap call without using soapmethod(directly with httpsoc

I use the 2 methods for interfacing to my webservices.
This is a method using the built in Soapmethod:
dim sm As new SOAPMethod
dim sr As SOAPResult
sm.LoadWSDLFromURL(IP_WSDL)
sm.Parameter("strVerpleegeenheid")=afdeling
sm.Parameter("strDatum")=20130320
sm.timeout=WSDL_timeout
sr=sm.Invoke("GetByDateVerpleegeenheid")

if sr<>nil then
if sr.error=True Then
MsgBox "error SOAP: "+str(sr.errorCode)+EndOfLine+sr.errorMessage
Else
Return sr.Result("GetByDateVerpleegeenheidResponse")
end if
end if

For using http-code, i must have a formatted string: vXml is an xml-string which holds the question for my server...
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://tempuri.org/" xmlns:s26="http://www.myservice.com/Webservices/v1.0/VerblijfSearch">
<soap:Body>
<tns:Search>
<tns:objSearch>
<s26:ViewType>Verblijf.View.All</s26:ViewType>
<s26:OffSet>1</s26:OffSet>
<s26:Length>0</s26:Length>
<s26:Verpleegeenheid>B4</s26:Verpleegeenheid>
<s26:TypeBedden>O</s26:TypeBedden>
<s26:AantalRijen>0</s26:AantalRijen>
</tns:objSearch>
</tns:Search>
</soap:Body>
</soap:Envelope>

This string is used by the following method:
dim webserviceserver As new HTTPSocket
webserviceserver.SetPostContent vXML, "text/xml"
Return webserviceserver.Post(IP_WSDL,WSDL_timeout)

Author:  jcgarrido [ Wed Mar 20, 2013 9:29 am ]
Post subject:  Re: Soap call without using soapmethod(directly with httpsoc

Thanks a lot.
It's working fine.
Best ergards.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/