1 /* |
1 /* |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
93 this.javaMethod = method; |
93 this.javaMethod = method; |
94 |
94 |
95 {// prepare objects for creating messages |
95 {// prepare objects for creating messages |
96 List<ParameterImpl> rp = method.getRequestParameters(); |
96 List<ParameterImpl> rp = method.getRequestParameters(); |
97 |
97 |
98 BodyBuilder bodyBuilder = null; |
98 BodyBuilder tmpBodyBuilder = null; |
99 List<MessageFiller> fillers = new ArrayList<MessageFiller>(); |
99 List<MessageFiller> fillers = new ArrayList<MessageFiller>(); |
100 |
100 |
101 for (ParameterImpl param : rp) { |
101 for (ParameterImpl param : rp) { |
102 ValueGetter getter = getValueGetterFactory().get(param); |
102 ValueGetter getter = getValueGetterFactory().get(param); |
103 |
103 |
104 switch(param.getInBinding().kind) { |
104 switch(param.getInBinding().kind) { |
105 case BODY: |
105 case BODY: |
106 if(param.isWrapperStyle()) { |
106 if(param.isWrapperStyle()) { |
107 if(param.getParent().getBinding().isRpcLit()) |
107 if(param.getParent().getBinding().isRpcLit()) |
108 bodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory()); |
108 tmpBodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory()); |
109 else |
109 else |
110 bodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory()); |
110 tmpBodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory()); |
111 } else { |
111 } else { |
112 bodyBuilder = new BodyBuilder.Bare(param, owner.soapVersion, getter); |
112 tmpBodyBuilder = new BodyBuilder.Bare(param, owner.soapVersion, getter); |
113 } |
113 } |
114 break; |
114 break; |
115 case HEADER: |
115 case HEADER: |
116 fillers.add(new MessageFiller.Header( |
116 fillers.add(new MessageFiller.Header( |
117 param.getIndex(), |
117 param.getIndex(), |
126 default: |
126 default: |
127 throw new AssertionError(); // impossible |
127 throw new AssertionError(); // impossible |
128 } |
128 } |
129 } |
129 } |
130 |
130 |
131 if(bodyBuilder==null) { |
131 if(tmpBodyBuilder==null) { |
132 // no parameter binds to body. we create an empty message |
132 // no parameter binds to body. we create an empty message |
133 switch(owner.soapVersion) { |
133 switch(owner.soapVersion) { |
134 case SOAP_11: |
134 case SOAP_11: |
135 bodyBuilder = BodyBuilder.EMPTY_SOAP11; |
135 tmpBodyBuilder = BodyBuilder.EMPTY_SOAP11; |
136 break; |
136 break; |
137 case SOAP_12: |
137 case SOAP_12: |
138 bodyBuilder = BodyBuilder.EMPTY_SOAP12; |
138 tmpBodyBuilder = BodyBuilder.EMPTY_SOAP12; |
139 break; |
139 break; |
140 default: |
140 default: |
141 throw new AssertionError(); |
141 throw new AssertionError(); |
142 } |
142 } |
143 } |
143 } |
144 |
144 |
145 this.bodyBuilder = bodyBuilder; |
145 this.bodyBuilder = tmpBodyBuilder; |
146 this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]); |
146 this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]); |
147 } |
147 } |
148 |
148 |
149 this.isOneWay = method.getMEP().isOneWay(); |
149 this.isOneWay = method.getMEP().isOneWay(); |
150 } |
150 } |