ITsolutionWizard
asked on
c# from web form to xml request and response
I have simple asp.net webpage with contact form. So when a button is clicked, it want to generate xml
String firstname = FirstName.Text,
String xmlstring = “<xml><person><firstname>” + firstname + “</firstname></person></xm l>”;
And then, want to take the xml string, and do a post method soap request to the server.abc.com.
And then, I should get response from the server.abc.com
How can I get start it using c#/asp.net?
Thanks
String firstname = FirstName.Text,
String xmlstring = “<xml><person><firstname>”
And then, want to take the xml string, and do a post method soap request to the server.abc.com.
And then, I should get response from the server.abc.com
How can I get start it using c#/asp.net?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Honestly, you will find loads of code samples should just google in separate parts (asp.net capture form data example, C# xml serialisation example, c# soap request example, etc.) All of these are independent of each other hence separate searches.
However, happy to help if you could share whatever you already have.
Still would insist to do it yourself as that would help you best.
However, happy to help if you could share whatever you already have.
Still would insist to do it yourself as that would help you best.
ASKER
I can't find any good working samples on google. Let me know if you have any good sources so I can start from there
asp.net webforms data capture:
https://docs.microsoft.com/en-us/aspnet/web-forms/overview/getting-started/creating-a-basic-web-forms-page
xml serialization:
https://support.microsoft.com/en-us/help/815813/how-to-serialize-an-object-to-xml-by-using-visual-c
c# soap request example
https://stackoverflow.com/questions/4791794/client-to-send-soap-request-and-received-response
Depending on security model of web-service you are calling this might change a little.
https://docs.microsoft.com/en-us/aspnet/web-forms/overview/getting-started/creating-a-basic-web-forms-page
xml serialization:
https://support.microsoft.com/en-us/help/815813/how-to-serialize-an-object-to-xml-by-using-visual-c
c# soap request example
https://stackoverflow.com/questions/4791794/client-to-send-soap-request-and-received-response
Depending on security model of web-service you are calling this might change a little.
In addition, if you have a wsdl of the web-service, just include a web-reference in your project and call a method as if the that method is in your C# project. Adding web-reference generate all the code required to make a soap request. Virtually NO CODE is required in this approach, but you almost no control over soap envelop.
ASKER
Actually, I look for something that work with request and response xml in common. I only want to see response status is successful or not.
ASKER