Create soap request
-
I've tried to serialize an object with XmlSerializer and SoapFormatter but i can't get the output to look like this: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Login xmlns="http://www.myfirm.com/2010/core/ConnectTypes"> <UserLogin> <UserName>User</UserName> <Password>PW</Password> <Mandant>1</Mandant> </UserLogin> </Login> </soap:Body> </soap:Envelope> My classes: [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class UserLoginType { private string userNameField; private string passwordField; private int mandantField; /// <remarks/> public string UserName { get { return this.userNameField; } set { this.userNameField = value; } } /// <remarks/> public string Password { get { return this.passwordField; } set { this.passwordField = value; } } /// <remarks/> public int Mandant { get { return this.mandantField; } set { this.mandantField = value; } } } [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class LoginType { private object itemField; /// <remarks/> [System.Xml.Serialization.XmlElementAttribute("LoginToken", typeof(string))] [System.Xml.Serialization.XmlElementAttribute("UserLogin", typeof(UserLoginType))] public object Item { get { return this.itemField; } set { this.itemField = value; } } } Can anyone help?
-
Answer:
To Log the SoapRequest try MessageInspector or enable the Logging in Web.Config for Web Service.
Sys at Stack Overflow Visit the source
Other answers
Generally, you do not have to serialize our objects way like that. You should add the Web-Reference via WSDL-url, and invoke methods of the service by the generated proxy class
VMAtm
Related Q & A:
- Where To Buy Soap Base In The Philippines?Best solution by Yahoo! Answers
- Where To Buy Soap Ingredients Manila?Best solution by Yahoo! Answers
- How To Make Soap?Best solution by Yahoo! Answers
- How to modify a SOAP request?Best solution by Stack Overflow
- How to send SOAP request Android?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.