Java-如何根据Soap请求发送字节数组?

Java-如何根据Soap请求发送字节数组?,java,soap,Java,Soap,我想知道是否可以通过Soap请求发送字节[]。它是?如果是这样的话,我如何使用javax.xml.soap.*实现它 我只知道如何发送字符串 private static SOAPMessage createSOAPRequest() throws Exception { MessageFactory messageFactory = MessageFactory.newInstance(); SOAPMessage soapMessage = messageFactory.cr

我想知道是否可以通过Soap请求发送字节[]。它是?如果是这样的话,我如何使用javax.xml.soap.*实现它

我只知道如何发送字符串

private static SOAPMessage createSOAPRequest() throws Exception {
    MessageFactory messageFactory = MessageFactory.newInstance();
    SOAPMessage soapMessage = messageFactory.createMessage();
    SOAPPart soapPart = soapMessage.getSOAPPart();


    SOAPEnvelope envelope = soapPart.getEnvelope();
    envelope.addNamespaceDeclaration("ws", "http://www.qwert.com.ar/");

    SOAPBody soapBody = envelope.getBody();
    SOAPElement soapBodyElem = soapBody.addChildElement("ronkMotor", "ws");
    SOAPElement soapBodyElem1 = soapBodyElem.addChildElement("file");

    //How to add byte[] here?
    //soapBodyElem1.addTextNode("mutantninja@gmail.com");

    MimeHeaders headers = soapMessage.getMimeHeaders();
    headers.addHeader("SOAPAction", "ronkNow");

    soapMessage.saveChanges();

    soapMessage.writeTo(System.out);

    return soapMessage;
}
ws签名是:

@WebMethod(operationName = "ronkNow", action = "urn:rs")
Response ronkNow(@WebParam(name = "file")byte[] data);

那你就不能把字节数组转换成字符串吗


否,我正在尝试在我的公司上模拟一些东西,我需要使用byte[]。可能吗?你解决过这个问题吗?我也有同样的问题。。。