C# write to class - API klare resten
Hej Herinde.Jeg sidder lidt fast i at sende nogle data via API.
Kan fint trække data ud via API C#, men når jeg prøver at sende data til en Class sker der intet.
Jeg har prøvet en masse forskellige calls, men har nu simplificeret koden så den er mere overskuelig.
Jeg vil indsætte data(ordre) på et website via API.
Har lagt code behind og Classen jeg henviser til.*
Håber der er nogle der kan pege mig i den rigtige retning.
Der er noget dokumentation her.: https://api.smart-web.dk/doc/
Code behind call
WebServiceService objWebService = new WebServiceService();
protected void btnordercreate_Click(object sender, EventArgs e)
{
objWebService.CookieContainer = new System.Net.CookieContainer();
objWebService.Solution_Connect("USER", "PASSWORD");
objWebService.Solution_SetLanguage("DK");
OrderCreate OrderNew = new OrderCreate();
OrderNew.CurrencyId = 57;
OrderNew.CustomerComment = "test";
OrderNew.DeliveryId = 58;
OrderNew.DeliveryPrice = 1000;
OrderNew.Origin = "Test";
OrderNew.PaymentId = 58;
OrderNew.ReferenceNumber = "29374";
OrderNew.UserId = 18;
}
The Class
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.33440")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="https://api.smart-web.dk/service.php")]
public partial class OrderCreate {
private int currencyIdField;
private int userIdField;
private bool userIdFieldSpecified;
private int paymentIdField;
private int paymentOnlineIdField;
private bool paymentOnlineIdFieldSpecified;
private string customerCommentField;
private int deliveryIdField;
private double deliveryPriceField;
private bool deliveryPriceFieldSpecified;
private string referenceNumberField;
private OrderLineCreate[] orderLinesField;
private OrderCustomerCreate orderCustomerField;
private OrderTransactionCreate orderTransactionField;
private string originField;
private OrderDelivery deliveryField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public int CurrencyId {
get {
return this.currencyIdField;
}
set {
this.currencyIdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public int UserId {
get {
return this.userIdField;
}
set {
this.userIdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool UserIdSpecified {
get {
return this.userIdFieldSpecified;
}
set {
this.userIdFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public int PaymentId {
get {
return this.paymentIdField;
}
set {
this.paymentIdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public int PaymentOnlineId {
get {
return this.paymentOnlineIdField;
}
set {
this.paymentOnlineIdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool PaymentOnlineIdSpecified {
get {
return this.paymentOnlineIdFieldSpecified;
}
set {
this.paymentOnlineIdFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string CustomerComment {
get {
return this.customerCommentField;
}
set {
this.customerCommentField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public int DeliveryId {
get {
return this.deliveryIdField;
}
set {
this.deliveryIdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public double DeliveryPrice {
get {
return this.deliveryPriceField;
}
set {
this.deliveryPriceField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool DeliveryPriceSpecified {
get {
return this.deliveryPriceFieldSpecified;
}
set {
this.deliveryPriceFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ReferenceNumber {
get {
return this.referenceNumberField;
}
set {
this.referenceNumberField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlArrayItemAttribute("item", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
public OrderLineCreate[] OrderLines {
get {
return this.orderLinesField;
}
set {
this.orderLinesField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public OrderCustomerCreate OrderCustomer {
get {
return this.orderCustomerField;
}
set {
this.orderCustomerField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public OrderTransactionCreate OrderTransaction {
get {
return this.orderTransactionField;
}
set {
this.orderTransactionField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string Origin {
get {
return this.originField;
}
set {
this.originField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public OrderDelivery Delivery {
get {
return this.deliveryField;
}
set {
this.deliveryField = value;
}
}
}