weird changes in method signature

  • Thread starter Thread starter Bamse
  • Start date Start date
B

Bamse

Hi,

I've noticed that if in a webservice method, I use an enumeration or a
struct of my own, in the project that references that webservice, the
method's signature is changed, e.g:

proj1:
public struct S1
{
public string Member1;
public int Member2;
}

ws_proj
{
DoSomething(S1 myStruct)
{
...
}
}

proj3
{
using proj1;
main()
{
S1 myStruct = new S1();
ws_proj.DoSomething(myStruct); // this line does not
compile: cannot convert proj1.S1 to localhost.S1
}
}

why is this happening and how can be avoided/solved without manually
rewriting reference.cs of the WS?
i use VS .NET 2002.

Thank you,
Daniel
 
Bamse,

The types are not compatable in the CLR space. Basically, when you set
a reference to the web method, a new type is being created for you that
represents the structure that is being passed to the web method. This type
is different from the type in proj1 (even though the members are the same).

You will have to copy the values from the type in proj1 to the other
that is defined by the web method itself in the WSDL.

Hope this helps.
 

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

Back
Top