Cvc-elt.1: Cannot Find The Declaration Of Element 'soap:Envelope'

前端 未结 2 1809
陌清茗
陌清茗 2020-12-11 17:56

Currently I\'m using XSD for SOAP XML, but when I run my SOAP XML and XSD on FREEFORMATTER.COM, I get this error:

Cvc-elt.1: Cannot Find The Declarati

2条回答
  •  天涯浪人
    2020-12-11 18:24

    First, you must add a targetNamespace="http://tempuri.org/" to the xs:schema element of your XSD in order for your XSD to apply to the namespace used in your XML payload.

    Then you can take either of the following approaches: Change the XML or Change the XSD. Choose according to which files you control.

    Change the XML

    Add

    xsi:schemaLocation="http://tempuri.org/ tempuri.xsd
                        http://schemas.xmlsoap.org/soap/envelope/ 
                        http://schemas.xmlsoap.org/soap/envelope/
    

    to the soap:Envelope:

    
    
      
        
          
            
              1605000194
              qwertyu
            
            
              1605000194
              qwerty
            
          
        
      
    
    

    Change the XSD

    Add

    
    

    to the xs:schema element of your XSD:

    
    
      
    
      
        
          
            
              
                
                  
                    
                      
                        
                        
                      
                    
                  
                
              
            
          
        
      
    
    

    Both methods will allow successful validation of your SOAP envelop and its payload.

提交回复
热议问题