View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2008 eviware.com 
3    *
4    *  soapUI is free software; you can redistribute it and/or modify it under the 
5    *  terms of version 2.1 of the GNU Lesser General Public License as published by 
6    *  the Free Software Foundation.
7    *
8    *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
9    *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
10   *  See the GNU Lesser General Public License for more details at gnu.org.
11   */
12  
13  package com.eviware.soapui.impl.wsdl.support.soap;
14  
15  import java.text.Collator;
16  import java.util.Comparator;
17  
18  import javax.wsdl.Binding;
19  import javax.wsdl.BindingOperation;
20  import javax.wsdl.Definition;
21  
22  import org.xmlsoap.schemas.ws.x2004.x09.policy.Policy;
23  
24  import com.eviware.soapui.config.WsaVersionTypeConfig;
25  import com.eviware.soapui.impl.wsdl.WsdlInterface;
26  import com.eviware.soapui.impl.wsdl.support.BindingImporter;
27  import com.eviware.soapui.impl.wsdl.support.wsdl.WsdlUtils;
28  
29  public abstract class AbstractSoapBindingImporter implements BindingImporter
30  {
31  
32  	protected static final class BindingOperationComparator implements Comparator<BindingOperation>
33  		{
34  			public int compare(BindingOperation o1, BindingOperation o2)
35  			{
36  			   return Collator.getInstance().compare( o1.getOperation().getName(), o2.getOperation().getName() );
37  			}
38  		}
39  
40  	protected void initWsAddressing(Binding binding, WsdlInterface iface, Definition def) throws Exception
41  	{
42  	   	iface.setWsaVersion(WsdlUtils.getUsingAddressing(binding, def));
43  	   	if (iface.getWsaVersion().equals(WsaVersionTypeConfig.NONE.toString()))
44  			{
45  				iface.processPolicy(WsdlUtils.getAttachedPolicy(binding, def));
46  			}
47  	}
48  
49  	public AbstractSoapBindingImporter()
50  	{
51  		super();
52  	}
53  
54  }