Can a WSDL indicate the SOAP version (1.1 or 1.2) of the web service?

前端 未结 5 741
醉话见心
醉话见心 2020-11-30 23:36

Is it possible to see if a web service uses SOAP 1.1 or 1.2, based on the information in the WSDL?

5条回答
  •  独厮守ぢ
    2020-12-01 00:24

    In WSDL, if you look at the Binding section, you will clearly see that soap binding is explicitly mentioned if the service uses soap 1.2. refer the below sample.

    
    
    
        
        
        
    
        
        
        
    
    
    

    if the web service use soap 1.1, it will not explicitly define any soap version in the WSDL file under binding section. refer the below sample.

    
    
    
        
        
        
    
        
        
        
    
    
    

    How to determine the SOAP version of the SOAP message?

    but remember that this is not much recommended way to determine the soap version that your web services uses. the version of the soap message can be determined using one of following ways.

    1. checking the namespace of the soap message

    SOAP 1.1  namespace : http://schemas.xmlsoap.org/soap/envelope
    
    SOAP 1.2 namespace  : http://www.w3.org/2003/05/soap-envelope
    

    2. checking the transport binding information (http header information) of the soap message

    SOAP 1.1 : user text/xml for the Context-Type

       POST /MyService HTTP/1.1
       Content-Type: text/xml; charset="utf-8"
       Content-Length: xxx
       SOAPAction: "urn:uuid:myaction"
    

    SOAP 1.2 : user application/soap+xml for the Context-Type

       POST /MyService HTTP/1.1
       Content-Type: application/soap+xml; charset="utf-8"
       Content-Length: xxx
       SOAPAction: "urn:uuid:myaction"
    

    3. using SOAP fault information

    The structure of a SOAP fault message between the two versions are different.

提交回复
热议问题