请问如何处理一个soap?
请问如何处理下面这个程序发送的soap?
import javax.xml.soap.*;
import javax.xml.messaging.*;
public class JAXM2
{
public static void main(String[] args)
{
System.out.println("Hello World!");
try
{
//create soap connection
SOAPConnectionFactory scFactory=SOAPConnectionFactory.newInstance();
SOAPConnection con=scFactory.createConnection();
//create soap message
MessageFactory factory=MessageFactory.newInstance();
SOAPMessage message=factory.createMessage();
//accessing Elements of a Message
//SOAPPart==>SOAPEnvelop==>SOAPHeader & SOAPBody
SOAPPart soapPart=message.getSOAPPart();
SOAPEnvelope envelope=soapPart.getEnvelope();
SOAPHeader header=envelope.getHeader();
SOAPBody body=envelope.getBody();
//create soap message body info.
Name bodyName=envelope.createName("Half-Life","CS","http://www.pku.edu.cn");
SOAPBodyElement gltp=body.addBodyElement(bodyName);
Name name = envelope.createName("command");
SOAPElement symbol = gltp.addChildElement(name);
symbol.addTextNode("fire in the hole!");
//sending a Message
//receiver program is http://hostname:8080/jaxm-simple/receiver2
URLEndpoint endpoint=new URLEndpoint("http://localhost:8080/jaxm-simple/receiver2");
SOAPMessage response=con.call(message, endpoint);
response.writeTo(System.out);
con.close();
}
catch(Exception fe)
{
System.out.println(fe.getMessage());
}
}
}
想知道响应的server(http://hostname:8080/jaxm-simple/receiver2)怎么写?把fire in the hole!改成go go !并发回一个soap包