WebService client, files from delphi 2007 on d7 not working as it should!

Hello,

   I am currently developing webservice client connecting to server written in c#.

The problem is related to WebService components in d7 (THttptio).

1. On d7 version I get AccessVioletion if I don't put my app into DEP.

     Why is that on certain machines AV occurs on others not?

2. I found some files on your page with the soap sources from (delphi 2007 probably) which fixed AV problems
however executing methods I am getting an error: indicating problems with parameter: s.

3. If I finally create an app in delphi 2010 everything works perfectly as it should ...

Could you please give me some indication on my questions?
Is there anything I can do to make use of soap In delphi 7?

Thanks for help in advance!
0
Jan
10/28/2009 9:51:45 PM
embarcadero.delphi.non-tech 5933 articles. 1 followers. Follow

7 Replies
1195 Views

Similar Articles

[PageSpeed] 50

> {quote:title=Jan Kowalski wrote:}{quote}
> Hello,
> 
>    I am currently developing webservice client connecting to server written in c#.
> 
> The problem is related to WebService components in d7 (THttptio).
> 
> 1. On d7 version I get AccessVioletion if I don't put my app into DEP.
> 
>      Why is that on certain machines AV occurs on others not?
> 
> 2. I found some files on your page with the soap sources from (delphi 2007 probably) which fixed AV problems
> however executing methods I am getting an error: indicating problems with parameter: s.
> 
> 3. If I finally create an app in delphi 2010 everything works perfectly as it should ...
> 
> Could you please give me some indication on my questions?
> Is there anything I can do to make use of soap In delphi 7?
> 
> Thanks for help in advance!

There is an entry in CodeCentral that backports Delphi 2007 web service fixes to Delphi 7, 2005 and 2006.  You'll have to use WSDLImp from the command line instead of the one built in to the IDE, though.  These may help in your situation.

http://cc.embarcadero.com/Item/24535

--
Regards
Bruce McGee
Glooscap Software
0
Bruce
10/28/2009 10:55:10 PM
> {quote:title=Jan Kowalski wrote:}{quote}
> Hello,
> 
>    I am currently developing webservice client connecting to server written in c#.
> 
> The problem is related to WebService components in d7 (THttptio).
> 
> 1. On d7 version I get AccessVioletion if I don't put my app into DEP.
> 
>      Why is that on certain machines AV occurs on others not?
> 
> 2. I found some files on your page with the soap sources from (delphi 2007 probably) which fixed AV problems
> however executing methods I am getting an error: indicating problems with parameter: s.
> 
> 3. If I finally create an app in delphi 2010 everything works perfectly as it should ...
> 
> Could you please give me some indication on my questions?
> Is there anything I can do to make use of soap In delphi 7?
> 
> Thanks for help in advance!

I misread your post the first time.  The code you mention in point 2 is probably the CodeCentral entry I mentioned.

If you haven't already, you should still try using the new units and re-importing the WSDL with the command line WSDLImp.  Our DEP problems went away in Delphi 2007, but I'm not sure if this is one of the fixes that was backported.

--
Regards
Bruce McGee
Glooscap Software
0
Bruce
10/29/2009 10:11:03 AM
> {quote:title=Bruce McGee wrote:}{quote}
> > {quote:title=Jan Kowalski wrote:}{quote}
> > Hello,
> > 
> >    I am currently developing webservice client connecting to server written in c#.
> > 
> > The problem is related to WebService components in d7 (THttptio).
> > 
> > 1. On d7 version I get AccessVioletion if I don't put my app into DEP.
> > 
> >      Why is that on certain machines AV occurs on others not?
> > 
> > 2. I found some files on your page with the soap sources from (delphi 2007 probably) which fixed AV problems
> > however executing methods I am getting an error: indicating problems with parameter: s.
> > 
> > 3. If I finally create an app in delphi 2010 everything works perfectly as it should ...
> > 
> > Could you please give me some indication on my questions?
> > Is there anything I can do to make use of soap In delphi 7?
> > 
> > Thanks for help in advance!
> 
> I misread your post the first time.  The code you mention in point 2 is probably the CodeCentral entry I mentioned.
> 
> If you haven't already, you should still try using the new units and re-importing the WSDL with the command line WSDLImp.  Our DEP problems went away in Delphi 2007, but I'm not sure if this is one of the fixes that was backported.
> 
> --
> Regards
> Bruce McGee
> Glooscap Software

Hi, 

   Thank you for quick response.

I have made test as follow:

New WSDL importer
 
   - Without new units (from d2007)

     -> Without DEP
   
       -> Result: Access Violation

     -> With DEP

       -> Works!

   - With included new units (from d2007)

     -> (With/Without DEP)
  
       -> Result: Answer from c# server: "Value cannot be null.
Parameter name: s"

So the conlucion is that new units give me the above error - I don't where it comes from ...
and which I cannot workaround ...

As i wrote previously, in delphi 2010 everything works ok, but this is the version of my friend
working in a different company. I have got only Delphi 7 enterprise edition.

Could you please tell me how I could fix the above problem?
0
Jan
11/3/2009 12:04:36 PM
Jan Kowalski wrote:

