I'm doing a tutorial at and can't get the SOAPConstants.DYNAMIC_SOAP_PROTOCOL (line 1) to be recognized (also it says that "The method addBodyElement(Name) in the type SOAPBody is not applicable for the arguments
(QName)" (line 7), "The method addChildElement(Name) in the type SOAPElement is not applicable for the arguments
(QName)" (line 8), AND "Syntax error on token ""SUNW"", delete this token" (line 9). Pretty frustrating trying to learn when you can even get the tutorials to work!!!!
(I realize that I might have overdone the imports, but I was desparate)! Once again, thanks for your time.
I have this:
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.namespace.QName;
import javax.xml.*;
public class OrderToCash {
1 MessageFactory factory = MessageFactory.newInstance(SOAPConstants.DYNAMIC_SOAP_PROTOCOL);
2 SOAPMessage message = factory.createMessage();
3 SOAPPart soapPart = message.getSOAPPart();
4 SOAPHeader header = message.getSOAPHeader();
5 SOAPBody body = message.getSOAPBody();
6 QName bodyName = new QName(" "GetLastTradePrice", "m");
7 SOAPBodyElement bodyElement = body.addBodyElement(bodyName);
8 QName name = new QName("symbol");
SOAPElement symbol = bodyElement.addChildElement(name);
9 symbol.addTextNode("SUNW");
(QName)" (line 7), "The method addChildElement(Name) in the type SOAPElement is not applicable for the arguments
(QName)" (line 8), AND "Syntax error on token ""SUNW"", delete this token" (line 9). Pretty frustrating trying to learn when you can even get the tutorials to work!!!!
(I realize that I might have overdone the imports, but I was desparate)! Once again, thanks for your time.
I have this:
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.namespace.QName;
import javax.xml.*;
public class OrderToCash {
1 MessageFactory factory = MessageFactory.newInstance(SOAPConstants.DYNAMIC_SOAP_PROTOCOL);
2 SOAPMessage message = factory.createMessage();
3 SOAPPart soapPart = message.getSOAPPart();
4 SOAPHeader header = message.getSOAPHeader();
5 SOAPBody body = message.getSOAPBody();
6 QName bodyName = new QName(" "GetLastTradePrice", "m");
7 SOAPBodyElement bodyElement = body.addBodyElement(bodyName);
8 QName name = new QName("symbol");
SOAPElement symbol = bodyElement.addChildElement(name);
9 symbol.addTextNode("SUNW");