Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to use gSOAP with Qt for Web Service Client

How to use gSOAP with Qt for Web Service Client

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 5.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    danitiger33
    wrote on 4 May 2013, 16:16 last edited by
    #1

    i was following

    http://qt-project.org/wiki/How_to_use_gSOAP_with_Qt_for_Web_Service_

    tutorial but i when i execute wsdl2h program i get this error :

    An error occurred while parsing WSDL or XSD from 'http://localhost:11061/WebServ
    ice.asmx'
    Error 3 fault: SOAP-ENV:Client [no subcode]
    "Validation constraint violation: tag name or namespace mismatch in element 'htm
    l'"
    Detail: [no detail]
    HTTP/1.1 200 OK
    Cache-Control: private, max-age=0
    Content-Type: text/html; charset=utf-8
    Server: Microsoft-IIS/8.0
    X-AspNet-Version: 4.0.30319
    X-SourceFiles: =?UTF-8?B?QzpcVXNlcnNcZGFuaWFsXERvY3VtZW50c1xWaXN1YWwgU3R1ZGlvIDI
    wMTJcV2ViU2l0ZXNcV2ViU2l0ZTNcV2ViU2VydmljZS5hc214?=
    X-Powered-By: ASP.NET
    Date: Sat, 04 May 2013 15:57:51 GMT
    Connection: close
    Content-Length: 3071

    <html>
    <!-- ** HERE ** -->

    &lt;head&gt;&lt;link rel="alternate" type="text/xml" href="/WebService.asmx?disco" />
    
    
    &lt;style type="text/css"&gt;
    
                BODY { color: #000000; background-color: white; font-family: Ver
    

    dana; margin-left: 0px; margin-top: 0px; }
    #content { margin-left: 30px; font-size: .70em; padding-bottom:
    2em; }
    A:link { color: #336699; font-weight: bold; text-decoration: und
    erline; }
    A:visited { color: #6699cc; font-weight: bold; text-decoration:
    underline; }
    A:active { color: #336699; font-weight: bold; text-decoration: u
    nderline; }
    A:hover { color: cc3300; font-weight: bold; text-decoration: und
    erline; }
    P { color: #000000; margin-top: 0px; margin-bottom: 12px; font-f
    amily: Verdana; }
    pre { background-color: #e5e5cc; padding: 5px; font-family: Cour
    ier New; font-size: x-small; margin-top: -5px; border: 1px #f0f0e0 solid; }
    td { color: #000000; font-family: Verdana; font-size: .7em; }
    h2 { font-size: 1.5em; font-weight: bold; margin-top: 25px; marg
    in-bottom: 10px; border-top: 1px solid #003


    Ive done These steps :

    1. Creating ASP.net web service with this WSDL :
      <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://Mysite.ir/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 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:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://Mysite.ir/">
      wsdl:types
      <s:schema elementFormDefault="qualified" targetNamespace="http://Mysite.ir/">
      <s:element name="GetContact">
      <s:complexType>
      <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="id" type="s:string"/>
      </s:sequence>
      </s:complexType>
      </s:element>
      <s:element name="GetContactResponse">
      <s:complexType>
      <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="GetContactResult" type="s:string"/>
      </s:sequence>
      </s:complexType>
      </s:element>
      </s:schema>
      </wsdl:types>
      <wsdl:message name="GetContactSoapIn">
      <wsdl:part name="parameters" element="tns:GetContact"/>
      </wsdl:message>
      <wsdl:message name="GetContactSoapOut">
      <wsdl:part name="parameters" element="tns:GetContactResponse"/>
      </wsdl:message>
      <wsdl:portType name="WebServiceSoap">
      <wsdl:operation name="GetContact">
      <wsdl:input message="tns:GetContactSoapIn"/>
      <wsdl:output message="tns:GetContactSoapOut"/>
      </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="WebServiceSoap" type="tns:WebServiceSoap">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name="GetContact">
      <soap:operation soapAction="http://Mysite.ir/GetContact" 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="WebServiceSoap12" type="tns:WebServiceSoap">
      <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name="GetContact">
      <soap12:operation soapAction="http://Mysite.ir/GetContact" 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="WebService">
      <wsdl:port name="WebServiceSoap" binding="tns:WebServiceSoap">
      <soap:address location="http://localhost:11061/WebService.asmx"/>
      </wsdl:port>
      <wsdl:port name="WebServiceSoap12" binding="tns:WebServiceSoap12">
      <soap12:address location="http://localhost:11061/WebService.asmx"/>
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>

    after that i copy :

    wsdl:types
    <s:schema elementFormDefault="qualified" targetNamespace="http://Mysite.ir/">
    <s:element name="GetContact">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="id" type="s:string"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="GetContactResponse">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="GetContactResult" type="s:string"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:schema>
    </wsdl:types>

    from wsdl and past it on typemap.dat file

    and then i added

    myns = "http://Mysite.ir/"

    to that file

    after that ive entered follwing command in cmd :

    C:\Gsoap\gsoap-2.8\gsoap\bin\win32>wsdl2h -s -t C:\Gsoap\gsoap-2.8\gsoap\WS\typemap.dat -o contact.h http://localhost:11061/WebService.asmx

    where's my problem ?

    Thank in advance.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 4 May 2013, 19:47 last edited by
      #2

      Hi,

      This error comes from the gsoap side not Qt, please ask the question on the gsoap mailing list.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        danitiger33
        wrote on 4 May 2013, 20:11 last edited by
        #3

        Hi
        Okay
        sorry

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on 4 May 2013, 21:31 last edited by
          #4

          http://localhost:11061/WebService.asmx is returning an HTML document. wsdl2h is expecting to get a WSDL xml document.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            danitiger33
            wrote on 5 May 2013, 08:35 last edited by
            #5

            Thanks.
            That was it.

            1 Reply Last reply
            0

            4/5

            4 May 2013, 21:31

            • Login

            • Login or register to search.
            4 out of 5
            • First post
              4/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved