B
bsma1
I'm writing a web service that makes calls into a C DLL. I've been
able to make most of the calls work except for one that returns a
string via a char* passed in as a parameter. Here's what I have:
The C function looks like this:
uint func1(char*, uint)
My C# code on the server is this:
[DllImport("mydll.dll", SetLastError = true)]
static extern unsafe uint func1([MarshalAs(UnmanagedType.LPStr)]out
string errStr, uint errorCode);
[WebMethod]
public unsafe uint callFunc1(uint errorCode, out string errorString)
{
return func1(out errorString, errorCode);
}
My C# code on the client (consumer) looks like this:
protected void myClientFunc(uint code)
{
string errorString;
proxy.func1(code, errorString);
}
When I run this I get a "Client found response content type of 'text/
html; charset=utf-8', but expected 'text/xml'." Any help is greatly
appreciated.
able to make most of the calls work except for one that returns a
string via a char* passed in as a parameter. Here's what I have:
The C function looks like this:
uint func1(char*, uint)
My C# code on the server is this:
[DllImport("mydll.dll", SetLastError = true)]
static extern unsafe uint func1([MarshalAs(UnmanagedType.LPStr)]out
string errStr, uint errorCode);
[WebMethod]
public unsafe uint callFunc1(uint errorCode, out string errorString)
{
return func1(out errorString, errorCode);
}
My C# code on the client (consumer) looks like this:
protected void myClientFunc(uint code)
{
string errorString;
proxy.func1(code, errorString);
}
When I run this I get a "Client found response content type of 'text/
html; charset=utf-8', but expected 'text/xml'." Any help is greatly
appreciated.