Quantcast
Channel: WCF, ASMX and other Web Services
Viewing all articles
Browse latest Browse all 555

How to set the parameter of a child node in c#

$
0
0

Hi guys,

I have a ASMX webservice that I need to call with no form or anything that has this following structure

<soap:Body><Purchase xmlns=""><po><UserName>string</UserName><Password>string</Password><Status>string</Status><POnumber>string</POnumber><feature1>string</feature1><feature2>string</feature2><linesIN><partNumberIN><InternalSku>string</InternalSku><HardwareNumber>string</HardwareNumber><opt1>string</opt1><opt2>string</opt2></partNumberIN><partNumberIN><InternalSku>string</InternalSku><HardwareNumber>string</HardwareNumber><opt1>string</opt1><opt2>string</opt2></partNumberIN></linesIN></po></Purchase>

I have mapped this webservice via servicereference in visualstudio and have managed to call the other functions but I havent worked
with this for a couple years and kinda forgot how to do it. I seem to get everything right except that the InternalSku is not passed and is null. 

public void orderRequest() {

ServicePointManager.ServerCertificateValidationCallback = ((sender, certificate, chain, sslPolicyErrors) => true);

V31sandbox.GEN_WS_SAND_Ver3_1SoapClient CallWebService = new V31sandbox.GEN_WS_SAND_Ver3_1SoapClient();
V31sandbox.PURCHASE PCH = new V31sandbox.PURCHASE();
V31sandbox.partNumberIN PNI = new V31sandbox.partNumberIN();
PCH.UserName = sxID;
PCH.Password = sxPWD;
PCH.POnumber = OrderNumber;
PNI.InternalSku = InternalSKU;

V31sandbox.PURCHASE_RESPONSE PUR = new V31sandbox.PURCHASE_RESPONSE();
PUR = CallWebService.Purchase(PCH);

What am I doing wrong here?

Im guessing I have to Tie the PNI togher with PNI with the PCH or just write it in a different way but how do I do that?  The other fields in partNumberIn are optional so I dont have to pass those.

Any help is Appreciated. 


Viewing all articles
Browse latest Browse all 555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>