随笔 - 5  文章 - 3  trackbacks - 0
<2006年12月>
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456

常用链接

留言簿(3)

随笔档案

文章档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜

To learn web service, we need to learn WSDL. This xml file defines the services that we deploy in our web service.
Here, we get  a  example of WSDL.

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://localhost:8080/bookstore/services/BookSvc" 
  xmlns
="http://schemas.xmlsoap.org/wsdl/" 
  xmlns:apachesoap
="http://xml.apache.org/xml-soap" 
  xmlns:impl
="http://localhost:8080/bookstore/services/BookSvc" 
  xmlns:intf
="http://localhost:8080/bookstore/services/BookSvc" 
  xmlns:soapenc
="http://schemas.xmlsoap.org/soap/encoding/" 
  xmlns:tns1
="http://model.bookstore.com" 
  xmlns:wsdl
="http://schemas.xmlsoap.org/wsdl/" 
  xmlns:wsdlsoap
="http://schemas.xmlsoap.org/wsdl/soap/" 
  xmlns:xsd
="http://www.w3.org/2001/XMLSchema">
  
<wsdl:types>
    
<schema targetNamespace="http://model.bookstore.com" xmlns="http://www.w3.org/2001/XMLSchema">
      
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
      
<complexType name="Book">
        
<sequence>
          
<element name="ISDN" nillable="true" type="xsd:string"/>
          
<element name="name" nillable="true" type="xsd:string"/>
          
<element name="page" type="xsd:int"/>
        
</sequence>
      
</complexType>
    
</Schema>
  
</wsdl:types>
  
<wsdl:message name="addBookResponse">
  
</wsdl:message>
  
<wsdl:message name="addBookRequest">
    
<wsdl:part name="book" type="tns1:Book"/>
  
</wsdl:message>
  
<wsdl:portType name="BookSvc">
    
<wsdl:operation name="addBook" parameterOrder="book">
      
<wsdl:input message="intf:addBookRequest" name="addBookRequest"/>
      
<wsdl:output message="intf:addBookResponse" name="addBookResponse"/>
    
</wsdl:operation>
  
</wsdl:portType>
  
<wsdl:binding name="BookSvcSoapBinding" type="intf:BookSvc">
    
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    
<wsdl:operation name="addBook">
      
<wsdlsoap:operation soapAction=""/>
      
<wsdl:input name="addBookRequest">
        
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://bookstore.com" use="encoded"/>
      
</wsdl:input>
      
<wsdl:output name="addBookResponse">
        
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/bookstore/services/BookSvc" use="encoded"/>
      
</wsdl:output>
    
</wsdl:operation>
  
</wsdl:binding>
  
<wsdl:service name="BookSvcService">
    
<wsdl:port binding="intf:BookSvcSoapBinding" name="BookSvc">
      
<wsdlsoap:address location="http://localhost:8080/bookstore/services/BookSvc"/>
    
</wsdl:port>
  
</wsdl:service>
</wsdl:definitions>
 So many infomations in this file. But first of all, we need to understand the format of this file.
To me, the defination of namespace is a problem.

My qustions are: For xmlns, xmlns:tns1,xmlns:intf..., What do they mean? How to use them?


After I refered to some articles in internet. I get the answer:
每个namespace属性都声明了一个缩略语,用在文档中。例如"xmlns:xsd"就为 http://www.w3.org/2001/XMLSchema定义了一个缩略语(xsd)。这就允许对该namespace的引用只需简单的在名字前加上前缀就可以了,如:"xsd:int"中的"xsd"就是合法的类型名。普通范围规则可运用于缩略前缀。也就是说,前缀所定义的元素只在元素中有效。而xmlns="..." 表示默认的namespace, 定义范围内的所有没有前缀的名称都属于这个默认的namespace.

But I get another question that no one reply.
refer

'我们都知道,WSDL应该是格式正确的XML文档。进一步,还应该把它看作一个Schema,因此,<definitions>元素中可以定义targetNamespace属性,表示在这个元素下的所有元素都属于这个目标名称空间。

xmlns表示缺省的名称空间,...'


So what's difference between 'targetnamespace' and default 'xmlns'?
?????????????????????????????????????????????????????????

