WSDL文档深入分析

借助jdk的wsimort.exe工具生成客户端代码 格式:wsimport -keep url   //url为wsdl文件的路径

直接生成客户端代码会抛异常, 无法生成客户端代码, 解决办法:

  1. 将对应的wsdl文档保存到本地
  2. 修改wsdl文档的部分内容:

  替换成 

备注: 这个是Java调用net的webservice都有的问题

 

'1.0' encoding='UTF-8'?>
"http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:tns="http://ws.day01_ws.atguigu.com/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
    xmlns:ns1="http://schemas.xmlsoap.org/soap/http"
    name="HelloWSImplService" 
    targetNamespace="http://ws.day01_ws.atguigu.com/">
    
    
        "http://www.w3.org/2001/XMLSchema"
            xmlns:tns="http://ws.day01_ws.atguigu.com/" elementFormDefault="unqualified"
            targetNamespace="http://ws.day01_ws.atguigu.com/" version="1.0">
            
            
            
            "sayHello" type="tns:sayHello" />
            "sayHelloResponse" type="tns:sayHelloResponse" />
            "sayHello">
                
                    "0" name="arg0" type="xs:string" />
                
            
            "sayHelloResponse">
                
                    "0" name="return" type="xs:string" />
                
            
        
    
    
    
    
    
    "sayHelloResponse">
        "tns:sayHelloResponse" name="parameters">
        
    
    "sayHello">
        "tns:sayHello" name="parameters">
        
    
    
    
    
    "HelloWS">
        "sayHello">
            "tns:sayHello" name="sayHello">
            
            "tns:sayHelloResponse" name="sayHelloResponse">
            
        
    
    
    
    
    "HelloWSImplServiceSoapBinding" type="tns:HelloWS">
        "document"
            transport="http://schemas.xmlsoap.org/soap/http" />
        "sayHello">
            "" style="document" />
            "sayHello">
                "literal" />
            
            "sayHelloResponse">
                "literal" />
            
        
    
    
    
    "HelloWSImplService">
        "tns:HelloWSImplServiceSoapBinding" name="HelloWSImplPort">
            "http://192.168.10.165:8888/day01_ws/hellows" />
        
    

总体就是下面这个结构:

             

                    

                           

             

             

                    

             

                    

                           

                           

             

                    

                           

                           

             

                    

                           

文档结构图:

WSDL文档深入分析_第1张图片

转载于:https://www.cnblogs.com/yangh965/p/5046841.html

你可能感兴趣的:(WSDL文档深入分析)