I need to remove the namespace prefix from an un-SOAP'd message.
This is the message that has had the SOAP envelope removed. As you can see it contains ns1 prefix on the elements:
<ns1:BookingSource xmlns:ns1="urn:EDI/Booking/artifacts">
<ns1:BookingHeader>
<ns1:BookingNo>000123</ns1:BookingNo>
<ns1:BookingDate>01/01/2012</ns1:BookingDate>
<ns1:DSBookingDetail>
<ns1:BookingNo>000123</ns1:BookingNo>
<ns1:SeqNo>1</ns1:SeqNo>
<ns1:LineType>Item</ns1:LineType>
<ns1:ProductCode>Box</ns1:ProductCode>
</ns1:DSBookingDetail>
<ns1:DSBookingDetail>
<ns1:BookingNo>000123</ns1:BookingNo>
<ns1:SeqNo>2</ns1:SeqNo>
<ns1:LineType>Item</ns1:LineType>
<ns1:ProductCode>BrakeShoe</ns1:ProductCode>
</ns1:DSBookingDetail>
</ns1:DSBookingHeader>
<ns1:BookingHeader>
<ns1:BookingNo>000124</ns1:BookingNo>
<ns1:BookingDate>01/01/2012</ns1:BookingDate>
<ns1:DSBookingDetail>
<ns1:BookingNo>000124</ns1:BookingNo>
<ns1:SeqNo>1</ns1:SeqNo>
<ns1:LineType>Item</ns1:LineType>
<ns1:ProductCode>Box</ns1:ProductCode>
</ns1:DSBookingDetail>
<ns1:DSBookingDetail>
<ns1:BookingNo>000124</ns1:BookingNo>
<ns1:SeqNo>2</ns1:SeqNo>
<ns1:LineType>Item</ns1:LineType>
<ns1:ProductCode>BrakeShoe</ns1:ProductCode>
</ns1:DSBookingDetail>
</ns1:DSBookingHeader>
</ns1:BookingSource>
To this:
<BookingSource>
<BookingHeader>
<BookingNo>000123</BookingNo>
<BookingDate>01/01/2012</BookingDate>
<DSBookingDetail>
<BookingNo>000123</BookingNo>
<SeqNo>1</SeqNo>
<LineType>Item</LineType>
<ProductCode>Box</ProductCode>
</DSBookingDetail>
<DSBookingDetail>
<BookingNo>000123</BookingNo>
<SeqNo>2</SeqNo>
<LineType>Item</LineType>
<ProductCode>BrakeShoe</ProductCode>
</DSBookingDetail>
</DSBookingHeader>
<BookingHeader>
<BookingNo>000124</BookingNo>
<BookingDate>01/01/2012</BookingDate>
<DSBookingDetail>
<BookingNo>000124</BookingNo>
<SeqNo>1</SeqNo>
<LineType>Item</LineType>
<ProductCode>Box</ProductCode>
</DSBookingDetail>
<DSBookingDetail>
<BookingNo>000124</BookingNo>
<SeqNo>2</ns1:SeqNo>
<LineType>Item</LineType>
<ProductCode>BrakeShoe</ProductCode>
</DSBookingDetail>
</DSBookingHeader>
</BookingSource>
I've searched through the KB and found some hints on how to do it, but the final solution evades me.
Thanks,
Tony.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…