Forum Discussion

ashragh22's avatar
ashragh22
New Contributor
11 years ago

how to get the namespace prefix through Groovy code

Hi,

I have a request which has default namespace. For this namespace there is no prefix designed by the developers.

So, SOAPUI internally creates a prefix for all the nodes under this namespace. I need to have a groovy code where I can get this namespace prefix which SOAPUI is generating for this namespace URI.

The default namespace in request which I am talking above is "http://www.travelport.com/soa/common/security/SessionContext_v1"

For details, please refer attached snapshot and below request xml.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:seat="http://www.travelport.com/gds/airline/seatmap/schema/SeatMap_v1_0" xmlns:shar="http://www.travelport.com/gds/common/schema/SharedBusinessServices_v2_0" xmlns:air="http://www.travelport.com/gds/airline/common/schema/Air_v2_0" xmlns:com="http://www.travelport.com/gds/common/schema/Common_v2_0">
<soapenv:Header>
<SessionContext xsi:schemaLocation="http://www.travelport.com/soa/common/security/SessionContext_v1 SessionContext_v1.xsd" xmlns="http://www.travelport.com/soa/common/security/SessionContext_v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<SessProp nm="COM:PseudoCityCode" val="39FU"/>
<SessProp nm="COM:CountryCode" val="NL"/>
<SessProp nm="COM:AgentDutyCode" val="AG"/>
<SessProp nm="COM:IATACode" val="99999992"/>
<SessProp nm="COM:OriginApplication" val="SMARTPOINT"/>
<SessProp nm="COM:GeoCityCode" val="STO"/>
<!--SessProp nm="1G:StaticGTID" val="DAF94E"/-->
<SessProp nm="1G:TPFSYSID" val="CRE"/>
<SessProp nm="1G:SourceType" val="G"/>
<SessProp nm="1G:SourceID" val="ECMPTS"/>
<SessProp nm="1G:VendorID" val="GWS"/>
<SessProp nm="1G:VendorType" val="G"/>
<SessProp nm="1G:SpecialChars" val="False"/>
<SessProp nm="1G:ProviderCode" val="1G"/>
<SessProp nm="1G:UserId" val="GWS/KLMSEATS"/>
<SessProp nm="1G:Password" val="Klmseat2011"/>
<SessProp nm="1G:LDVOverride" val="65"/>
<SessProp nm="1G:TerminalID" val="7A0ECC"/>
<SessProp nm="1G:AccessProfile" val="DynGalileoCopy_393F"/>
<SessProp nm="1G:AgentSine" val="E36560"/>
<SessProp nm="ACH:AirLineVendorId" val="1G"/>
<SessProp nm="ACH:ProviderCode" val="ACH"/>
<SessProp nm="ACH:UserId" val="ACH/SOAUser1"/>
<SessProp nm="ACH:Password" val="S3cretPwd01"/>
<SessProp nm="ACH:NonHostAccessProfileID" val="UD_1G_5X19_6D10C9"/>
<SessProp nm="ACH:TerminalId" val="7A0ECC"/>
<SessProp nm="ACH:AgentSine" val="E36560"/>
<SessProp nm="ACH:AirlineVendorID" val="1G"/>
<SessProp nm="COM:CurrencyCode" val="USD"/>
<SessProp nm="COM:PCCGDSAffinity" val="1G"/>
<SessProp nm="COM:ERSPNumber" val="45605486"/>
</SessionContext>
</soapenv:Header>
<soapenv:Body>
<p:SeatMapReq AuthorizedBy="" OverrideLogging="TRACE" TraceId="" xsi:schemaLocation="http://www.travelport.com/gds/airline/seatmap/schema/SeatMap_v1_0 seatMap/SeatMap_v1_0.xsd " xmlns:p="http://www.travelport.com/gds/airline/seatmap/schema/SeatMap_v1_0" xmlns:p1="http://www.travelport.com/gds/airline/common/schema/Air_v2_0" xmlns:p2="http://www.travelport.com/gds/common/schema/Common_v2_0" xmlns:p3="http://www.travelport.com/gds/common/schema/SharedBusinessServices_v2_0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<p:HostReservation Carrier="" CarrierLocatorCode="" ETicket="false" ProviderCode="1G" ProviderLocatorCode="WQ0SLY" UniversalLocatorCode=""/>
<p:CabinClass/>
<p:HostToken Host="" Key="">p:HostToken</p:HostToken>
<p:Passenger Age="" DOB="" Gender="" Key="1" Nationality="" TravelerType="" VIP="false">
<p2:BookingTravelerName First="" Last="" Middle="" Prefix="" Suffix=""/>
<p2:PhoneNumber AreaCode="" CountryCode="" Extension="" Key="" Location="" Number="" Text="" Type=""/>
<p2:EmergencyInfo>p2:EmergencyInfo</p2:EmergencyInfo>
<p2:Address Key=""/>
<p2:Email Comment="" EmailID="" Key="" Type=""/>
<p2:SSR Carrier="" CarrierSpecificText="" Description="" FreeText="" Key="" PassiveSegmentRef="" ProviderDefinedType="" ProviderReservationInfoRef="" SSRRuleRef="" SegmentRef="" Status="" Type="" URL="http://tempuri.org"/>
<p:AirSeatAssignment FlightDetailsRef="" Key="" Seat="" SeatTypeCode="" SegmentRef="" Status=""/>
</p:Passenger>
<p:SeatMapModifiers ReturnPricing="true"/>
<p3:AccessContext/>
</p:SeatMapReq>
</soapenv:Body>
</soapenv:Envelope>

Thanks,
Ashish