Force namespace prefix on SOAP request XML element

For server interoperability, I need to prepend a namespace to the XML request element generated from our proxy class. I've not yet been able to find a way to do this. This is the current XML state of affairs:

<soap:Body wsu:Id="Id-47d08eb9-e841-42b3-b28b-63683a64c13d" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlnsTongue Tiedoap="http://schemas.xmlsoap.org/soap/envelope/"><RequestList p5SurpriserganizationId="wtk" xmlnsStick out tongue5="urn:metoc:jmcbl:jmbl" xmlns="urn:metoc:jmcbl:jmbl"><p5:Request p5:clientRequestId="BLANK"><p5:InformationType><p5:MetocDataType><p5:GriddedData><p5:GriddedAnalysisForecast /><p5:Location><p5:BoundingBox p5:lowerLeftLatitude="37.7971323452104" p5:lowerLeftLongitude="-97.8238720881594" p5:upperRightLatitude="42.5770014690009" p5:upperRightLongitude="-92.1696366612365" /></p5:Location><p5:Time><p5:TimeRange p5Tongue TiedtartTime="2007-05-14T00:00:00" p5:endTime="2007-05-14T12:00:00" /></p5:Time><p5:GridParameter><p5Stick out tonguearameter p5Stick out tonguearameterName="temperatureAir" /><p5:VerticalDimension p5:upperLevel="1000" p5:lowerLevel="1000"><p5:MasterLayerName>ISBL</p5:MasterLayerName></p5:VerticalDimension></p5:GridParameter></p5:GriddedData></p5:MetocDataType></p5:InformationType><p5:RequestFormat p5:responseContainment="By reference" p5:transferAccessInstructionCode="https" /></p5:Request></RequestList></soap:Body>

Notice the first element after the SOAP body. This is the request element representing the web method. I need to prefix this request with the p5 namespace alias like all the other attributes, Hence:

<p5:RequestList p5SurpriserganizationId="wtk" xmlnsStick out tongue5="urn:metoc:jmcbl:jmbl" xmlns="urn:metoc:jmcbl:jmbl">

I realize I may need to write some sort of manual formatter to do this. However, there is another complication. This is a WS-Secure message and needs to be signed. Therefore, and changes to the SOAP body after signing will invalidate the signature. So, my question is:

  1. Are there any attributes I can use to decorate the webmethod in the proxy class to force prepending a namespace
  2. If not, is there a way to intercept the SOAP message after serialization but before WSE intercepts the message and adds the WS-Security headers and signs the message.

Thanks in advance.

[3783 byte] By [rhussmann] at [2008-1-3]

.NET Development

Site Classified