Agusto Xaverius P Sipahutar

Job:Making some bugs and patch
Moss/Wss,C#,Sql Server,WWF,K2.BP
Motto : Keep Study and study
See also: Other Geeks@INDC

News

My Certification



MCP ID# 3552391

My Curiculum Vitae


Other Article

My Community

My Article/Share Knowledge

Others Moss/Wss Site

Xml Web Service dengan SOAP dan Visual Basic 6.0

Xml Web Service dengan SOAP dan Visual Basic 6.0
Di web service .net akan kita bisa lihat penjelasan SOAP seperti ini : SOAP
The following is a sample SOAP request and response. Method nya :

 

POST /_vti_bin/routingservices.asmx HTTP/1.1
Host: wsstemplate
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.plasmedia.com/ffi/SharepointRoutingWS/GetDepartmentList"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetDepartmentList xmlns="http://www.plasmedia.com/ffi/SharepointRoutingWS">
<listName>string</listName>
</GetDepartmentList>
</soap:Body>
</soap:Envelope>

Result yang akan di hasilkan :
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetDepartmentListResponse xmlns="http://www.plasmedia.com/ffi/SharepointRoutingWS">
<GetDepartmentListResult>
     <DeptInfo>
                 <ID>string</ID>
                 <Name>string</Name>
      </DeptInfo>
      <DeptInfo>
                 <ID>string</ID>
                 <Name>string</Name>
      </DeptInfo>
</GetDepartmentListResult>
</GetDepartmentListResponse>
</soap:Body>
</soap:Envelope>

 
 
Penggunaannya di visual basic 6.0 / VBA :
  Dim xmlhttp, xmldom
Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
set xmldom = CreateObject("Microsoft.XMLDOM")

Dim sEnvelope
Dim szUrl
szUrl = "http://wsstemplate/ffi/_vti_bin/routingservices.asmx"

sEnvelope = "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">"

sEnvelope = sEnvelope & "<soap:Body>"
sEnvelope = sEnvelope & "<GetDepartmentList "
sEnvelope = sEnvelope & "xmlns=""http://www.plasmedia.com/ffi/SharepointRoutingWS"">"
sEnvelope = sEnvelope & "<listName>Department Info</listName>"

sEnvelope = sEnvelope & "</GetDepartmentList></soap:Body></soap:Envelope>"

xmlhttp.Open "POST", szUrl, False
xmlhttp.setRequestHeader "Content-Type", "text/xml"
xmlhttp.setRequestHeader "SOAPAction", "http://www.plasmedia.com/ffi/SharepointRoutingWS/GetDepartmentList"
xmlhttp.send (sEnvelope)

If (xmlhttp.readyState = 4) Then

 If (xmlhttp.Status = 200) Then
      xmldom.async = False
      xmldom.loadXML(xmlhttp.responseText) 'Hasil ini akan di hasilkan result XMl sesuai dengan hasil yg jelaskan diatas
      msgbox xmlhttp.responseText

 End If
End If

Set xmldom = Nothing
Set xmlhttp = Nothing

Share this post: | | | |
Posted: Aug 01 2006, 08:27 PM by agusto | with 1 comment(s)
Filed under: , ,

Comments

si cupu said:

bang nge blog nya jelasan dikit donk. T_T

# January 3, 2008 5:30 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 
Are you human?:  


Enter the numbers above: