Debian Codegraph @

test/wsdl/qnameser/PlanService.java

raw
1 package test.wsdl.qnameser;
2
3 import javax.xml.namespace.QName;
4
5 import java.rmi.RemoteException;
6
7 public class PlanService {
8
9 public static final QName Q_1 = new QName("http://foo", "1");
10 public static final QName Q_2 = new QName("http://tempuri.org/", "2");
11 public static final QName Q_3 = new QName("", "3");
12
13 public GetPlanResponse getPlan(QName parameters)
14 throws RemoteException {
15 String localName = parameters.getLocalPart();
16 String namespace = null;
17 if (localName.equals(Q_1.getLocalPart())) {
18 namespace = Q_1.getNamespaceURI();
19 } else if (localName.equals(Q_2.getLocalPart())) {
20 namespace = Q_2.getNamespaceURI();
21 } else if (localName.equals(Q_3.getLocalPart())) {
22 namespace = Q_3.getNamespaceURI();
23 } else {
24 throw new RemoteException("invalid localname:" + localName);
25 }
26
27 if (!parameters.getNamespaceURI().equals(namespace)) {
28 throw new RemoteException("Expected: " + namespace + " but got: " +
29 parameters.getNamespaceURI());
30 }
31
32 return new GetPlanResponse();
33 }
34
35 public GetMPlanResponse getMPlan(GetMPlan in)
36 throws RemoteException {
37 QName [] list = in.getList();
38 for (int i=0;i<list.length;i++) {
39 getPlan(list[i]);
40 }
41 return new GetMPlanResponse();
42 }
43
44 }