Board index » delphi » Unable to pass parameter to a webservice written in VS 2003 (C#) from a .NET app written in D2006

Unable to pass parameter to a webservice written in VS 2003 (C#) from a .NET app written in D2006


2006-09-27 05:06:15 PM
delphi145
Hi
I have a problem accessing a webservice written in VS 2003 C# from a
Delphi 2006 .NET application.
I can pass simple parameters (strings) from my D2006 app to the VS2003
webservice, but the webservice also has this type, Person (copied from
the proxy-class in D2006):
PersonData = class
public
Name: string;
Addresse1: string;
Addresse2: string;
EMail: string;
end;
Person = class
public
CprNr: string;
PersonData : PersonData;
end;
whenever I try to pass a parameter of type Person, the webservice
receives null. I can not see why?
Any ideas will be appreciated
/Michael
 
 

Re:Unable to pass parameter to a webservice written in VS 2003 (C#) from a .NET app written in D2006

Quote
Hi

I have a problem accessing a webservice written in VS 2003 C# from a
Delphi 2006 .NET application.

I can pass simple parameters (strings) from my D2006 app to the VS2003
webservice, but the webservice also has this type, Person (copied from
the proxy-class in D2006):

PersonData = class
public
Name: string;
Addresse1: string;
Addresse2: string;
EMail: string;
end;

Person = class
public
CprNr: string;
PersonData : PersonData;
end;

whenever I try to pass a parameter of type Person, the webservice
receives null. I can not see why?

Any ideas will be appreciated

/Michael
Hi,
I've got exactly the same thing. I only have one param that gets passed to the webservice, but it sees it as "null".
Please Help!!
Posted from www.topxml.com/renntp using reNNTP: the website based NNTP reader.
 

Re:Unable to pass parameter to a webservice written in VS 2003 (C#) from a .NET app written in D2006

Hello,
Quote
I've got exactly the same thing. I only have one param that gets passed to
the webservice, but it sees it as "null".
Typically if a webservice see something as 'null', it typically is because
the XML node was not setup properly. More often than not, I have found that
it's related to the namespace. Not too long ago someone pointed out here
cases where dateTime were not being seen by .NET WebServices because the
serialization logic put an incorrect prefix on the node.
A more subtle flavor of this issue is related to related to the
'elementFormDefault' attribute of schemas and shows up on non-toplevel
(global) items, as in the case mentioned in the case mentioned in this
thread - i.e.
Quote
>Person = class
>public
>CprNr: string;
>PersonData : PersonData;
>end;
>
>whenever I try to pass a parameter of type Person, the webservice
>receives null. I can not see why?
The elementFormDefault attribute specifies whether the service expects local
elements to be namespaced or not. A lot of SOAP implementations, Delphi's
Win32 included, don't pay attention to 'elementFormDefault'; it assumes it's
"qualified" and will happily sent something along the lines of
<Person xmlns="someNamespaceHere">
<CprNr>The string parameter</CprNr>
<PersonData>
......
</PersonData>
</Person>
The above won't be correctly seen if the receiving service is strict on
enforcing valid XML packets.
Anyway... without more details, it is not easy to investigate but I would
suggest the following:
1. Find out if a C# client can talk to the Service successfully. If yes,
compare the XML request packets.
2. Inspect the schema and see if it specifies 'elementFormDefault' and
verify if the XML request packet respects the setting
3. Post the WSDL/Schema (the relevant excerpts) here as well as the XML
request packet so we may assess.
4. Generate the binding using .NET's WSDL.EXE and compare it to the Pascal
binding.
5. Use the PostSOAP sample included with Delphi to post XML packets to the
service. This allows you to tweak the packet and find out what the service
is after. .NET WebServices often show a sample packet on their default
(without the ?WSDL querystring) page.
Cheers,
Bruneau.
"Quentin" <XXXX@XXXXX.COM>writes
Quote

>Hi
>
>I have a problem accessing a webservice written in VS 2003 C# from a
>Delphi 2006 .NET application.
>
>I can pass simple parameters (strings) from my D2006 app to the VS2003
>webservice, but the webservice also has this type, Person (copied from
>the proxy-class in D2006):
>
>PersonData = class
>public
>Name: string;
>Addresse1: string;
>Addresse2: string;
>EMail: string;
>end;
>
>Person = class
>public
>CprNr: string;
>PersonData : PersonData;
>end;
>
>whenever I try to pass a parameter of type Person, the webservice
>receives null. I can not see why?
>
>Any ideas will be appreciated
>
>/Michael

Hi,

I've got exactly the same thing. I only have one param that gets passed to
the webservice, but it sees it as "null".

Please Help!!

Posted from www.topxml.com/renntp using reNNTP: the website based
NNTP reader.