> Hi, 
> 
>    Thank you for quick response.
> 
> I have made test as follow:
> 
> New WSDL importer
>  
>    - Without new units (from d2007)
> 
>      -> Without DEP
>    
>        -> Result: Access Violation
> 
>      -> With DEP
> 
>        -> Works!
> 
>    - With included new units (from d2007)
> 
>      -> (With/Without DEP)
>   
>        -> Result: Answer from c# server: "Value cannot be
> null.
Parameter name: s"
> 
> So the conlucion is that new units give me the above error - I don't
> where it comes from ...  and which I cannot workaround ...
> 
> As i wrote previously, in delphi 2010 everything works ok, but this
> is the version of my friend working in a different company. I have
> got only Delphi 7 enterprise edition.
> 
> Could you please tell me how I could fix the above problem?

It sounds like one of the parameters is being sent as a null that the
C# end is expecting to be populated.  This means the XML might not be
completely correct with the "fixed" units.

You can see the XML being sent to and received from the server in
THTTPRIO's BeforeExecute and AfterExecute events.

Compare the XML being sent with and without the new units to see what's
missing and populate that parameter explicitly in your code.

Let me know if this helps.

-- 
Regards,
Bruce McGee
Glooscap Software
0
Bruce
11/3/2009 5:51:54 PM
> It sounds like one of the parameters is being sent as a null that the
> C# end is expecting to be populated.  This means the XML might not be
> completely correct with the "fixed" units.
> 
> You can see the XML being sent to and received from the server in
> THTTPRIO's BeforeExecute and AfterExecute events.
> 
> Compare the XML being sent with and without the new units to see what's
> missing and populate that parameter explicitly in your code.
> 
> Let me know if this helps.
> 
> -- 
> Regards,
> Bruce McGee
> Glooscap Software


Thanks for the hint ...

My method was like this:

<Run xmlns="http://SRV.WebService/"><methodXml>sdfsd</methodXml><dataXml>sdf</dataXml></Run>

New units does this:

<Run xmlns="http://SRV.WebService/"><xsd:methodXml>sdfsd</xsd:methodXml><xsd:dataXml>sdf</xsd:dataXml></Run>

I just replaced the string in beforeExecute method and it worked out, but:

1) Is there anything we could do to avoid such problem? (without manual changing the request)

2) Is there a chance that Embarcadero could fix that issue? (for d2007 units, which could be used in d7)

Thanks!
0
Jan
11/4/2009 7:28:51 AM
> {quote:title=Jan Kowalski wrote:}{quote}
> > It sounds like one of the parameters is being sent as a null that the
> > C# end is expecting to be populated.  This means the XML might not be
> > completely correct with the "fixed" units.
> > 
> > You can see the XML being sent to and received from the server in
> > THTTPRIO's BeforeExecute and AfterExecute events.
> > 
> > Compare the XML being sent with and without the new units to see what's
> > missing and populate that parameter explicitly in your code.
> > 
> > Let me know if this helps.
> > 
> > -- 
> > Regards,
> > Bruce McGee
> > Glooscap Software
> 
> 
> Thanks for the hint ...
> 
> My method was like this:
> 
> <Run xmlns="http://SRV.WebService/"><methodXml>sdfsd</methodXml><dataXml>sdf</dataXml></Run>
> 
> New units does this:
> 
> <Run xmlns="http://SRV.WebService/"><xsd:methodXml>sdfsd</xsd:methodXml><xsd:dataXml>sdf</xsd:dataXml></Run>
> 
> I just replaced the string in beforeExecute method and it worked out, but:
> 
> 1) Is there anything we could do to avoid such problem? (without manual changing the request)
> 
> 2) Is there a chance that Embarcadero could fix that issue? (for d2007 units, which could be used in d7)
> 
> Thanks!

That wasn't what I was expecting.  I thought the second call would be missing a parameter.  Did you generate the .pas file from the .wsdl inside Delphi for the first case and using the new WSDLImp from the command line for the second?  Are they very different?  I suspect the problem is in the runtime units, though.

1) I'm not sure how you would fix this.  You might want to drop a line to Bruneau.Babet at Embarcadero.

2) You never know, but I find it unlikely.

--
Regards
Bruce McGee
Glooscap Software
0
Bruce
11/4/2009 11:33:54 AM
> 
> That wasn't what I was expecting.  I thought the second call would be missing a parameter.  Did you generate the .pas file from the .wsdl inside Delphi for the first case and using the new WSDLImp from the command line for the second?  Are they very different?  I suspect the problem is in the runtime units, though.
> 
> 1) I'm not sure how you would fix this.  You might want to drop a line to Bruneau.Babet at Embarcadero.
> 
> 2) You never know, but I find it unlikely.
> 
> --
> Regards
> Bruce McGee
> Glooscap Software


Hi,

   At the following link you may find two requests based on the units generated from d7 and d2007 wsdl generators.
http://pastebin.com/m10e9a645

In both units I get:

"Value cannot be null.
Parameter name: s"


I will write to Embarcadero,

Thanks for your time,

Edited by: Jan Kowalski on Nov 4, 2009 6:14 AM

Edited by: Jan Kowalski on Nov 4, 2009 6:16 AM
0
Jan
11/4/2009 2:16:52 PM
Reply: