I try it I get the soap xmlStream.
But I try it by java code like this:
import java.io.FileInputStream;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.transform.Transformer;
import javax.xml.transform.Source;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
public class soap
{
public static void main(String args[]){
try{
SOAPConnectionFactory soapConnFactroy=SOAPConnectionFactory.newInstance( );
SOAPConnection connection=soapConnFactroy.createConnection();
MessageFactory messageFactory=MessageFactory.newInstance();
SOAPMessage message=messageFactory.createMessage();
SOAPPart soapPart =message.getSOAPPart();
StreamSource ss = new StreamSource(new FileInputStream("xml.msg"));
soapPart.setContent(ss);
message.saveChanges();
System.out.println("\nRequest:\n");
message.writeTo(System.out);
System.out.println();
String ulr="http://192.168.1.124:80/service/soap";
SOAPMessage reply=connection.call(message,ulr);
System.out.println("\nRESPONSE:\n");
TransformerFactory transformerFactory =
TransformerFactory.newInstance();
Transformer transformer =
transformerFactory.newTransformer();
Source sourceContent = reply.getSOAPPart().getContent();
StreamResult result = new StreamResult(System.out);
transformer.transform(sourceContent, result);
System.out.println();
connection.close();
}catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}
the xml.msg like this :
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<nosession/>
<format type="
js"/>
</context>
</soap:Header>
<soap:Body>
<AuthRequest xmlns="urn:zimbraAccount">
<account by="name">
cross@sina.cn
</account>
<password>
chenjin
</password>
</AuthRequest>
</soap:Body>
</soap:Envelope>
it's also error like this:
java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response?
2006-3-28 16:29:24 com.sun.xml.messaging.saaj.soap.MessageImpl identifyContentType
SAAJ0537: Invalid Content-Type. Could be an error message instead of a SOAP message
I look the Debug :
Async RPC request: Add header Content-Type - application/soap+xml; charset=utf-8
so I think I was error at the but I don't know how to deal with it.