I'm going to develop a client for a company that uses a webservice from another company.
The company that holds the webservice, have provided me with two wsdl files, two xsd files, one app.config file, and one reference.cs file.
when I try to send this to the webservice I get a "Cocdata provided is not a valid XML document 's' is undeclared prefix, Line 1 position 2."
// Instantiate the WebProxy class
WebProxy myProxy = new WebProxy("http://hidden.com:80", true);
myProxy.Credentials = new NetworkCredential("username", "password", "domain");
// Instantiate the WebService class
CoCExchange.CoCExchangeWse client = new CoCExchange.CoCExchangeWse();
//Set the proxy to the Client
client.Proxy = myProxy;
// Apply credentials as clear-text
client.SetClientCredential(new Microsoft.Web.Services3.Security.Tokens.UsernameToken("username", "pass", Microsoft.Web.Services3.Security.Tokens.PasswordOption.SendPlainText));
// Apply relevant policy
client.SetPolicy(new UsernameOverTransportPolicy());
// The XML string containing the CoC document to be submitted
string coCDocument = "
// Submit the document
CoCExchange.VehicleReceipt receipt = client.SubmitCoC(coCDocument, false, true);
client.Dispose();
MessageBox.Show(string.Format("ReceiptId={0}\nVehicleIdentificationNumber={1}", receipt.ReceiptId, receipt.VehicleIdentificationNumber));
Do someone see any problem in the XML string ... the XML string is just a test..
Do I have to include the xsd and wsdl files in the project? I don't know what I'm doing wrong here .. :(
Appriciate any help.
Best regards
Baris
Nitesh KejriwalPosted Apr 23, 2012, 4:45 AM
Baris TurkogluPosted Apr 23, 2012, 3:58 AM
Nitesh KejriwalPosted Apr 23, 2012, 3:38 AM
Baris TurkogluPosted Apr 23, 2012, 3:24 AM
If I remove the s:Body tag, I get this error.
The CoC data provided is not a valid XML document (Invalid root element: "SubmitVehiclePriceCalculationIdentifiers")
You see something else that could be a problem?
Best regards
Baris
Nitesh KejriwalPosted Apr 21, 2012, 9:54 PM