Answered by:
Modifying the namespace prefix in the soap envelope when sending a request

Question
-
Here is an example of what I need to do below. I need to add the pol namespace prefix to the soap envelope
<soapenv:Envelope xmlns:soapenv="http://schemas.
xmlsoap.org/soap/envelope/ " xmlns:pol="http://schemas.phisc.org.za/draft/policy ">Monday, September 5, 2016 6:29 PM
Answers
-
Hi Kirk,
>> I need to add the pol namespace prefix to the soap envelope
For modifying prefix when sending a request, you could implement custom Message Formatters, and IClientMessageFormatter is for client side. You could refer the link below for more information.
# WCF Extensibility – Message Formatters
https://blogs.msdn.microsoft.com/carlosfigueira/2011/05/02/wcf-extensibility-message-formatters/
Here is a similar thread, and you could try
writer.WriteAttributeString("xmlns", "pol", null, http://schemas.phisc.org.za/draft/policy);
# Namespace prefix in the SOAP envelope
https://social.msdn.microsoft.com/Forums/vstudio/en-US/d52e51fd-16a5-425f-b1d3-67ecf9fc1608/namespace-prefix-in-the-soap-envelope?forum=wcf
Best Regards,
Edward
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Edward8520Microsoft contingent staff Tuesday, September 13, 2016 9:22 AM
- Marked as answer by Edward8520Microsoft contingent staff Friday, September 16, 2016 6:59 AM
Tuesday, September 6, 2016 5:11 AM
All replies
-
I have a class that was generated from the svcutil tool. This class is serialized to an xml document when. I need to find a way to add a namespace prefix to the class when the class gets serialized.
- Merged by Edward8520Microsoft contingent staff Monday, September 19, 2016 9:58 AM same issue
Monday, September 5, 2016 1:10 PM -
Hi Kirk,
>> I need to add the pol namespace prefix to the soap envelope
For modifying prefix when sending a request, you could implement custom Message Formatters, and IClientMessageFormatter is for client side. You could refer the link below for more information.
# WCF Extensibility – Message Formatters
https://blogs.msdn.microsoft.com/carlosfigueira/2011/05/02/wcf-extensibility-message-formatters/
Here is a similar thread, and you could try
writer.WriteAttributeString("xmlns", "pol", null, http://schemas.phisc.org.za/draft/policy);
# Namespace prefix in the SOAP envelope
https://social.msdn.microsoft.com/Forums/vstudio/en-US/d52e51fd-16a5-425f-b1d3-67ecf9fc1608/namespace-prefix-in-the-soap-envelope?forum=wcf
Best Regards,
Edward
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Edward8520Microsoft contingent staff Tuesday, September 13, 2016 9:22 AM
- Marked as answer by Edward8520Microsoft contingent staff Friday, September 16, 2016 6:59 AM
Tuesday, September 6, 2016 5:11 AM -
Hi Kirk,
I found you have posted a new thread Modifying the namespace prefix in the soap envelope when sending a request later. Are they the same issue? If they are, I would suggest you delete this thread, and keeping following the new thread. If not, it would be helpful if you could share us more information like how did you call this class.
Best Regards,
Edward
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Tuesday, September 6, 2016 5:15 AM