• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Soap ile Veri Alma

Trilenium

Destek Ekibi
Destek Ekibi
Katılım
16 Eylül 2008
Mesajlar
1,290
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:operation name="PerMas">
<wsdl:input message="tns:PerMasSoapIn"/>
<wsdl:output message="tns:PerMasSoapOut"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="PersonelWebserviceSoap" type="tns:PersonelWebserviceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="PerMas">
<soap:operation soapAction="http://tempuri.org/PerMas" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="PersonelWebserviceSoap12" type="tns:PersonelWebserviceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="PerMas">
<soap12:operation soapAction="http://tempuri.org/PerMas" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</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
 
1. mesajda yazdığınızı okuyabiliyor musunuz ?

"Code tag" leri kullanın...

.
 
Geri
Üst