Reference:
http://www.cnblogs.com/bjzhanghao/archive/2004/10/13/51614.html
posted @ 2008-03-14 10:11 托托姆 阅读(808) | 评论 (0)编辑 收藏
现在正在做的项目中,就有undo、redo的操作。使用的是java本身的undoManager。但是因为使用的第三方软件包已经把它封装过了,所以用起来并不是直接使用java的undomanager。其间,遇到这样的问题:有些操作不想被undo所管理,但是图形上的变换却总是会被listener加入到undo的edits中。想了很多办法,包括继承再封装undomanager将edits传出来保存,需要恢复的时候再设进去、discard所有的edits、找寻第三方软件封装undoableEdit的方法,以使得操作不被undo....最后,用最简单的方法解决问题:设置一个boolean变量,然后重载listener的方法,用这个变量来控制是否调用super.undoableEditHappened即可。 唉,真笨啊,用这么简单的问题都能解决的,搞了老半天... ---------------------------- A ja A ja, fighting fighting
posted @ 2007-01-17 13:24 托托姆 阅读(424) | 评论 (0)编辑 收藏
http://www.5ud.net 就是这个网站。
posted @ 2007-01-15 13:04 托托姆 阅读(356) | 评论 (0)编辑 收藏
load进一个图片,如果对它进行放大缩小呢? 查找了很多地方的资料,找到以下的方法可以解决放大缩小图片问题: public static ImageIcon imageIconZoom(ImageIcon orgImageIcon, int newWidth, int newHeight) { BufferedImage tag = new BufferedImage(newWidth, newHeight, BufferedImage.TYPE_INT_ARGB); tag.getGraphics().drawImage(orgImageIcon.getImage(), 0, 0, newWidth, newHeight, null); return new ImageIcon(tag); } 如何对图片着色呢? static final float CRITICAL_BAND_MATRIX[][] = { { 1.0f, 0.0f, 0.0f , 0.0f}, { 0.0f, 0.0f, 0.0f , 0.0f}, { 0.0f, 0.0f, 0.0f,0.0f }, { 1.0f, 0.0f, 0.0f, 0.0f } }; static final float MAJOR_BAND_MATRIX[][] = { { 1.0f, 0.0f, 0.0f , 0.0f}, { 0.0f, 0.5f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f , 0.0f}, { 1.0f, 0.5f, 0.0f, 0.0f } }; static final float MINOR_BAND_MATRIX[][] = { { 1.0f, 0.0f, 0.0f , 0.0f}, { 0.0f, 1.0f, 0.0f , 0.0f}, { 0.0f, 0.0f, 0.0f, 0.0f } , { 1.0f, 1.0f, 0.0f, 0.0f }}; static final float WARNING_BAND_MATRIX[][] = { { 0.5f, 0.0f, 0.0f , 0.0f}, { 0.0f, 0.0f, 0.0f , 0.0f}, { 0.0f, 0.0f, 1.0f , 0.0f} , { 0.5f, 0.0f, 1.0f, 0.0f }}; static final float CLEAR_BAND_MATRIX[][] = { { 0.0f, 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 1.0f, 0.0f }, { 0.0f, 1.0f, 1.0f, 0.0f } }; static final float UNKNOWN_BAND_MATRIX[][] = { { 0.0f, 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f , 0.0f}, { 0.0f, 0.0f, 1.0f, 0.0f } , { 0.0f, 0.0f, 1.0f, 0.0f }}; public static ImageIcon ColorImage(ImageIcon orgImage, int alarmStatus ){ float[][] targetMatrix ; switch(alarmStatus){ case CommonConstants.ALARM_UNKNOWN: targetMatrix = UNKNOWN_BAND_MATRIX; break; case CommonConstants.ALARM_CLEAR: targetMatrix = CLEAR_BAND_MATRIX; break; case CommonConstants.ALARM_MINOR: targetMatrix = MINOR_BAND_MATRIX; break; case CommonConstants.ALARM_MAJOR: targetMatrix = MAJOR_BAND_MATRIX; break; case CommonConstants.ALARM_CRITICAL: targetMatrix = CRITICAL_BAND_MATRIX; case CommonConstants.ALARM_WARNING: targetMatrix = WARNING_BAND_MATRIX; break; default: targetMatrix = UNKNOWN_BAND_MATRIX; } BufferedImage b1 ; BufferedImage biSrc = new BufferedImage(orgImage.getIconWidth(), orgImage.getIconHeight(), BufferedImage.TYPE_INT_ARGB); // biSrc.getGraphics().setColor(Color.white); // biSrc.getGraphics().fillRect(0, 0, orgImage.getIconWidth(), orgImage.getIconHeight()); biSrc.getGraphics().drawImage(orgImage.getImage(),0,0,null); BufferedImage biTar = new BufferedImage(orgImage.getIconWidth(), orgImage.getIconHeight(), BufferedImage.TYPE_INT_ARGB); Raster srcRaster = biSrc.getRaster(); WritableRaster dstRaster = (WritableRaster) biTar.getRaster(); BandCombineOp bandCombineOp = new BandCombineOp(targetMatrix, null); bandCombineOp.filter(srcRaster, dstRaster); b1 = biTar; return new ImageIcon(b1); } 其中值得一说,却又说不清楚的地方是:BufferedImage.TYPE_INT_ARGB, 为什么要用TYPE_INT_ARGB,而不用TYPE_INT_RGB,之前我是用的TYPE_INT_RGB,而且matrix也是3*3的一个矩阵,后来发现,着色前,图片透明的地方,着色后,变成了黑色的了,于是猜想ARGB中的A应该是alphe的意思,就摸索构造了矩阵,并且着了实验,用是能用,不知道对不对啊。。。。
posted @ 2006-12-29 16:38 托托姆 阅读(937) | 评论 (1)编辑 收藏