Home > Net >  WebService service under Windows Java httpPost call is normal, the Linux with failure
WebService service under Windows Java httpPost call is normal, the Linux with failure

Time:10-03

WebService service under Windows Java httpPost call is normal, the Linux with failure at 500 wrong

Java. Lang. RuntimeException: Java. Lang. RuntimeException: 500: Internal Server Error

StringBuffer sb=new StringBuffer ();
Sb. Append (" & lt; Soapenv: Envelope XMLNS: soapenv=\ \ "http://schemas.xmlsoap.org/soap/envelope/" XMLNS: tem=\ \ "http://tempuri.org/" & gt;" );
Sb. Append (" & lt; Soapenv: Header/& gt;" );
Sb. Append (" & lt; Soapenv: Body>" );
Sb. Append (" & lt; Tem: "+ action + & gt;" " );
Sb. Append (" & lt; Tem: carrCd> JD" );
Sb. Append (" & lt; Tem: isEncrypt> False" );
Sb. Append (" & lt; Tem: guid>" ). Append (guid). Append (" & lt;/tem: guid>" );
Sb. Append (" & lt; Tem: requestData>" ), append (MSG). Append (" & lt;/tem: requestData>" );
Sb. Append (" & lt;/tem: "+ action + & gt;" " );
Sb. Append (" & lt;/soapenv: Body>" );
Sb. Append (" & lt;/soapenv: Envelope>" );
HttpClient client=new HttpClient ();
PostMethod PostMethod=new PostMethod (soapBindingAddress);
//3. Set the request parameter
PostMethod. SetRequestBody (sb. ToString ());
//postMethod. The setParameter (" mobileCode "mobileCode);
//postMethod. The setParameter (" userID ", userID);
//modify request head
PostMethod. SetRequestHeader (" the content-type ", "text/XML. charset=utf-8");
//4. Execute the request, the result code
Int code=client. ExecuteMethod (postMethod);
//5. Get the results
The String result="";
If (code==200) {
Result=postMethod. GetResponseBodyAsString ();
Result=parseXml (new ByteArrayInputStream (result. GetBytes ()));
}
Logger. The info (" httpPost code="+ code +", "+ result);

CodePudding user response:

The detailed log output also come out to see
  • Related