1 package test.wsdl.qnameser; 2 3 4 5 import javax.xml.namespace.QName ; 6 7 8 9 import java.rmi.RemoteException ; 10 11 12 13 public class PlanService { 14 15 16 17 public static final QName Q_1 = new QName ("http://foo", "1"); 18 19 public static final QName Q_2 = new QName ("http://tempuri.org/", "2"); 20 21 public static final QName Q_3 = new QName ("", "3"); 22 23 24 25 public GetPlanResponse getPlan(QName parameters) 26 27 throws RemoteException { 28 29 String localName = parameters.getLocalPart(); 30 31 String namespace = null; 32 33 if (localName.equals(Q_1.getLocalPart())) { 34 35 namespace = Q_1.getNamespaceURI(); 36 37 } else if (localName.equals(Q_2.getLocalPart())) { 38 39 namespace = Q_2.getNamespaceURI(); 40 41 } else if (localName.equals(Q_3.getLocalPart())) { 42 43 namespace = Q_3.getNamespaceURI(); 44 45 } else { 46 47 throw new RemoteException ("invalid localname:" + localName); 48 49 } 50 51 52 53 if (!parameters.getNamespaceURI().equals(namespace)) { 54 55 throw new RemoteException ("Expected: " + namespace + " but got: " + 56 57 parameters.getNamespaceURI()); 58 59 } 60 61 62 63 return new GetPlanResponse(); 64 65 } 66 67 68 69 public GetMPlanResponse getMPlan(GetMPlan in) 70 71 throws RemoteException { 72 73 QName [] list = in.getList(); 74 75 for (int i=0;i<list.length;i++) { 76 77 getPlan(list[i]); 78 79 } 80 81 return new GetMPlanResponse(); 82 83 } 84 85 86 87 } 88 89 | Popular Tags |