Java Code Examples for org.apache.cxf.service.model.MessagePartInfo#setElementQName()
The following examples show how to use
org.apache.cxf.service.model.MessagePartInfo#setElementQName() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: STSUtils.java From steady with Apache License 2.0 | 6 votes |
private static OperationInfo addCancelOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "CancelSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("CancelSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "CancelSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("CancelSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); mpi.setElementQName(new QName(namespace, "CancelSecurityTokenResponse")); return oi; }
Example 2
Source File: XMLStreamDataWriterTest.java From cxf with Apache License 2.0 | 6 votes |
@Test public void testSetProperty() throws Exception { MyCustomHandler handler = new MyCustomHandler(); DataWriterImpl<XMLStreamWriter> dw = newDataWriter(handler); // Write Stuff TradePriceData val = new TradePriceData(); val.setTickerSymbol("This is a symbol"); val.setTickerPrice(1.0f); QName elName = new QName("http://apache.org/hello_world_doc_lit_bare/types", "inout"); MessagePartInfo part = new MessagePartInfo(elName, null); part.setElement(true); part.setElementQName(elName); dw.write(val, part, streamWriter); streamWriter.flush(); // Test MyCustomHandler assertTrue(handler.getUsed()); }
Example 3
Source File: XMLStreamDataReaderTest.java From cxf with Apache License 2.0 | 6 votes |
@Test public void testReadBare() throws Exception { JAXBDataBinding db = getDataBinding(TradePriceData.class); reader = getTestReader("../resources/sayHiDocLitBareReq.xml"); assertNotNull(reader); DataReader<XMLStreamReader> dr = db.createReader(XMLStreamReader.class); assertNotNull(dr); QName elName = new QName("http://apache.org/hello_world_doc_lit_bare/types", "inout"); MessagePartInfo part = new MessagePartInfo(elName, null); part.setElement(true); part.setElementQName(elName); part.setTypeClass(TradePriceData.class); Object val = dr.read(part, reader); assertNotNull(val); assertTrue(val instanceof TradePriceData); assertEquals("CXF", ((TradePriceData)val).getTickerSymbol()); assertEquals(Float.valueOf(1.0f), new Float(((TradePriceData)val).getTickerPrice())); }
Example 4
Source File: STSUtils.java From cxf with Apache License 2.0 | 6 votes |
private static OperationInfo addRenewOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "RenewSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "RenewSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("RenewSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "RequestSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "RenewSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("RenewSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); if (WST_NS_05_02.equals(namespace)) { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse")); } else { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection")); } return oi; }
Example 5
Source File: JAXBEncoderDecoderTest.java From cxf with Apache License 2.0 | 6 votes |
@Test public void testMarshalRPCLit() throws Exception { QName elName = new QName("http://test_jaxb_marshall", "in"); MessagePartInfo part = new MessagePartInfo(elName, null); part.setElement(true); part.setElementQName(elName); Document doc = DOMUtils.createDocument(); Element elNode = doc.createElementNS(elName.getNamespaceURI(), elName.getLocalPart()); JAXBEncoderDecoder.marshall(context.createMarshaller(), new String("TestSOAPMessage"), part, elNode); assertEquals("TestSOAPMessage", elNode.getFirstChild().getFirstChild().getNodeValue()); }
Example 6
Source File: STSUtils.java From cxf with Apache License 2.0 | 6 votes |
private static OperationInfo addIssueOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "RequestSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("RequestSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "RequestSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("RequestSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); if (WST_NS_05_02.equals(namespace)) { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse")); } else { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection")); } return oi; }
Example 7
Source File: STSUtils.java From cxf with Apache License 2.0 | 6 votes |
private static OperationInfo addCancelOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "CancelSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("CancelSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "RequestSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("CancelSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); if (WST_NS_05_02.equals(namespace)) { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse")); } else { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection")); } return oi; }
Example 8
Source File: STSUtils.java From steady with Apache License 2.0 | 6 votes |
private static OperationInfo addCancelOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "CancelSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("CancelSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "CancelSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("CancelSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); mpi.setElementQName(new QName(namespace, "CancelSecurityTokenResponse")); return oi; }
Example 9
Source File: STSUtils.java From steady with Apache License 2.0 | 6 votes |
private static OperationInfo addIssueOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "RequestSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("RequestSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "RequestSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("RequestSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); if (WST_NS_05_02.equals(namespace)) { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse")); } else { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection")); } return oi; }
Example 10
Source File: STSUtils.java From steady with Apache License 2.0 | 6 votes |
private static OperationInfo addCancelOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "CancelSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("CancelSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "CancelSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("CancelSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); mpi.setElementQName(new QName(namespace, "CancelSecurityTokenResponse")); return oi; }
Example 11
Source File: STSUtils.java From steady with Apache License 2.0 | 6 votes |
private static OperationInfo addIssueOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "RequestSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("RequestSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "RequestSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("RequestSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); if (WST_NS_05_02.equals(namespace)) { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse")); } else { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection")); } return oi; }
Example 12
Source File: JAXBEncoderDecoderTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void testCustomNamespaces() throws Exception { Map<String, String> mapper = new HashMap<>(); mapper.put("http://apache.org/hello_world_soap_http/types", "Omnia"); mapper.put("http://cxf.apache.org/jaxb_form", "Gallia"); ObjectWithQualifiedElementElement testObject = new ObjectWithQualifiedElementElement(); testObject.setString1("twine"); testObject.setString2("cord"); QName elName = new QName(wrapperAnnotation.targetNamespace(), wrapperAnnotation.localName()); MessagePartInfo part = new MessagePartInfo(elName, null); part.setElement(true); part.setElementQName(elName); StringWriter stringWriter = new StringWriter(); XMLOutputFactory opFactory = XMLOutputFactory.newInstance(); opFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE); XMLEventWriter writer = opFactory.createXMLEventWriter(stringWriter); Marshaller m = context.createMarshaller(); JAXBUtils.setNamespaceMapper(mapper, m); JAXBEncoderDecoder.marshall(m, testObject, part, writer); writer.flush(); writer.close(); String xmlResult = stringWriter.toString(); // the following is a bit of a crock, but, to tell the truth, this test case most exists // so that it could be examined inside the debugger to see how JAXB works. assertTrue(xmlResult.contains("Gallia:string2")); }
Example 13
Source File: JAXBEncoderDecoderTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void testMarshallIntoStaxStreamWriter() throws Exception { GreetMe obj = new GreetMe(); obj.setRequestType("Hello"); QName elName = new QName(wrapperAnnotation.targetNamespace(), wrapperAnnotation.localName()); MessagePartInfo part = new MessagePartInfo(elName, null); part.setElement(true); part.setElementQName(elName); ByteArrayOutputStream baos = new ByteArrayOutputStream(); XMLOutputFactory opFactory = XMLOutputFactory.newInstance(); opFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE); FixNamespacesXMLStreamWriter writer = new FixNamespacesXMLStreamWriter(opFactory.createXMLStreamWriter(baos)); assertNull(writer.getMarshaller()); Marshaller m = context.createMarshaller(); JAXBEncoderDecoder.marshall(m, obj, part, writer); assertEquals(m, writer.getMarshaller()); writer.flush(); writer.close(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); XMLInputFactory ipFactory = XMLInputFactory.newInstance(); XMLEventReader reader = ipFactory.createXMLEventReader(bais); Unmarshaller um = context.createUnmarshaller(); Object val = um.unmarshal(reader, GreetMe.class); assertTrue(val instanceof JAXBElement); val = ((JAXBElement<?>)val).getValue(); assertTrue(val instanceof GreetMe); assertEquals(obj.getRequestType(), ((GreetMe)val).getRequestType()); }
Example 14
Source File: XMLStreamDataWriterTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void testWriteBare() throws Exception { JAXBDataBinding db = getTestWriterFactory(TradePriceData.class); DataWriter<XMLStreamWriter> dw = db.createWriter(XMLStreamWriter.class); assertNotNull(dw); TradePriceData val = new TradePriceData(); val.setTickerSymbol("This is a symbol"); val.setTickerPrice(1.0f); QName elName = new QName("http://apache.org/hello_world_doc_lit_bare/types", "inout"); MessagePartInfo part = new MessagePartInfo(elName, null); part.setElement(true); part.setElementQName(elName); dw.write(val, part, streamWriter); streamWriter.flush(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); XMLStreamReader xr = inFactory.createXMLStreamReader(bais); DepthXMLStreamReader reader = new DepthXMLStreamReader(xr); StaxUtils.toNextElement(reader); assertEquals(new QName("http://apache.org/hello_world_doc_lit_bare/types", "inout"), reader.getName()); StaxUtils.nextEvent(reader); StaxUtils.toNextElement(reader); assertEquals(new QName("http://apache.org/hello_world_doc_lit_bare/types", "tickerSymbol"), reader.getName()); StaxUtils.nextEvent(reader); StaxUtils.toNextText(reader); assertEquals("This is a symbol", reader.getText()); }
Example 15
Source File: ReflectionServiceFactoryBean.java From cxf with Apache License 2.0 | 5 votes |
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; }
Example 16
Source File: XMLStreamDataWriterTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void testWriteRPCLit2() throws Exception { JAXBDataBinding db = getTestWriterFactory(MyComplexStruct.class); DataWriter<XMLStreamWriter> dw = db.createWriter(XMLStreamWriter.class); assertNotNull(dw); MyComplexStruct val = new MyComplexStruct(); val.setElem1("This is element 1"); val.setElem2("This is element 2"); val.setElem3(1); QName elName = new QName("http://apache.org/hello_world_rpclit/types", "in"); MessagePartInfo part = new MessagePartInfo(elName, null); part.setElement(true); part.setElementQName(elName); dw.write(val, part, streamWriter); streamWriter.flush(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); XMLStreamReader xr = inFactory.createXMLStreamReader(bais); DepthXMLStreamReader reader = new DepthXMLStreamReader(xr); StaxUtils.toNextElement(reader); assertEquals(new QName("http://apache.org/hello_world_rpclit/types", "in"), reader.getName()); StaxUtils.nextEvent(reader); StaxUtils.toNextElement(reader); assertEquals(new QName("http://apache.org/hello_world_rpclit/types", "elem1"), reader.getName()); StaxUtils.nextEvent(reader); StaxUtils.toNextText(reader); assertEquals("This is element 1", reader.getText()); }
Example 17
Source File: RMEndpoint.java From cxf with Apache License 2.0 | 5 votes |
void buildTerminateSequenceOperationInfo(InterfaceInfo ii, ProtocolVariation protocol) { OperationInfo operationInfo = null; MessagePartInfo partInfo = null; MessageInfo messageInfo = null; RMConstants consts = protocol.getConstants(); operationInfo = ii.addOperation(consts.getTerminateSequenceOperationName()); messageInfo = operationInfo.createMessage(consts.getTerminateSequenceOperationName(), MessageInfo.Type.INPUT); operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(TERMINATE_PART_NAME); partInfo.setElementQName(consts.getTerminateSequenceOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getTerminateSequenceType()); if (RM11Constants.NAMESPACE_URI.equals(protocol.getWSRMNamespace())) { messageInfo = operationInfo.createMessage( RM11Constants.INSTANCE.getTerminateSequenceResponseOperationName(), MessageInfo.Type.OUTPUT); operationInfo.setOutput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(TERMINATE_RESPONSE_PART_NAME); partInfo.setElementQName(RM11Constants.INSTANCE.getTerminateSequenceResponseOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getTerminateSequenceResponseType()); partInfo.setIndex(0); } // for the TerminateSequence operation to an anonymous endpoint operationInfo = ii.addOperation(consts.getTerminateSequenceAnonymousOperationName()); messageInfo = operationInfo.createMessage(consts.getTerminateSequenceAnonymousOperationName(), MessageInfo.Type.OUTPUT); operationInfo.setOutput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(TERMINATE_PART_NAME); partInfo.setElementQName(consts.getTerminateSequenceOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getTerminateSequenceType()); }
Example 18
Source File: XMLStreamDataWriterTest.java From cxf with Apache License 2.0 | 5 votes |
@Test public void testWriteRPCLit1() throws Exception { JAXBDataBinding db = getTestWriterFactory(); DataWriter<XMLStreamWriter> dw = db.createWriter(XMLStreamWriter.class); assertNotNull(dw); String val = new String("TESTOUTPUTMESSAGE"); QName elName = new QName("http://apache.org/hello_world_rpclit/types", "in"); MessagePartInfo part = new MessagePartInfo(elName, null); part.setElement(true); part.setElementQName(elName); dw.write(val, part, streamWriter); streamWriter.flush(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); XMLStreamReader xr = inFactory.createXMLStreamReader(bais); DepthXMLStreamReader reader = new DepthXMLStreamReader(xr); StaxUtils.toNextElement(reader); assertEquals(new QName("http://apache.org/hello_world_rpclit/types", "in"), reader.getName()); StaxUtils.nextEvent(reader); StaxUtils.toNextText(reader); assertEquals("TESTOUTPUTMESSAGE", reader.getText()); }
Example 19
Source File: RMEndpoint.java From cxf with Apache License 2.0 | 4 votes |
void buildCreateSequenceOperationInfo(InterfaceInfo ii, ProtocolVariation protocol) { OperationInfo operationInfo = null; MessagePartInfo partInfo = null; MessageInfo messageInfo = null; RMConstants consts = protocol.getConstants(); operationInfo = ii.addOperation(consts.getCreateSequenceOperationName()); messageInfo = operationInfo.createMessage(consts.getCreateSequenceOperationName(), MessageInfo.Type.INPUT); operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(CREATE_PART_NAME); partInfo.setElementQName(consts.getCreateSequenceOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getCreateSequenceType()); messageInfo = operationInfo.createMessage(consts.getCreateSequenceResponseOperationName(), MessageInfo.Type.OUTPUT); operationInfo.setOutput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(CREATE_RESPONSE_PART_NAME); partInfo.setElementQName(consts.getCreateSequenceResponseOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getCreateSequenceResponseType()); partInfo.setIndex(0); operationInfo = ii.addOperation(consts.getCreateSequenceOnewayOperationName()); messageInfo = operationInfo.createMessage(consts.getCreateSequenceOnewayOperationName(), MessageInfo.Type.INPUT); operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(CREATE_PART_NAME); partInfo.setElementQName(consts.getCreateSequenceOnewayOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getCreateSequenceType()); operationInfo = ii.addOperation(consts.getCreateSequenceResponseOnewayOperationName()); messageInfo = operationInfo.createMessage(consts.getCreateSequenceResponseOnewayOperationName(), MessageInfo.Type.INPUT); operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(CREATE_RESPONSE_PART_NAME); partInfo.setElementQName(consts.getCreateSequenceResponseOnewayOperationName()); partInfo.setElement(true); partInfo.setTypeClass(protocol.getCodec().getCreateSequenceResponseType()); }
Example 20
Source File: ReflectionServiceFactoryBean.java From cxf with Apache License 2.0 | 4 votes |
protected void createBareMessage(ServiceInfo serviceInfo, OperationInfo opInfo, boolean isOut) { MessageInfo message = isOut ? opInfo.getOutput() : opInfo.getInput(); final List<MessagePartInfo> messageParts = message.getMessageParts(); if (messageParts.isEmpty()) { return; } Method method = (Method)opInfo.getProperty(METHOD); int paraNumber = 0; for (MessagePartInfo mpi : messageParts) { SchemaInfo schemaInfo = null; XmlSchema schema = null; QName qname = (QName)mpi.getProperty(ELEMENT_NAME); if (messageParts.size() == 1 && qname == null) { qname = !isOut ? getInParameterName(opInfo, method, -1) : getOutParameterName(opInfo, method, -1); if (qname.getLocalPart().startsWith("arg") || qname.getLocalPart().startsWith("return")) { qname = isOut ? new QName(qname.getNamespaceURI(), method.getName() + "Response") : new QName(qname .getNamespaceURI(), method.getName()); } } else if (isOut && messageParts.size() > 1 && qname == null) { while (!isOutParam(method, paraNumber)) { paraNumber++; } qname = getOutParameterName(opInfo, method, paraNumber); } else if (qname == null) { qname = getInParameterName(opInfo, method, paraNumber); } for (SchemaInfo s : serviceInfo.getSchemas()) { if (s.getNamespaceURI().equals(qname.getNamespaceURI())) { schemaInfo = s; break; } } if (schemaInfo == null) { schemaInfo = getOrCreateSchema(serviceInfo, qname.getNamespaceURI(), true); schema = schemaInfo.getSchema(); } else { schema = schemaInfo.getSchema(); if (schema != null && schema.getElementByName(qname) != null) { mpi.setElement(true); mpi.setElementQName(qname); mpi.setXmlSchema(schema.getElementByName(qname)); paraNumber++; continue; } } schemaInfo.setElement(null); //cached element is now invalid XmlSchemaElement el = new XmlSchemaElement(schema, true); el.setName(qname.getLocalPart()); el.setNillable(true); if (mpi.isElement()) { XmlSchemaElement oldEl = (XmlSchemaElement)mpi.getXmlSchema(); if (null != oldEl && !oldEl.getQName().equals(qname)) { el.setSchemaTypeName(oldEl.getSchemaTypeName()); el.setSchemaType(oldEl.getSchemaType()); if (oldEl.getSchemaTypeName() != null) { addImport(schema, oldEl.getSchemaTypeName().getNamespaceURI()); } } mpi.setElement(true); mpi.setXmlSchema(el); mpi.setElementQName(qname); mpi.setConcreteName(qname); continue; } if (null == mpi.getTypeQName() && mpi.getXmlSchema() == null) { throw new ServiceConstructionException(new Message("UNMAPPABLE_PORT_TYPE", LOG, method.getDeclaringClass().getName(), method.getName(), mpi.getName())); } if (mpi.getTypeQName() != null) { el.setSchemaTypeName(mpi.getTypeQName()); } else { el.setSchemaType((XmlSchemaType)mpi.getXmlSchema()); } mpi.setXmlSchema(el); mpi.setConcreteName(qname); if (mpi.getTypeQName() != null) { addImport(schema, mpi.getTypeQName().getNamespaceURI()); } mpi.setElement(true); mpi.setElementQName(qname); paraNumber++; } }