Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 26th, 2004, 11:04 AM
Registered User
 
Join Date: Feb 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Soap parameters passing as null

I have run into a nasty little soap/c#/.net problem and would appreciate any assistance available.

below is the soap message being sent
HEADERS - identical to wsdl
"Content-Type", "text/xml; charset=utf-8"
"SOAPAction", "http://mfelcansmith.alpha.kaplaninc.com/Add"
"HOST","mfelcansmith.alpha.kaplaninc.com

Soap Request:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope ...namespaces...>
<soap:Body>
<DCT_test xmlns="http://mfelcansmith.alpha.kaplaninc.com">
<strKey_val>teststring</strKey_val>
</DCT_test>
</soap:Body>
</soap:Envelope>


C# web method

        [WebMethod]
        [System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://mfelcansmith.alpha.kaplaninc.com/DCT_test",
        Use=System.Web.Services.Description.SoapBindingUse .Literal, ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]

        public return_code DCT_test(string strKey_val)
            {

            return_code return_code=new return_code();
            return_code.intReturn_code = 0;
            return_code.strReturn_code = "test";
            return_code.strReturn_code = strKey_val + "-test";
            return return_code;
            }



The response does not include the passed parameter and in debug mode the parameter value is null.

soap-response:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope ...namespaces...>
<soap:Body>
<DCT_testResponse xmlns="http://mfelcansmith.alpha.kaplaninc.com/">
<DCT_testResult><intReturn_code>0</intReturn_code>
<strReturn_code>-test</strReturn_code>
<strReturn_code_desc />
</DCT_testResult>
</DCT_testResponse>
</soap:Body>
</soap:Envelope>

I have tried different soap parameter styles with the same effect.

Thanks for your time and assistance,
Daniel Bowden
[email protected]

 
Old February 26th, 2004, 11:18 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Any difference if you change your variable name to be different to your class?
Code:
public return_code DCT_test(string strKey_val)
{

  return_code Return_code=new return_code();
  Return_code.intReturn_code = 0;
  Return_code.strReturn_code = strKey_val + "-test";
  return Return_code;
}
--

Joe
 
Old February 26th, 2004, 11:58 AM
Registered User
 
Join Date: Feb 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

joefawcett,
Thanks for looking into it.
unfortunately changing the variable name did not make a difference.
I should say that I have written 4 test web services and NONE of them seem to actually grab the parameter values from the soap body, they all work fine in http: post key value pairs.

I am trying to put some code in intializeComponent that will show me what the saop looks like coming in.

I am at a loss otherwise.
I need to find out what is happening between my posting the soap and the web method being executed that is either blocking or clearing the parameters that are in the soap body.

Daniel

 
Old February 26th, 2004, 12:17 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Try searching for WFetch on msdn.com. It lets you see all the headers etc. when pages are requested as well as the response. I can email it you if you can't download it.



--

Joe





Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing soap message neerom XSLT 3 November 17th, 2008 07:32 AM
Passing null value to integer abhishekkashyap27 C# 2005 9 April 18th, 2008 04:11 AM
Passing null values maddy137 ASP.NET 1.0 and 1.1 Basics 1 May 7th, 2006 12:26 PM
passing a null value thru sql parameter polofson .NET Framework 2.0 1 May 3rd, 2006 12:56 AM
Passing Null in VB kumarpa Pro VB 6 1 March 30th, 2004 04:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.