Get an error when post soap message

S

shaopu

I have created a C++ application to form soap message and post it to
web service through XMLHttp. The program is running fine if the web
service method has no parameter. However it returned "internal server
error" if the web service has some parameter.

My web service is like this:

[WebMethod]
public string HelloWorld(string para)
{
return "Hello World";
}

My C++ code is like below:
Utils.h

#if !defined(XMLHTTPUtilsIncluded)
#define XMLHTTPUtilsIncluded
#define TEMP_SIZE _MAX_PATH // size of short buffer
static _TCHAR szTemp[TEMP_SIZE]; // multipurpose buffer on
stack
static DWORD dwLen; // buffer size
LPCTSTR gszPkgSOAP =
_T("<SOAP-ENV:Envelope "
" xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
" xmlns:xsd='http://www.w3.org/2001/XMLSchema'"
" xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
" <SOAP-ENV:Body>"
" <HelloWorld>"
" <para>12</para>"
" </HelloWorld>"
" </SOAP-ENV:Body> "
" </SOAP-ENV:Envelope>"

);
//------------------------------------------------------------------
//
// POSTs a SOAP package to the Web service at
// http://www.xmethods.com/ve2/ViewListing.po?serviceid=8
// to get the current temprature given the ZipCode
//------------------------------------------------------------------
void callSCROMFunction(const _bstr_t &serviceurl,
const _bstr_t &function,
const _bstr_t &loginkey,
const _bstr_t &userid,
const _bstr_t &localid,
const _bstr_t &packageid,
const _bstr_t &path,
const _bstr_t &userdata)
{
try
{
_bstr_t bUrl = serviceurl + function;
// Step 1: Load the SOAP message XML using gszPkgSOAP global variable
IXMLDOMDocument2Ptr pXMLDoc = NULL;
EVAL_HR(pXMLDoc.CreateInstance("Msxml2.DOMDocument.4.0"));

// Load the document synchronously
pXMLDoc->async = false;

// Load the XML document
pXMLDoc->loadXML(gszPkgSOAP);


// Step 2: Update the zipcode node in the SOAP XML message

// Assuming "zipcode" node will always be there
// skipping the step to check if it exists
//pXMLDoc->selectSingleNode("//HelloWorld")->nodeTypedValue =
strZipCode;

// Step 3: Create XMLHTTP and send a POST request to the Web service
IXMLHTTPRequestPtr pXH = NULL;

EVAL_HR (pXH.CreateInstance("Msxml2.XMLHTTP.4.0"));

EVAL_HR (pXH->open("POST", (LPCTSTR)bUrl,
_variant_t(VARIANT_FALSE), _variant_t(""), _variant_t("")));

int iStatus;
_bstr_t bStatusText;
//iStatus = pXH->status;
//bStatusText = pXH->statusText;
EVAL_HR (pXH->setRequestHeader("Content-Type", "text/xml"));

EVAL_HR (pXH->send(pXMLDoc->xml));

// Step 4: If we got back the success response back
// get the value of "return" node from the response SOAP
// message
iStatus = pXH->status;
bStatusText = pXH->statusText;
pXMLDoc = pXH->responseXML;
_bstr_t btmp1 = pXMLDoc->xml;
if (pXH->status== 200)
{// Success

pXMLDoc = pXH->responseXML;
_bstr_t btmp = pXMLDoc->xml;

}
else
{
//*fTemp = (float)-1;
}

}
catch(...)
{// Exception handling

}
}



#endif // !XMLHTTPUtilsIncluded

in the main.cpp, make the following function call:
callSCROMFunction("http://localhost:/LEAD/test/Service1.asmx/",
"HelloWorld", "", "", "", "", "", "");
After calling pXH->send(), pXH->status is 0x000001f4 ("internal server
error")

Can anyone help to find the problem?

Thanks
Shaopu
 
S

Steven Cheng[MSFT]

Hi Shaopu,

Welcome to MSDN newsgroup.
From your description, you have an ASP.NET webservice and a certain client
app which use XMLHTTP to send SOAP request to the asp.net webservice (in
c++). However, you found that it always get 500 error if the target
webmethod has a parameter , yes?

Based on my experience, this is likely a clientside issue. I think we can
first check the webservice server's IIS log to see whether there're any
other error log info there. Also, creating a webservice client proxy
through C# or VBNET and consume the service to confirm that the webserivce
itself has no problem.

Then, we can use some trace tools such as the Soap Tookit's Trace Utility
or other http trace tool to capture the webservice's SOAP request message
sent by XMLHTTP in your c++ app to see whethere there're any problems in
the request message.

If there're any finding, please feel free to post here. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: (e-mail address removed)
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| Subject: Get an error when post soap message
| Date: 19 Oct 2005 05:37:02 -0700
| Organization: http://groups.google.com
| Lines: 128
| Message-ID: <[email protected]>
| NNTP-Posting-Host: 210.24.226.157
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1129725428 18908 127.0.0.1 (19 Oct 2005
12:37:08 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: Wed, 19 Oct 2005 12:37:08 +0000 (UTC)
| User-Agent: G2/0.2
| X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET
CLR 1.1.4322),gzip(gfe),gzip(gfe)
| Complaints-To: (e-mail address removed)
| Injection-Info: f14g2000cwb.googlegroups.com; posting-host=210.24.226.157;
| posting-account=xTPDgA0AAAARHXbmCnmAFK40CBkfHvH0
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!news.glorb.com!postnews.google.com!f14g2000cwb.googlegroups.com!not-fo
r-mail
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:8113
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
| I have created a C++ application to form soap message and post it to
| web service through XMLHttp. The program is running fine if the web
| service method has no parameter. However it returned "internal server
| error" if the web service has some parameter.
|
| My web service is like this:
|
| [WebMethod]
| public string HelloWorld(string para)
| {
| return "Hello World";
| }
|
| My C++ code is like below:
| Utils.h
|
| #if !defined(XMLHTTPUtilsIncluded)
| #define XMLHTTPUtilsIncluded
| #define TEMP_SIZE _MAX_PATH // size of short buffer
| static _TCHAR szTemp[TEMP_SIZE]; // multipurpose buffer on
| stack
| static DWORD dwLen; // buffer size
| LPCTSTR gszPkgSOAP =
| _T("<SOAP-ENV:Envelope "
| " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
| " xmlns:xsd='http://www.w3.org/2001/XMLSchema'"
| " xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
| " <SOAP-ENV:Body>"
| " <HelloWorld>"
| " <para>12</para>"
| " </HelloWorld>"
| " </SOAP-ENV:Body> "
| " </SOAP-ENV:Envelope>"
|
| );
| //------------------------------------------------------------------
| //
| // POSTs a SOAP package to the Web service at
| // http://www.xmethods.com/ve2/ViewListing.po?serviceid=8
| // to get the current temprature given the ZipCode
| //------------------------------------------------------------------
| void callSCROMFunction(const _bstr_t &serviceurl,
| const _bstr_t &function,
| const _bstr_t &loginkey,
| const _bstr_t &userid,
| const _bstr_t &localid,
| const _bstr_t &packageid,
| const _bstr_t &path,
| const _bstr_t &userdata)
| {
| try
| {
| _bstr_t bUrl = serviceurl + function;
| // Step 1: Load the SOAP message XML using gszPkgSOAP global variable
| IXMLDOMDocument2Ptr pXMLDoc = NULL;
| EVAL_HR(pXMLDoc.CreateInstance("Msxml2.DOMDocument.4.0"));
|
| // Load the document synchronously
| pXMLDoc->async = false;
|
| // Load the XML document
| pXMLDoc->loadXML(gszPkgSOAP);
|
|
| // Step 2: Update the zipcode node in the SOAP XML message
|
| // Assuming "zipcode" node will always be there
| // skipping the step to check if it exists
| //pXMLDoc->selectSingleNode("//HelloWorld")->nodeTypedValue =
| strZipCode;
|
| // Step 3: Create XMLHTTP and send a POST request to the Web service
| IXMLHTTPRequestPtr pXH = NULL;
|
| EVAL_HR (pXH.CreateInstance("Msxml2.XMLHTTP.4.0"));
|
| EVAL_HR (pXH->open("POST", (LPCTSTR)bUrl,
| _variant_t(VARIANT_FALSE), _variant_t(""), _variant_t("")));
|
| int iStatus;
| _bstr_t bStatusText;
| //iStatus = pXH->status;
| //bStatusText = pXH->statusText;
| EVAL_HR (pXH->setRequestHeader("Content-Type", "text/xml"));
|
| EVAL_HR (pXH->send(pXMLDoc->xml));
|
| // Step 4: If we got back the success response back
| // get the value of "return" node from the response SOAP
| // message
| iStatus = pXH->status;
| bStatusText = pXH->statusText;
| pXMLDoc = pXH->responseXML;
| _bstr_t btmp1 = pXMLDoc->xml;
| if (pXH->status== 200)
| {// Success
|
| pXMLDoc = pXH->responseXML;
| _bstr_t btmp = pXMLDoc->xml;
|
| }
| else
| {
| //*fTemp = (float)-1;
| }
|
| }
| catch(...)
| {// Exception handling
|
| }
| }
|
|
|
| #endif // !XMLHTTPUtilsIncluded
|
| in the main.cpp, make the following function call:
| callSCROMFunction("http://localhost:/LEAD/test/Service1.asmx/",
| "HelloWorld", "", "", "", "", "", "");
| After calling pXH->send(), pXH->status is 0x000001f4 ("internal server
| error")
|
| Can anyone help to find the problem?
|
| Thanks
| Shaopu
|
|
 
S

shaopu

Hi Steven,
Thanks for you prompt reply. Please see my reply below:
Shaopu: Yes

Shaopu: I checked IIS log and found only 500 error.
I used .NET web service test page to test the web service and it works
fine.

I traced the request using the Soap Tookit's Trace Utility and got the
following error:
System.InvalidOperationException: Request format is invalid:
text/xml...
at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()..

at System.Web.Services.Protocols.WebServiceHandler.Invoke()..
at
System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()..

The soap message I post earlier had some problem by some debuging
change:
("<SOAP-ENV:Envelope "
| "
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
| " xmlns:xsd='http://www.w3.org/2001/XMLSchema'"
| "
xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
| " <SOAP-ENV:Body>"
| " <HelloWorld>"
| " <para>12</para>"
| " </HelloWorld>"
| " </SOAP-ENV:Body> "
| " </SOAP-ENV:Envelope>"

And I have changed it back to the correct format:
<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
"
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "
"xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
" <soap:Body>"
" <HelloWorld xmlns=\"http://tempuri.org/\"><para>string</para>"
" </HelloWorld>"
" </soap:Body> "
" </soap:Envelope>"

And it still return the same error.

Any advise from here?

Thanks
Shaopu
 
S

Steven Cheng[MSFT]

Hi Shaopu,

Thanks for your quick response.
So since you've used the trace utility , what's the SOAP message's content
you captured down? You can compare the one with the request message which
is sent by .NET webservice client. I'm sure there would exists some
difference between them so that cause the problem.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: (e-mail address removed)
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| Subject: Re: Get an error when post soap message
| Date: 19 Oct 2005 21:28:12 -0700
| Organization: http://groups.google.com
| Lines: 67
| Message-ID: <[email protected]>
| References: <[email protected]>
| <[email protected]>
| NNTP-Posting-Host: 210.24.226.157
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1129782498 14701 127.0.0.1 (20 Oct 2005
04:28:18 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: Thu, 20 Oct 2005 04:28:18 +0000 (UTC)
| In-Reply-To: <[email protected]>
| User-Agent: G2/0.2
| X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET
CLR 1.1.4322),gzip(gfe),gzip(gfe)
| Complaints-To: (e-mail address removed)
| Injection-Info: g14g2000cwa.googlegroups.com; posting-host=210.24.226.157;
| posting-account=xTPDgA0AAAARHXbmCnmAFK40CBkfHvH0
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!news.glorb.com!postnews.google.com!g14g2000cwa.googlegroups.com!not-fo
r-mail
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:8127
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
| Hi Steven,
| Thanks for you prompt reply. Please see my reply below:
|
| >>From your description, you have an ASP.NET webservice and a certain
client
| >>app which use XMLHTTP to send SOAP request to the asp.net webservice (in
| >>c++). However, you found that it always get 500 error if the target
| >>webmethod has a parameter , yes?
| Shaopu: Yes
|
|
| >>Based on my experience, this is likely a clientside issue. I think we
can
| >>first check the webservice server's IIS log to see whether there're any
| >>other error log info there. Also, creating a webservice client proxy
| >>through C# or VBNET and consume the service to confirm that the
webserivce
| >>itself has no problem.
| Shaopu: I checked IIS log and found only 500 error.
| I used .NET web service test page to test the web service and it works
| fine.
|
|
| >>Then, we can use some trace tools such as the Soap Tookit's Trace
Utility
| >>or other http trace tool to capture the webservice's SOAP request
message
| >>sent by XMLHTTP in your c++ app to see whethere there're any problems in
| >>the request message.
| I traced the request using the Soap Tookit's Trace Utility and got the
| following error:
| System.InvalidOperationException: Request format is invalid:
| text/xml...
| at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()..
|
| at System.Web.Services.Protocols.WebServiceHandler.Invoke()..
| at
| System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()..
|
| The soap message I post earlier had some problem by some debuging
| change:
| ("<SOAP-ENV:Envelope "
| | "
| xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
| | " xmlns:xsd='http://www.w3.org/2001/XMLSchema'"
| | "
| xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"
| | " <SOAP-ENV:Body>"
| | " <HelloWorld>"
| | " <para>12</para>"
| | " </HelloWorld>"
| | " </SOAP-ENV:Body> "
| | " </SOAP-ENV:Envelope>"
|
| And I have changed it back to the correct format:
| <soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
| "
| "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "
| "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
| " <soap:Body>"
| " <HelloWorld xmlns=\"http://tempuri.org/\"><para>string</para>"
| " </HelloWorld>"
| " </soap:Body> "
| " </soap:Envelope>"
|
| And it still return the same error.
|
| Any advise from here?
|
| Thanks
| Shaopu
|
|
 
S

shaopu

Hi Steven,

Thanks for you reply.

I compared the messages traced from .NET client and C++ app and found
they are almost the same, but still got the same error. Below is the
comparison of the two:

Message of C++ App:

<?xml version="1.0" encoding="utf-8" ?>
- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <soap:Body>
- <HelloWorld xmlns="http://tempuri.org/">
<para>john</para>
</HelloWorld>
</soap:Body>
</soap:Envelope>

Message of .NET App:

<?xml version="1.0" encoding="utf-8" ?>
- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <soap:Body>
- <HelloWorld xmlns="http://tempuri.org/">
<para>John</para>
</HelloWorld>
</soap:Body>
</soap:Envelope>

HTTPHeader of C++ App:

- <HTTPHeaders>
<accept>*/*</accept>
<content-type>text/xml; charset=utf-8</content-type>
<soapaction>http://tempuri.org/HelloWorld</soapaction>
<accept-language>en-us</accept-language>
<accept-encoding>gzip, deflate</accept-encoding>
<user-agent>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET
CLR 1.1.4322)</user-agent>
<host>windows2003:8080</host>
<content-length>323</content-length>
<connection>Keep-Alive</connection>
<cache-control>no-cache</cache-control>
</HTTPHeaders>

HTTPHeader of NET APP:

- <HTTPHeaders>

<vsdebuggercausalitydata>AwAAALD89Vk1Q11OoLk88efYT/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</vsdebuggercausalitydata>

<user-agent>Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client
Protocol 1.1.4322.573)</user-agent>
<content-type>text/xml; charset=utf-8</content-type>
<soapaction>"http://tempuri.org/HelloWorld"</soapaction>
<content-length>316</content-length>
<expect>100-continue</expect>
<connection>Keep-Alive</connection>
<host>windows2003:8080</host>
</HTTPHeaders>

Error message got for c++ app:

System.InvalidOperationException: Request format is invalid: text/xml;
charset=utf-8.
at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
at System.Web.Services.Protocols.WebServiceHandler.Invoke()
at
System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

I have tried on two machines and got the same results. I really connot
figure out what is happening.

Shaopu
 
S

Steven Cheng[MSFT]

Thanks for your further response Shaopu,

Really strange. Where did you capture the XML soap message, at clientside
or at serverside? If at clientside, I'd suggest you also capture the
message at the server side to ensure that messages from both client( c++
and .net) are identical. Also, you can use the .NET's HttpWebRequest to
manually send string base XML message to the same service to compare with
the C++ one. In addition, if possible, you can also try testing on other
dev box to see whether this is a clientside environment specific issue.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
| From: (e-mail address removed)
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| Subject: Re: Get an error when post soap message
| Date: 20 Oct 2005 05:00:12 -0700
| Organization: http://groups.google.com
| Lines: 80
| Message-ID: <[email protected]>
| References: <[email protected]>
| <[email protected]>
| <[email protected]>
| NNTP-Posting-Host: 210.24.226.157
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1129809617 4525 127.0.0.1 (20 Oct 2005
12:00:17 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: Thu, 20 Oct 2005 12:00:17 +0000 (UTC)
| In-Reply-To: <[email protected]>
| User-Agent: G2/0.2
| X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET
CLR 1.1.4322),gzip(gfe),gzip(gfe)
| Complaints-To: (e-mail address removed)
| Injection-Info: o13g2000cwo.googlegroups.com; posting-host=210.24.226.157;
| posting-account=xTPDgA0AAAARHXbmCnmAFK40CBkfHvH0
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!ne
wsfeed1.ip.tiscali.net!news.glorb.com!postnews.google.com!o13g2000cwo.google
groups.com!not-for-mail
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:8130
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
| Hi Steven,
|
| Thanks for you reply.
|
| I compared the messages traced from .NET client and C++ app and found
| they are almost the same, but still got the same error. Below is the
| comparison of the two:
|
| Message of C++ App:
|
| <?xml version="1.0" encoding="utf-8" ?>
| - <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:xsd="http://www.w3.org/2001/XMLSchema">
| - <soap:Body>
| - <HelloWorld xmlns="http://tempuri.org/">
| <para>john</para>
| </HelloWorld>
| </soap:Body>
| </soap:Envelope>
|
| Message of .NET App:
|
| <?xml version="1.0" encoding="utf-8" ?>
| - <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:xsd="http://www.w3.org/2001/XMLSchema">
| - <soap:Body>
| - <HelloWorld xmlns="http://tempuri.org/">
| <para>John</para>
| </HelloWorld>
| </soap:Body>
| </soap:Envelope>
|
| HTTPHeader of C++ App:
|
| - <HTTPHeaders>
| <accept>*/*</accept>
| <content-type>text/xml; charset=utf-8</content-type>
| <soapaction>http://tempuri.org/HelloWorld</soapaction>
| <accept-language>en-us</accept-language>
| <accept-encoding>gzip, deflate</accept-encoding>
| <user-agent>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET
| CLR 1.1.4322)</user-agent>
| <host>windows2003:8080</host>
| <content-length>323</content-length>
| <connection>Keep-Alive</connection>
| <cache-control>no-cache</cache-control>
| </HTTPHeaders>
|
| HTTPHeader of NET APP:
|
| - <HTTPHeaders>
|
|
<vsdebuggercausalitydata>AwAAALD89Vk1Q11OoLk88efYT/AAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAA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
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA</vsdebuggercausalitydata>
|
| <user-agent>Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client
| Protocol 1.1.4322.573)</user-agent>
| <content-type>text/xml; charset=utf-8</content-type>
| <soapaction>"http://tempuri.org/HelloWorld"</soapaction>
| <content-length>316</content-length>
| <expect>100-continue</expect>
| <connection>Keep-Alive</connection>
| <host>windows2003:8080</host>
| </HTTPHeaders>
|
| Error message got for c++ app:
|
| System.InvalidOperationException: Request format is invalid: text/xml;
| charset=utf-8.
| at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
| at System.Web.Services.Protocols.WebServiceHandler.Invoke()
| at
| System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
|
| I have tried on two machines and got the same results. I really connot
| figure out what is happening.
|
| Shaopu
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top