本文整理汇总了Java中com.sun.xml.internal.ws.api.message.saaj.SAAJFactory类的典型用法代码示例。如果您正苦于以下问题:Java SAAJFactory类的具体用法?Java SAAJFactory怎么用?Java SAAJFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SAAJFactory类属于com.sun.xml.internal.ws.api.message.saaj包,在下文中一共展示了SAAJFactory类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toSAAJ
import com.sun.xml.internal.ws.api.message.saaj.SAAJFactory; //导入依赖的package包/类
public Message toSAAJ(Packet p, Boolean inbound) throws SOAPException {
SAAJMessage message = SAAJFactory.read(p);
if (message instanceof MessageWritable)
((MessageWritable) message)
.setMTOMConfiguration(p.getMtomFeature());
if (inbound != null) transportHeaders(p, inbound, message.readAsSOAPMessage());
return message;
}
示例2: updateMessage
import com.sun.xml.internal.ws.api.message.saaj.SAAJFactory; //导入依赖的package包/类
protected void updateMessage() {
//Check if SOAPMessage has changed, if so construct new one,
// Packet are handled through MessageContext
if(soapMsg != null) {
packet.setMessage(SAAJFactory.create(soapMsg));
soapMsg = null;
}
}
示例3: createPacket
import com.sun.xml.internal.ws.api.message.saaj.SAAJFactory; //导入依赖的package包/类
Packet createPacket(SOAPMessage arg) {
Iterator iter = arg.getMimeHeaders().getAllHeaders();
Headers ch = new Headers();
while(iter.hasNext()) {
MimeHeader mh = (MimeHeader) iter.next();
ch.add(mh.getName(), mh.getValue());
}
Packet packet = new Packet(SAAJFactory.create(arg));
packet.invocationProperties.put(MessageContext.HTTP_REQUEST_HEADERS, ch);
return packet;
}
示例4: testResetDefaultNamespaceSAAJ
import com.sun.xml.internal.ws.api.message.saaj.SAAJFactory; //导入依赖的package包/类
@Test
public void testResetDefaultNamespaceSAAJ() throws Exception {
// Create SOAP message from XML string and process it with SAAJ reader
XMLStreamReader envelope = XMLInputFactory.newFactory().createXMLStreamReader(
new StringReader(INPUT_SOAP_MESSAGE));
StreamMessage streamMessage = new StreamMessage(SOAPVersion.SOAP_11,
envelope, null);
SAAJFactory saajFact = new SAAJFactory();
SOAPMessage soapMessage = saajFact.readAsSOAPMessage(SOAPVersion.SOAP_11, streamMessage);
// Check if constructed object model meets local names and namespace expectations
SOAPElement request = (SOAPElement) soapMessage.getSOAPBody().getFirstChild();
// Check top body element name
Assert.assertEquals(request.getLocalName(), "SampleServiceRequest");
// Check top body element namespace
Assert.assertEquals(request.getNamespaceURI(), TEST_NS);
SOAPElement params = (SOAPElement) request.getFirstChild();
// Check first child name
Assert.assertEquals(params.getLocalName(), "RequestParams");
// Check if first child namespace is null
Assert.assertNull(params.getNamespaceURI());
// Check inner elements of the first child
SOAPElement param1 = (SOAPElement) params.getFirstChild();
Assert.assertEquals(param1.getLocalName(), "Param1");
Assert.assertNull(param1.getNamespaceURI());
SOAPElement param2 = (SOAPElement) params.getChildNodes().item(1);
Assert.assertEquals(param2.getLocalName(), "Param2");
Assert.assertNull(param2.getNamespaceURI());
// Check full content of SOAP body
Assert.assertEquals(nodeToText(request), EXPECTED_RESULT);
}
示例5: readAsSOAPMessage
import com.sun.xml.internal.ws.api.message.saaj.SAAJFactory; //导入依赖的package包/类
/**
* Default implementation that uses {@link #writeTo(ContentHandler, ErrorHandler)}
*/
@Override
public SOAPMessage readAsSOAPMessage() throws SOAPException {
return SAAJFactory.read(soapVersion, this);
}
示例6: create
import com.sun.xml.internal.ws.api.message.saaj.SAAJFactory; //导入依赖的package包/类
/**
* Creates a {@link Message} backed by a SAAJ {@link SOAPMessage} object.
*
* <p>
* If the {@link SOAPMessage} contains headers and attachments, this method
* does the right thing.
*
* @param saaj
* The SOAP message to be represented as a {@link Message}.
* Must not be null. Once this method is invoked, the created
* {@link Message} will own the {@link SOAPMessage}, so it shall
* never be touched directly.
*/
public static Message create(SOAPMessage saaj) {
return SAAJFactory.create(saaj);
}