Soap ile Veri Alma

Trilenium

Destek Ekibi
Destek Ekibi
Katılım
16 Eylül 2008
Mesajlar
1,134
Excel Vers. ve Dili
Microsoft Office 2019 English
Merhabalar,

Aşağıdaki kod ile personellere ait verileri çekmek istiyorum. Fakat object hatası alıyorum. Nerede hata yapıyorum acaba.

Dim Req As Object
Dim sEnv As String
Dim Resp As New MSXML2.DOMDocument60
Set Req = CreateObject("MSXML2.XMLHTTP")
Set Resp = CreateObject("MSXML2.DOMDocument.6.0")
Req.Open "Post", "https://www......com", False

sEnv = sEnv & "<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope"">"
sEnv = sEnv & " <soapenv:Header/>"
sEnv = sEnv & " <soapenv:Body>"
sEnv = sEnv & " <Request>"
sEnv = sEnv & " <soap:username>test</soap:username>"
sEnv = sEnv & " <soap:password>test</soap:password>"
sEnv = sEnv & " <soap:sirkod>262</soap:sirkod>"



sEnv = sEnv & " </Request>"
sEnv = sEnv & " </soapenv:Body>"
sEnv = sEnv & "</soapenv:Envelope>"
' Send SOAP Request
Req.send (sEnv)

Resp.LoadXML Req.responseText

Range("B6").Value = Resp.SelectSingleNode("//PerMasResponse/PerMasResult").Text '





asmx?WSDL XML Kaynağı aşağıdaki gibidir.


<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="PerMas">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="username" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="sirkod" type="s:int"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="PerMasResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="PerMasResult">
<s:complexType>
<s:sequence>
<s:any minOccurs="0" maxOccurs="unbounded" namespace="http://www.w3.org/2001/XMLSchema" processContents="lax"/>
<s:any minOccurs="1" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" processContents="lax"/>
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="PerMasSoapIn">
<wsdl:part name="parameters" element="tns:perMas"/>
</wsdl:message>
<wsdl:message name="PerMasSoapOut">
<wsdl:part name="parameters" element="tns:perMasResponse"/>
</wsdl:message>
<wsdl:portType name="PersonelWebserviceSoap">
<wsdl:eek:peration name="PerMas">
<wsdl:input message="tns:perMasSoapIn"/>
<wsdl:eek:utput message="tns:perMasSoapOut"/>
</wsdl:eek:peration>
</wsdl:portType>
<wsdl:binding name="PersonelWebserviceSoap" type="tns:personelWebserviceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:eek:peration name="PerMas">
<soap:eek:peration soapAction="http://tempuri.org/PerMas" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:eek:utput>
<soap:body use="literal"/>
</wsdl:eek:utput>
</wsdl:eek:peration>
</wsdl:binding>
<wsdl:binding name="PersonelWebserviceSoap12" type="tns:personelWebserviceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:eek:peration name="PerMas">
<soap12:eek:peration soapAction="http://tempuri.org/PerMas" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:eek:utput>
<soap12:body use="literal"/>
</wsdl:eek:utput>
</wsdl:eek:peration>
</wsdl:binding>
<wsdl:service name="PersonelWebservice">
<wsdl:port name="PersonelWebserviceSoap" binding="tns:personelWebserviceSoap">
<soap:address location="https://wwww....com"/>
</wsdl:port>
<wsdl:port name="PersonelWebserviceSoap12" binding="tns:personelWebserviceSoap12">
<soap12:address location="ttps://wwww....com"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>



Set Req = Nothing
Set Resp = Nothing
 

Haluk

Özel Üye
Katılım
7 Temmuz 2004
Mesajlar
12,406
Excel Vers. ve Dili
64 Bit 2010 - İngilizce
+
Google Sheets
+
JScript
Altın Üyelik Bitiş Tarihi
1. mesajda yazdığınızı okuyabiliyor musunuz ?

"Code tag" leri kullanın...

.
 
Üst