Importing xsd into wsdl

前端 未结 2 963
一向
一向 2020-12-25 11:32

This is my current configuration:

XSD




        
2条回答
  •  忘掉有多难
    2020-12-25 11:55

    You have a couple of problems here.

    First, the XSD has an issue where an element is both named or referenced; in your case should be referenced.

    Change:

     
    

    To:

     
    

    And:

    • Remove the declaration of the global element Stock
    • Create a complex type declaration for a type named Stock

    So:

    
        
    

    To:

    
    

    Make sure you fix the xml closing tags.

    The second problem is that the correct way to reference an external XSD is to use XSD schema with import/include within a wsdl:types element. wsdl:import is reserved to referencing other WSDL files. More information is available by going through the WS-I specification, section WSDL and Schema Import. Based on WS-I, your case would be:

    INCORRECT: (the way you showed it)

    
    
        
            
        
    
    

    CORRECT:

    
    
            
                             
            
        
        
            
        
    
    

    SOME processors may support both syntaxes. The XSD you put out shows issues, make sure you first validate the XSD.

    It would be better if you go the WS-I way when it comes to WSDL authoring.

    Other issues may be related to the use of relative vs. absolute URIs in locating external content.

提交回复
热议问题