Visualizzazione dei risultati da 1 a 8 su 8
  1. #1
    Utente di HTML.it
    Registrato dal
    Oct 2009
    Messaggi
    26

    [VB.NET] Errore su chiamata SOAP: Versione di messaggio non riconosciuta

    Buongiorno a tutti, devo agganciare un webservice php con vb.net, ma ritorna sempre il messaggio "Versione di messaggio non riconosciuta", da cosa può dipendere?

  2. #2
    Moderatore di Windows e software L'avatar di URANIO
    Registrato dal
    Dec 1999
    residenza
    Casalpusterlengo (LO)
    Messaggi
    1,255
    Ma ti da errore quando cerchi di importare il WSDL o quando esegui la chiamata?

  3. #3
    Utente di HTML.it
    Registrato dal
    Oct 2009
    Messaggi
    26
    Questa è la chiamata:

    Dim URL3 As String = "https://localhost:8443/ws/ws5.wsdl"
    Dim address3 As New EndpointAddress(URL3)
    Dim binding3 = New WSHttpBinding(SecurityMode.Transport, False)
    binding3.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic
    binding3.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName
    binding3.TextEncoding = System.Text.Encoding.UTF8
    Dim service3 As New ServiceReference2.WebService1Soap12Client(binding3 , address3)
    service3.ClientCredentials.UserName.UserName = username
    service3.ClientCredentials.UserName.Password = password
    Dim vmsg = binding3.MessageVersion
    Dim retxml = service3.dpInviaEsitoPagamento(xmlstr)

    l'errore avviene sull'ultima riga

    se il WS lo richiamo da una pagina php non ci sono errori, non riesco ad includere il codice WSDL perchè lo riconosce come immagine...

  4. #4
    Moderatore di Programmazione L'avatar di alka
    Registrato dal
    Oct 2001
    residenza
    Reggio Emilia
    Messaggi
    24,301
    Potrebbe essere che il client generato dal framework utilizzi una versione di SOAP diversa.

    Hai provato ad aggiungere il proxy come Web Reference "classica"?

    Quando aggiungi la Service Reference al progetto per importare il WSDL, premi il pulsante "Advanced" e usa l'opzione "Add Web Reference".

    Così vediamo se cambia qualcosa.

    P.S.: se tenti di allegare il WSDL, forse te lo considera come immagine, ma nulla vieta di fare copia/incolla in un messaggio qui.

    Ciao!
    MARCO BREVEGLIERI
    Software and Web Developer, Teacher and Consultant

    Home | Blog | Delphi Podcast | Twitch | Altro...

  5. #5
    Utente di HTML.it
    Registrato dal
    Oct 2009
    Messaggi
    26
    Ciao, utilizzo sempre il web reference, infatti visual studi 2019 me lo vedo correttamente, la versione che usa è la soap12.
    Ho tentato di fare copia/incolla del WSDL ma dice che 26 immagini sono troppe

  6. #6
    Utente di HTML.it
    Registrato dal
    Oct 2009
    Messaggi
    26
    codice:
    <wsdl:definitions xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" 
                      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
                      xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
                      xmlns:tns="http://tempuri.org/" 
                      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
                      xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
                      xmlns:s="http://www.w3.org/2001/XMLSchema" 
                      xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
                      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
                      targetNamespace="http://tempuri.org/">
    
    
    <wsdl:types>
        <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
            <s:element name="dpInviaEsitoPagamento">
                <s:complexType>
                    <s:sequence>
                        <s:element minOccurs="0" maxOccurs="1" name="xml" type="s:string"/>
                    </s:sequence>
                </s:complexType>
            </s:element>
            <s:element name="dpInviaEsitoPagamentoResponse">
                <s:complexType>
                    <s:sequence>
                        <s:element minOccurs="0" maxOccurs="1" name="dpInviaEsitoPagamentoResult" type="s:string"/>
                    </s:sequence>
                </s:complexType>
            </s:element>
        </s:schema>
    </wsdl:types>
    
    
    <wsdl:message name="dpInviaEsitoPagamentoSoapIn">
        <wsdl:part name="parameters" element="tns:dpInviaEsitoPagamento"/>
    </wsdl:message>
    <wsdl:message name="dpInviaEsitoPagamentoSoapOut">
        <wsdl:part name="parameters" element="tns:dpInviaEsitoPagamentoResponse"/>
    </wsdl:message>
    
    
    <wsdl:portType name="WebService1Soap">
        <wsdl:operation name="dpInviaEsitoPagamento">
            <wsdl:input message="tns:dpInviaEsitoPagamentoSoapIn"/>
            <wsdl:output message="tns:dpInviaEsitoPagamentoSoapOut"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:portType name="WebService1Soap12">
        <wsdl:operation name="dpInviaEsitoPagamento">
            <wsdl:input message="tns:dpInviaEsitoPagamentoSoapIn"/>
            <wsdl:output message="tns:dpInviaEsitoPagamentoSoapOut"/>
        </wsdl:operation>
    </wsdl:portType>
    
    
    <wsdl:binding name="WebService1Soap" type="tns:WebService1Soap">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
        <wsdl:operation name="dpInviaEsitoPagamento">
            <soap:operation soapAction="http://tempuri.org/dpInviaEsitoPagamento"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    
    
    <wsdl:binding name="WebService1Soap12" type="tns:WebService1Soap12">
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
        <wsdl:operation name="dpInviaEsitoPagamento">
            <soap12:operation soapAction="http://tempuri.org/dpInviaEsitoPagamento"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    
    
    <wsdl:service name="WebService1">
        <wsdl:port name="WebService1Soap" binding="tns:WebService1Soap">
            <soap:address location="https://localhost:8443/ws/ws5.PHP"/>
        </wsdl:port>
        <wsdl:port name="WebService1Soap12" binding="tns:WebService1Soap12">
            <soap12:address location="https://localhost:8443/ws/ws5.PHP"/>
        </wsdl:port>
    </wsdl:service>
    
    
    </wsdl:definitions>

  7. #7
    Utente di HTML.it
    Registrato dal
    Oct 2009
    Messaggi
    26
    questo è l'header della chiamata:

    Host: localhost:8443
    Connection: Keep-Alive
    User-Agent: PHP-SOAP/7.2.0
    Content-Type: application/soap+xml; charset=utf-8; action="http://tempuri.org/dpInviaEsitoPagamento"
    Content-Length: 1089

  8. #8
    Utente di HTML.it
    Registrato dal
    Oct 2009
    Messaggi
    26
    Buongiorno a tutti,
    ho risolto il problema precedente, ora si presenta quest'altro avviso:

    xml:lang attribute value is missing

    questo è il codice VB.NEt della chiamata al Webservice SOAP:

    Dim retmsg As String = ""
    Try
    Dim URL3 As String = "https://localhost:8443/ws/dpInviaEsitoPagamento/dpInviaEsitoPagamento.php?WSDL"
    Dim address3 As New EndpointAddress(URL3)
    Dim binding3 = New WSHttpBinding(SecurityMode.Transport, False)
    binding3.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic
    binding3.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName
    binding3.TextEncoding = System.Text.Encoding.UTF8
    Dim service3 As New ServiceReference2.WebService1SoapClient(binding3, address3)
    service3.ClientCredentials.UserName.UserName = username
    service3.ClientCredentials.UserName.Password = password
    Dim vmsg = binding3.MessageVersion
    Dim retxml2 = service3.dpInviaEsitoPagamento(xmlstr4)
    Catch ex As Exception
    retmsg = ex.InnerException.Message
    End Try

    qualche idea?
    Grazie

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.