SOAP Parametre

Trilenium

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

Aşağıda yazılı olan Query ile verileri alabiliyorum buraya kadar sorun yok.

Fakat ben sirket kodunu herhangi bir excel sayfasında parametrik olmasını istiyorum. 001 yazan şirket kodunu parametre sayfasında değiştirerek sorguyu alsın istiyorum.

Bunu nasıl sağlayabilirim ?


let
url = "https://xxx.com/Webservice.asmx",
SOAPEnvelope="<soap:Envelope xmlns:xsi=#(0022)http://www.w3.org/2001/XMLSchema-instance#(0022) xmlns:xsd=#(0022)http://www.w3.org/2001/XMLSchema#(0022) xmlns:soap=#(0022)http://schemas.xmlsoap.org/soap/envelope/#(0022)>
<soap:Body>
<PerMas xmlns=#(0022)http://tempuri.org/#(0022)>
<username>test</username>
<password>test</password>
<sirkod>001</sirkod>
</PerMas>
</soap:Body>
</soap:Envelope>",

options=[
#"Content-Type"="text/xml; charset=utf-8"
],
Source= Xml.Tables( Web.Contents(url,[Content=Text.ToBinary(SOAPEnvelope),Headers = options])),
Table = Source{0}
 

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
Son düzenleme:

MusaPEKEL

Altın Üye
Katılım
29 Ağustos 2016
Mesajlar
65
Excel Vers. ve Dili
2013
Altın Üyelik Bitiş Tarihi
16-01-2027
Merhabalar,

Aşağıda yazılı olan Query ile verileri alabiliyorum buraya kadar sorun yok.

Fakat ben sirket kodunu herhangi bir excel sayfasında parametrik olmasını istiyorum. 001 yazan şirket kodunu parametre sayfasında değiştirerek sorguyu alsın istiyorum.

Bunu nasıl sağlayabilirim ?


let
url = "https://xxx.com/Webservice.asmx",
SOAPEnvelope="<soap:Envelope xmlns:xsi=#(0022)http://www.w3.org/2001/XMLSchema-instance#(0022) xmlns:xsd=#(0022)http://www.w3.org/2001/XMLSchema#(0022) xmlns:soap=#(0022)http://schemas.xmlsoap.org/soap/envelope/#(0022)>
<soap:Body>
<PerMas xmlns=#(0022)http://tempuri.org/#(0022)>
<username>test</username>
<password>test</password>
<sirkod>001</sirkod>
</PerMas>
</soap:Body>
</soap:Envelope>",

options=[
#"Content-Type"="text/xml; charset=utf-8"
],
Source= Xml.Tables( Web.Contents(url,[Content=Text.ToBinary(SOAPEnvelope),Headers = options])),
Table = Source{0}

Kod:
let
    // Excel sayfasındaki hücreden sirket kodunu al
    sirketKodu = Excel.CurrentWorkbook(){[Name="SirketKodu"]}[Content]{0}[Column1],
    
    // SOAP sorgusunu oluştur
    url = "https://xxx.com/Webservice.asmx",
    SOAPEnvelope = "<soap:Envelope xmlns:xsi=#(0022)http://www.w3.org/2001/XMLSchema-instance#(0022) xmlns:xsd=#(0022)http://www.w3.org/2001/XMLSchema#(0022) xmlns:soap=#(0022)http://schemas.xmlsoap.org/soap/envelope/#(0022)>
    <soap:Body>
    <PerMas xmlns=#(0022)http://tempuri.org/#(0022)>
    <username>test</username>
    <password>test</password>
    <sirkod>" & Text.From(sirketKodu) & "</sirkod>
    </PerMas>
    </soap:Body>
    </soap:Envelope>",

    options = [
        #"Content-Type"="text/xml; charset=utf-8"
    ],
    
    // Web sorgusunu yap
    source = Xml.Tables( Web.Contents(url, [Content=Text.ToBinary(SOAPEnvelope), Headers=options])),
    // Gerekli tabloyu seç
    table = source{0}
in
    table
 
Katılım
12 Aralık 2015
Mesajlar
1,207
Excel Vers. ve Dili
Türkçe Ofis 2007
Daha önce hazırlamış olduğum bir dosyayı sizin sorunuza uygulamaya çalıştım.
Power Query ile alınmış tabloyu L1 hücresindeki seçimi değiştirince sql metnini değiştirerek sorguluyor.
 
Son düzenleme:

Trilenium

Destek Ekibi
Destek Ekibi
Katılım
16 Eylül 2008
Mesajlar
1,115
Excel Vers. ve Dili
Microsoft Office 2019 English
Daha önce hazırlamış olduğum bir dosyayı sizin sorunuza uygulamaya çalıştım.
Power Query ile alınmış tabloyu L1 hücresindeki seçimi değiştirince sql metnini değiştirerek sorguluyor.
Çok teşekkürler.

Lakin bu table üzerinde sorgulama yapıyor.

Benim yapmak istediğim şey ise Query içindeki sirkod adlı alan için sorgulamayı hücre üzerinden yapsın ve veriyi getirsin. Yani a1 hücresine şirket kodunu yazdığımda direkt sorgulayacak


<soap:Body>
<PerMas xmlns=#(0022)http://tempuri.org/#(0022)>
<username>test</username>
<password>test</password>
<sirkod>362</sirkod>
</PerMas>
</soap:Body>
 
Katılım
12 Aralık 2015
Mesajlar
1,207
Excel Vers. ve Dili
Türkçe Ofis 2007
Sitede veriler değişince güncel verileri getiriyor, yani tablonun kendisini güncelliyor, statik değil.
Sql metni düzenlenirse bu yöntemle toplam filanda alınır
 

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
Çok teşekkürler.

Lakin bu table üzerinde sorgulama yapıyor.

Benim yapmak istediğim şey ise Query içindeki sirkod adlı alan için sorgulamayı hücre üzerinden yapsın ve veriyi getirsin. Yani a1 hücresine şirket kodunu yazdığımda direkt sorgulayacak

3 No'lu mesajda Musa Beyin tarafından önerilen, dediğiniz işi yapmıyor mu?

.
 

Trilenium

Destek Ekibi
Destek Ekibi
Katılım
16 Eylül 2008
Mesajlar
1,115
Excel Vers. ve Dili
Microsoft Office 2019 English
Kod:
let
    // Excel sayfasındaki hücreden sirket kodunu al
    sirketKodu = Excel.CurrentWorkbook(){[Name="SirketKodu"]}[Content]{0}[Column1],
   
    // SOAP sorgusunu oluştur
    url = "https://xxx.com/Webservice.asmx",
    SOAPEnvelope = "<soap:Envelope xmlns:xsi=#(0022)http://www.w3.org/2001/XMLSchema-instance#(0022) xmlns:xsd=#(0022)http://www.w3.org/2001/XMLSchema#(0022) xmlns:soap=#(0022)http://schemas.xmlsoap.org/soap/envelope/#(0022)>
    <soap:Body>
    <PerMas xmlns=#(0022)http://tempuri.org/#(0022)>
    <username>test</username>
    <password>test</password>
    <sirkod>" & Text.From(sirketKodu) & "</sirkod>
    </PerMas>
    </soap:Body>
    </soap:Envelope>",

    options = [
        #"Content-Type"="text/xml; charset=utf-8"
    ],
   
    // Web sorgusunu yap
    source = Xml.Tables( Web.Contents(url, [Content=Text.ToBinary(SOAPEnvelope), Headers=options])),
    // Gerekli tabloyu seç
    table = source{0}
in
    table

Hocam çok teşekkür ederim. Ellerinize sağlık oldu.
 
Üst