protected void initializeParameter(MessagePartInfo part, Class<?> rawClass, Type type) { if (implInfo.isWebServiceProvider()) { part.setTypeQName(Constants.XSD_ANYTYPE); part.setTypeClass(rawClass); return; } super.initializeParameter(part, rawClass, type); }
private void addInvokeOperation(boolean oneWay) { String name = oneWay ? INVOKE_ONEWAY_NAME : INVOKE_NAME; ServiceInfo info = client.getEndpoint().getEndpointInfo().getService(); OperationInfo opInfo = info.getInterface() .addOperation(oneWay ? INVOKE_ONEWAY_QNAME : INVOKE_QNAME); MessageInfo mInfo = opInfo.createMessage(new QName(DISPATCH_NS, name + "Request"), Type.INPUT); opInfo.setInput(name + "Request", mInfo); MessagePartInfo mpi = mInfo.addMessagePart("parameters"); if (context == null) { mpi.setTypeClass(cl); } mpi.setElement(true); if (!oneWay) { mInfo = opInfo.createMessage(new QName(DISPATCH_NS, name + "Response"), Type.OUTPUT); opInfo.setOutput(name + "Response", mInfo); mpi = mInfo.addMessagePart("parameters"); mpi.setElement(true); if (context == null) { mpi.setTypeClass(cl); } } for (BindingInfo bind : client.getEndpoint().getEndpointInfo().getService().getBindings()) { BindingOperationInfo bo = new BindingOperationInfo(bind, opInfo); bind.addOperation(bo); } }
void initializeWrapping(OperationInfo o, Method selected) { Class<?> responseWrapper = getResponseWrapper(selected); if (responseWrapper != null) { o.getOutput().getFirstMessagePart().setTypeClass(responseWrapper); } if (getResponseWrapperClassName(selected) != null) { o.getOutput().getFirstMessagePart().setProperty("RESPONSE.WRAPPER.CLASSNAME", getResponseWrapperClassName(selected)); } Class<?> requestWrapper = getRequestWrapper(selected); if (requestWrapper != null) { o.getInput().getFirstMessagePart().setTypeClass(requestWrapper); } if (getRequestWrapperClassName(selected) != null) { o.getInput().getFirstMessagePart().setProperty("REQUEST.WRAPPER.CLASSNAME", getRequestWrapperClassName(selected)); } }
def = findClass(className, method.getDeclaringClass()); } else { wrapperPart.setTypeClass(def); wrapperBeans.add(def); return; wrapperPart.setTypeClass(clz); wrapperBeans.add(clz);
inf.setTypeClass(c); break; inf.setTypeClass(c); break; MessagePartInfo mpi = mInfo.addMessagePart("parameters"); mpi.setElement(true); mpi.setTypeClass(c); mpi.setTypeQName(Constants.XSD_ANYTYPE); mpi = mInfo.addMessagePart("parameters"); mpi.setElement(true); mpi.setTypeClass(c); mpi.setTypeQName(Constants.XSD_ANYTYPE);
protected void resetPartTypeClass(MessageInfo msgInfo) { if (msgInfo != null) { int size = msgInfo.getMessageParts().size(); for (int x = 0; x < size; x++) { //last part can be streamed, others need DOM parsing if (x < (size - 1)) { msgInfo.getMessageParts().get(x).setTypeClass(allowStreaming ? DOMSource.class : null); } else { msgInfo.getMessageParts().get(x).setTypeClass(allowStreaming ? Source.class : null); } } } }
protected void resetPartTypeClass(BindingMessageInfo bmi) { if (bmi != null) { int size = bmi.getMessageParts().size(); for (int x = 0; x < size; x++) { //last part can be streamed, others need DOM parsing if (x < (size - 1)) { bmi.getMessageParts().get(x).setTypeClass(allowStreaming ? DOMSource.class : null); } else { bmi.getMessageParts().get(x).setTypeClass(allowStreaming ? Source.class : null); } } } } protected void resetPartTypeClass(MessageInfo msgInfo) {
protected void resetPartTypeClass(MessageInfo msgInfo) { if (msgInfo != null) { int size = msgInfo.getMessageParts().size(); for (int x = 0; x < size; x++) { msgInfo.getMessageParts().get(x).setTypeClass(Source.class); } } }
protected void resetPartTypeClass(BindingMessageInfo bmi) { if (bmi != null) { int size = bmi.getMessageParts().size(); for (int x = 0; x < size; x++) { bmi.getMessageParts().get(x).setTypeClass(Source.class); } } } protected void resetPartTypeClass(MessageInfo msgInfo) {
protected void initializeParameter(MessagePartInfo part, Class<?> rawClass, Type type) { if (implInfo.isWebServiceProvider()) { part.setTypeQName(Constants.XSD_ANYTYPE); part.setTypeClass(rawClass); return; } super.initializeParameter(part, rawClass, type); }
protected FaultInfo addFault(final InterfaceInfo service, final OperationInfo op, Class<?> exClass) { Class<?> beanClass = getBeanClass(exClass); if (beanClass == null) { return null; } String faultMsgName = null; for (AbstractServiceConfiguration c : serviceConfigurations) { faultMsgName = c.getFaultMessageName(op, exClass, beanClass); if (faultMsgName != null) { break; } } if (faultMsgName == null) { faultMsgName = exClass.getSimpleName(); } QName faultName = getFaultName(service, op, exClass, beanClass); FaultInfo fi = op.addFault(new QName(op.getName().getNamespaceURI(), faultMsgName), new QName(op.getName().getNamespaceURI(), faultMsgName)); fi.setProperty(Class.class.getName(), exClass); fi.setProperty("elementName", faultName); MessagePartInfo mpi = fi.addMessagePart(new QName(faultName.getNamespaceURI(), exClass.getSimpleName())); mpi.setElementQName(faultName); mpi.setTypeClass(beanClass); sendEvent(Event.OPERATIONINFO_FAULT, op, exClass, fi); return fi; }
protected FaultInfo addFault(final InterfaceInfo service, final OperationInfo op, Class<?> exClass) { Class<?> beanClass = getBeanClass(exClass); if (beanClass == null) { return null; } String faultMsgName = null; for (AbstractServiceConfiguration c : serviceConfigurations) { faultMsgName = c.getFaultMessageName(op, exClass, beanClass); if (faultMsgName != null) { break; } } if (faultMsgName == null) { faultMsgName = exClass.getSimpleName(); } QName faultName = getFaultName(service, op, exClass, beanClass); FaultInfo fi = op.addFault(new QName(op.getName().getNamespaceURI(), faultMsgName), new QName(op.getName().getNamespaceURI(), faultMsgName)); fi.setProperty(Class.class.getName(), exClass); fi.setProperty("elementName", faultName); MessagePartInfo mpi = fi.addMessagePart(new QName(faultName.getNamespaceURI(), exClass.getSimpleName())); mpi.setElementQName(faultName); mpi.setTypeClass(beanClass); sendEvent(Event.OPERATIONINFO_FAULT, op, exClass, fi); return fi; }
protected FaultInfo addFault(final InterfaceInfo service, final OperationInfo op, Class<?> exClass) { Class<?> beanClass = getBeanClass(exClass); if (beanClass == null) { return null; } String faultMsgName = null; for (AbstractServiceConfiguration c : serviceConfigurations) { faultMsgName = c.getFaultMessageName(op, exClass, beanClass); if (faultMsgName != null) { break; } } if (faultMsgName == null) { faultMsgName = exClass.getSimpleName(); } QName faultName = getFaultName(service, op, exClass, beanClass); FaultInfo fi = op.addFault(new QName(op.getName().getNamespaceURI(), faultMsgName), new QName(op.getName().getNamespaceURI(), faultMsgName)); fi.setProperty(Class.class.getName(), exClass); fi.setProperty("elementName", faultName); MessagePartInfo mpi = fi.addMessagePart(new QName(faultName.getNamespaceURI(), exClass.getSimpleName())); mpi.setElementQName(faultName); mpi.setTypeClass(beanClass); sendEvent(Event.OPERATIONINFO_FAULT, op, exClass, fi); return fi; }
private void createMessagePartInfo(OperationInfo oi, Class<?> type, QName qname, Method m, boolean input) { if (type == void.class || Source.class.isAssignableFrom(type)) { return; } if (InjectionUtils.isPrimitive(type) || Response.class == type) { return; } QName mName = new QName(qname.getNamespaceURI(), (input ? "in" : "out") + m.getName()); MessageInfo ms = oi.createMessage(mName, input ? MessageInfo.Type.INPUT : MessageInfo.Type.OUTPUT); if (input) { oi.setInput("in", ms); } else { oi.setOutput("out", ms); } QName mpQName = JAXRSUtils.getClassQName(type); MessagePartInfo mpi = ms.addMessagePart(mpQName); mpi.setConcreteName(mpQName); mpi.setTypeQName(mpQName); mpi.setTypeClass(type); }
private void createMessagePartInfo(OperationInfo oi, Class<?> type, QName qname, Method m, boolean input) { if (type == void.class || Source.class.isAssignableFrom(type)) { return; } if (InjectionUtils.isPrimitive(type) || Response.class == type) { return; } QName mName = new QName(qname.getNamespaceURI(), (input ? "in" : "out") + m.getName()); MessageInfo ms = oi.createMessage(mName, input ? MessageInfo.Type.INPUT : MessageInfo.Type.OUTPUT); if (input) { oi.setInput("in", ms); } else { oi.setOutput("out", ms); } QName mpQName = JAXRSUtils.getClassQName(type); MessagePartInfo mpi = ms.addMessagePart(mpQName); mpi.setConcreteName(mpQName); mpi.setTypeQName(mpQName); mpi.setTypeClass(type); }
void buildCloseSequenceOperationInfo(InterfaceInfo ii, ProtocolVariation protocol) { OperationInfo operationInfo = null; MessageInfo messageInfo = null; RMConstants consts = protocol.getConstants(); operationInfo = ii.addOperation(consts.getCloseSequenceOperationName()); messageInfo = operationInfo.createMessage(consts.getCloseSequenceOperationName(), MessageInfo.Type.INPUT); operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo); if (RM11Constants.NAMESPACE_URI.equals(protocol.getWSRMNamespace())) { MessagePartInfo partInfo = messageInfo.addMessagePart(CLOSE_PART_NAME); partInfo.setElementQName(consts.getCloseSequenceOperationName()); partInfo.setElement(true); partInfo.setTypeClass(CloseSequenceType.class); messageInfo = operationInfo.createMessage( RM11Constants.INSTANCE.getCloseSequenceResponseOperationName(), MessageInfo.Type.OUTPUT); operationInfo.setOutput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(CLOSE_RESPONSE_PART_NAME); partInfo.setElementQName(RM11Constants.INSTANCE.getCloseSequenceResponseOperationName()); partInfo.setElement(true); partInfo.setTypeClass(CloseSequenceResponseType.class); partInfo.setIndex(0); } }
void initializeWrapping(OperationInfo o, Method selected) { Class<?> responseWrapper = getResponseWrapper(selected); if (responseWrapper != null) { o.getOutput().getFirstMessagePart().setTypeClass(responseWrapper); } if (getResponseWrapperClassName(selected) != null) { o.getOutput().getFirstMessagePart().setProperty("RESPONSE.WRAPPER.CLASSNAME", getResponseWrapperClassName(selected)); } Class<?> requestWrapper = getRequestWrapper(selected); if (requestWrapper != null) { o.getInput().getFirstMessagePart().setTypeClass(requestWrapper); } if (getRequestWrapperClassName(selected) != null) { o.getInput().getFirstMessagePart().setProperty("REQUEST.WRAPPER.CLASSNAME", getRequestWrapperClassName(selected)); } }
private void addInvokeOperation(boolean oneWay) { String name = oneWay ? INVOKE_ONEWAY_NAME : INVOKE_NAME; ServiceInfo info = client.getEndpoint().getEndpointInfo().getService(); OperationInfo opInfo = info.getInterface() .addOperation(oneWay ? INVOKE_ONEWAY_QNAME : INVOKE_QNAME); MessageInfo mInfo = opInfo.createMessage(new QName(DISPATCH_NS, name + "Request"), Type.INPUT); opInfo.setInput(name + "Request", mInfo); MessagePartInfo mpi = mInfo.addMessagePart("parameters"); if (context == null) { mpi.setTypeClass(cl); } mpi.setElement(true); if (!oneWay) { mInfo = opInfo.createMessage(new QName(DISPATCH_NS, name + "Response"), Type.OUTPUT); opInfo.setOutput(name + "Response", mInfo); mpi = mInfo.addMessagePart("parameters"); mpi.setElement(true); if (context == null) { mpi.setTypeClass(cl); } } for (BindingInfo bind : client.getEndpoint().getEndpointInfo().getService().getBindings()) { BindingOperationInfo bo = new BindingOperationInfo(bind, opInfo); bind.addOperation(bo); } }
partInfo.setElementQName(consts.getTerminateSequenceOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getTerminateSequenceType()); if (RM11Constants.NAMESPACE_URI.equals(protocol.getWSRMNamespace())) { messageInfo = operationInfo.createMessage( partInfo.setElementQName(RM11Constants.INSTANCE.getTerminateSequenceResponseOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getTerminateSequenceResponseType()); partInfo.setIndex(0); partInfo.setElementQName(consts.getTerminateSequenceOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getTerminateSequenceType());
partInfo.setElementQName(consts.getCreateSequenceOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getCreateSequenceType()); partInfo.setElementQName(consts.getCreateSequenceResponseOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getCreateSequenceResponseType()); partInfo.setIndex(0); partInfo.setElementQName(consts.getCreateSequenceOnewayOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getCreateSequenceType()); partInfo.setElementQName(consts.getCreateSequenceResponseOnewayOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getCreateSequenceResponseType());