Well, it is a direct request, but the parameter seems to be invalid. The return always prompts that the parameter is null to construct the soap request information StringBuildersoapnewStringBuilder (); soap. Append (? Xmlversion1.0encodingutf-8 ?); Soap. Append (soap-ENV: Envelopexmlns: soap-ENVschemas
Well, it is a direct request, but the parameter seems to be invalid. When it is returned, it always prompts that the parameter is null // construct the soap request information StringBuilder soap = new StringBuilder (); soap. Append ("? Xml version = \ "1.0 \" encoding = \ "UTF-8 \"? "); Soap. Append (" soap-ENV: Envelope xmlns: soap-ENV = \ "http: // schemas
Well, it is a direct request, but the parameter seems to be invalid. If it is returned, it always prompts that the parameter is null.
// Construct the soap request information
StringBuilder soap = new StringBuilder ();
Soap. Append (" ");
Soap. Append (" ");
Soap. Append (" ");
Soap. Append (" ");//
Soap. Append (" 244767 ");
Soap. Append (" ");
Soap. Append (" ");
Soap. Append (" ");
// Initiate a request
Uri uri = new Uri ("http: // xxxxxxxx/index. php? R = yar/tgoods ");
WebRequest webRequest = WebRequest. Create (uri );
WebRequest. ContentType = "text/xml; charset = UTF-8 ";
WebRequest. Method = "POST ";
Using (Stream requestStream = webRequest. GetRequestStream ())
{
Byte [] paramBytes = Encoding. UTF8.GetBytes (soap. ToString ());
RequestStream. Write (paramBytes, 0, paramBytes. Length );
}
HttpWebResponse res;
Try
{
Res = (HttpWebResponse) webRequest. GetResponse ();
}
Catch (WebException ex)
{
Res = (HttpWebResponse) ex. Response;
}
StreamReader sr = new StreamReader (res. GetResponseStream (), Encoding. UTF8 );
String strHtml = sr. ReadToEnd ();