Apache Axis Charset Wrong Encoding on Tomcat? - web-services

I call a web service via Apache Axis Client in Tomcat server. I get ISO-8859-1 encoded response xml instead of UTF-8. When i simply run this client form main method, everything works as excepted. Below is an example request and response xml log. Please help!
In Message:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:getContactInformation
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://extranet.turkcell.com.tr/webServices/toskaWebService">
<longVal href="#id0" />
<longVal0 href="#id1" />
<longVal1 href="#id2" />
<longVal2 href="#id3" />
<integer href="#id4" />
<integer0 href="#id5" />
<integer1 href="#id6" />
<integer2 href="#id7" />
</ns1:getContactInformation>
<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">-1</multiRef>
<multiRef id="id6" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">408</multiRef>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">-1</multiRef>
<multiRef id="id2" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">5322067832</multiRef>
<multiRef id="id3" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">-1</multiRef>
<multiRef id="id5" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">100</multiRef>
<multiRef id="id7" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef>
<multiRef id="id4" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1</multiRef>
</soapenv:Body>
</soapenv:Envelope>
Out Message:
<?xml version="1.0" encoding="ISO-8859-9" standalone="yes"?>
<env:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header></env:Header>
<env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<m:getContactInformationResponse
xmlns:m="http://extranet.turkcell.com.tr/webServices/toskaWebService">
<result xmlns:n1="java:com.turkcell.toska.model" xsi:type="n1:WSContactList">
<addresslist soapenc:arrayType="n1:WSAddress[1]">
<WSAddress xsi:type="n1:WSAddress">
<address1 xsi:type="xsd:string">7-8 Mah. I 9 C Kap�s�</address1>
<address2 xsi:type="xsd:string">�orak�� Sok. No:111</address2>
<address3 xsi:type="xsd:string">Gazzosmanpa�a</address3>
<addressID xsi:type="xsd:long">0</addressID>
<addressStatus xsi:type="xsd:int">0</addressStatus>
<addresstype xsi:type="xsd:int">0</addresstype>
<addressusage xsi:type="xsd:int">1</addressusage>
<cityCode xsi:type="xsd:int">72</cityCode>
<cityName xsi:nil="true"></cityName>
<countryCode xsi:type="xsd:int">1</countryCode>
<usageStatus xsi:type="xsd:int">0</usageStatus>
<zipCode xsi:type="xsd:string">72439</zipCode>
</WSAddress>
</addresslist>
<emaillist soapenc:arrayType="n1:WSEmailInfo[0]"></emaillist>
<errMessage xsi:type="xsd:string"></errMessage>
<phonelist soapenc:arrayType="n1:WSPhone[1]">
<WSPhone xsi:type="n1:WSPhone">
<addressID xsi:type="xsd:long">0</addressID>
<addressStatus xsi:type="xsd:int">0</addressStatus>
<extension xsi:nil="true"></extension>
<generationDate xsi:nil="true"></generationDate>
<modificationDate xsi:nil="true"></modificationDate>
<phonenumber xsi:type="xsd:string">2125487549</phonenumber>
<phonenumbertype xsi:type="xsd:int">100</phonenumbertype>
<usageStatus xsi:type="xsd:int">0</usageStatus>
</WSPhone>
</phonelist>
<resultcode xsi:type="xsd:int">0</resultcode>
</result>
</m:getContactInformationResponse>
</env:Body>
</env:Envelope>

you can try following codes.
Stub._setProperty(Call.CHARACTER_SET_ENCODING, "ISO-8859-9");

Related

Building SOAP request from WSDL

I need to execute a SOAP request to an external server. I have never worked with SOAP before, but I know the basics of REST.
I've been given this following WSDL file and this example query:
<Messages>
<Version Ds_Version="0.0">
<Message>
<Detail>
<Ds_MerchantCode>999008881</Ds_MerchantCode>
<Ds_Terminal>1</Ds_Terminal>
<Ds_Order>5799L</Ds_Order>
<Ds_TransactionType>3</Ds_TransactionType>
</Detail>
</Message>
</Version>
<Signature>UfECD0KD9Wwo1iqY6PYZoJxw8KwMUz8m18bgLyH3BCI=</Signature>
<SignatureVersion>HMAC_SHA256_V1</SignatureVersion>
</Messages>
I'm using Postman in order to test the API. Following some instructions I found on the internet, I added a Content-Type HTTP header with value text/xml and the SOAPAction HTTP header with value consultaOperaciones as found in the WSDL file.
I've set this body:
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body xmlns:m="http://webservices.apl02.redsys.es">
<m:consultaOperacionesRequest>
<Messages>
<Version Ds_Version="0.0">
<Message>
<Transaction>
<Ds_MerchantCode>999008881</Ds_MerchantCode>
<Ds_Terminal>1</Ds_Terminal>
<Ds_Order>5799L</Ds_Order>
<Ds_TransactionType>3</Ds_TransactionType>
</Transaction>
</Message>
</Version>
<Signature>1KoxTgTakbTprzJ2N/e9JJ8yw/C3QzeNafbUMCNGSFM=</Signature>
<SignatureVersion>HMAC_SHA256_V1</SignatureVersion>
</Messages>
</m:consultaOperacionesRequest>
</soap:Body>
</soap:Envelope>
However, when I send the request I receive the following error message:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<soapenv:Fault>
<faultcode>Server</faultcode>
<faultstring>Internal Error</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
It's a generic SOAP error message, therefore I think that the problem has to be related to the codification instead of the external service.
Thanks in advance.
In the WSDL file you will see that the XML should be sent as a string:
<element name="consultaOperaciones">
<complexType>
<sequence>
<element name="cadenaXML" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</element>
Hence the XML sent should be:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.apl02.redsys.es">
<soapenv:Header/>
<soapenv:Body>
<web:consultaOperaciones>
<cadenaXML><![CDATA[
<Messages>
<Version Ds_Version="0.0">
<Message>
<Detail>
<Ds_MerchantCode>999008881</Ds_MerchantCode>
<Ds_Terminal>1</Ds_Terminal>
<Ds_Order>5799L</Ds_Order>
<Ds_TransactionType>3</Ds_TransactionType>
</Detail>
</Message>
</Version>
<Signature>UfECD0KD9Wwo1iqY6PYZoJxw8KwMUz8m18bgLyH3BCI=</Signature>
<SignatureVersion>HMAC_SHA256_V1</SignatureVersion>
</Messages>
]]>
</cadenaXML>
</web:consultaOperaciones>
</soapenv:Body>
</soapenv:Envelope>
Note that we are using CDATA because as mentioned the XML message should be sent as a string based on the WSDL. I have tried running it and got the response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<p259:consultaOperacionesResponse xmlns:p259="http://webservices.apl02.redsys.es">
<consultaOperacionesReturn><![CDATA[<Messages><Version Ds_Version="0.0"><Message><ErrorMsg><Ds_ErrorCode>XML0023</Ds_ErrorCode></ErrorMsg></Message></Version></Messages>]]></consultaOperacionesReturn>
</p259:consultaOperacionesResponse>
</soapenv:Body>
</soapenv:Envelope>
This means that your message is being parsed now because there are no server errors and a consultaOperacionesResponse is being sent which looks legit. The error seems to be related to the data being sent but in general the API is working fine as expected.

Why authorize purchase api returning numericString xml field

i am sending purchase request in xml with createcustomer profile.
customerProfileId is returning good but customerpayment profile id is returning in field customerPaymentProfileIdList > numericString.
here is full response.
<?xml version="1.0" encoding="utf-8"?>
<createTransactionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<messages>
<resultCode>Ok</resultCode>
<message>
<code>I00001</code>
<text>Successful.</text>
</message>
</messages>
<transactionResponse>
<responseCode>1</responseCode>
<authCode>R7BVRZ</authCode>
<avsResultCode>Y</avsResultCode>
<cvvResultCode>P</cvvResultCode>
<cavvResultCode>2</cavvResultCode>
<transId>60032752664</transId>
<refTransID />
<transHash>C1F3242645F7F118D709452E5758AF35</transHash>
<testRequest>0</testRequest>
<accountNumber>XXXX0015</accountNumber>
<accountType>MasterCard</accountType>
<messages>
<message>
<code>1</code>
<description>This transaction has been approved.</description>
</message>
</messages>
<transHashSha2 />
</transactionResponse>
<profileResponse>
<messages>
<resultCode>Ok</resultCode>
<message>
<code>I00001</code>
<text>Successful.</text>
</message>
</messages>
<customerProfileId>1813409569</customerProfileId>
<customerPaymentProfileIdList>
<numericString>1808086931</numericString>
</customerPaymentProfileIdList>
<customerShippingAddressIdList />
</profileResponse>
</createTransactionResponse>

Sabre AirTicketLLSRQ error: PNR HAS BEEN UPDATED-IGN AND RETRY-0049

I'm trying to do Issue Air Ticket workflow, but AirTicketLLSRQ returns error:
PNR HAS BEEN UPDATED-IGN AND RETRY-0049
Before this, I'm creating PNR with PassengerDetailsRQ method.
Request:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader">
<From>
<PartyId>WebServiceClient</PartyId>
</From>
<To>
<PartyId>WebServiceSupplier</PartyId>
</To>
<CPAId>4PFI</CPAId>
<ConversationId>SWS-Test-4PFI</ConversationId>
<Service>PassengerDetails</Service>
<Action>PassengerDetailsRQ</Action>
<MessageData>
<MessageId>9314594d-6c40-406b-9029-b887b13906b6</MessageId>
<Timestamp>2017-07-11T08:57:38Z</Timestamp>
</MessageData>
</MessageHeader>
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">
<BinarySecurityToken>
Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/CERTG!ICESMSLB\/CRT.LB!-3255696707179766905!1188118!0
</BinarySecurityToken>
</Security>
</soap:Header>
<soap:Body>
<PassengerDetailsRQ xmlns="http://services.sabre.com/sp/pd/v3_3" version="3.3.0" IgnoreOnError="false"
HaltOnError="false">
<PostProcessing IgnoreAfter="false" RedisplayReservation="true">
<EndTransactionRQ>
<EndTransaction Ind="true">
<Email Ind="true">
<Itinerary Ind="true">
<PDF Ind="true"/>
<Segment Number="1"/>
</Itinerary>
</Email>
</EndTransaction>
<Source ReceivedFrom="TEST"/>
</EndTransactionRQ>
</PostProcessing>
<SpecialReqDetails>
<AddRemarkRQ>
<RemarkInfo>
<Remark Code="H" SegmentNumber="1" Type="General">
<Text>TEXT</Text>
</Remark>
</RemarkInfo>
</AddRemarkRQ>
<SpecialServiceRQ>
<SpecialServiceInfo>
<AdvancePassenger SegmentNumber="A">
<!-- 2. a legal LLS request -->
<Document ExpirationDate="2018-05-26" Number="1234567890" Type="P">
<IssueCountry>FR</IssueCountry>
<NationalityCountry>FR</NationalityCountry>
</Document>
<PersonName DateOfBirth="1980-12-02" Gender="M" NameNumber="1.1" DocumentHolder="true">
<GivenName>JAMES</GivenName>
<MiddleName>MALCOLM</MiddleName>
<Surname>GREEN</Surname>
</PersonName>
<VendorPrefs>
<Airline Hosted="false"/>
</VendorPrefs>
</AdvancePassenger>
<SecureFlight SegmentNumber="A">
<PersonName DateOfBirth="1980-12-02" Gender="M" NameNumber="1.1">
<GivenName>JAMES</GivenName>
<Surname>GREEN</Surname>
</PersonName>
</SecureFlight>
</SpecialServiceInfo>
</SpecialServiceRQ>
</SpecialReqDetails>
<TravelItineraryAddInfoRQ>
<AgencyInfo>
<Address>
<AddressLine>SABRE TRAVEL</AddressLine>
<CityName>SOUTHLAKE</CityName>
<CountryCode>US</CountryCode>
<PostalCode>76092</PostalCode>
<StateCountyProv StateCode="TX"/>
<StreetNmbr>3150 SABRE DRIVE</StreetNmbr>
<VendorPrefs>
<Airline Hosted="true"/>
</VendorPrefs>
</Address>
<Ticketing TicketType="7T-"/>
</AgencyInfo>
<CustomerInfo>
<ContactNumbers>
<ContactNumber Phone="817-555-1212" PhoneUseType="A"/>
</ContactNumbers>
<Email Address="yury.patrin#gmail.com" NameNumber="1.1"/>
<PersonName NameNumber="1.1">
<GivenName>JAMES</GivenName>
<Surname>GREEN</Surname>
</PersonName>
</CustomerInfo>
</TravelItineraryAddInfoRQ>
</PassengerDetailsRQ>
</soap:Body>
</soap:Envelope>
Response:
<?xml version="1.0" encoding="utf-8"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
<eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1.0" soap-env:mustUnderstand="1">
<eb:From>
<eb:PartyId eb:type="URI">WebServiceSupplier</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId eb:type="URI">WebServiceClient</eb:PartyId>
</eb:To>
<eb:CPAId>4PFI</eb:CPAId>
<eb:ConversationId>SWS-Test-4PFI</eb:ConversationId>
<eb:Service>PassengerDetails</eb:Service>
<eb:Action>PassengerDetailsRS</eb:Action>
<eb:MessageData>
<eb:MessageId>1i9226s68</eb:MessageId>
<eb:Timestamp>2017-07-11T08:50:23</eb:Timestamp>
<eb:RefToMessageId>9314594d-6c40-406b-9029-b887b13906b6</eb:RefToMessageId>
</eb:MessageData>
</eb:MessageHeader>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
<wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">
Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/CERTG!ICESMSLB\/CRT.LB!-3255696707179766905!1188118!0
</wsse:BinarySecurityToken>
</wsse:Security>
</soap-env:Header>
<soap-env:Body>
<PassengerDetailsRS xmlns="http://services.sabre.com/sp/pd/v3_3">
<ApplicationResults xmlns="http://services.sabre.com/STL_Payload/v02_01" status="Complete">
<Success timeStamp="2017-07-11T03:50:23.635-05:00"/>
<Warning type="BusinessLogic" timeStamp="2017-07-11T03:50:23.469-05:00">
<SystemSpecificResults>
<Message code="WARN.SWS.HOST.WARNING_RESPONSE">EndTransactionLLSRQ: TTY REQ PEND</Message>
</SystemSpecificResults>
</Warning>
</ApplicationResults>
<ItineraryRef ID="PGAAHT"/>
<TravelItineraryReadRS>
<TravelItinerary>
<CustomerInfo>
<Address>
<AddressLine type="N">SABRE TRAVEL</AddressLine>
<AddressLine type="A">3150 SABRE DRIVE</AddressLine>
<AddressLine type="C">SOUTHLAKE, TX US</AddressLine>
<AddressLine type="Z">76092</AddressLine>
</Address>
<ContactNumbers>
<ContactNumber LocationCode="IEV" Phone="817-555-1212-A" RPH="001"/>
</ContactNumbers>
<PersonName NameNumber="01.01" RPH="1" WithInfant="false">
<Email>YURY.PATRIN#GMAIL.COM</Email>
<GivenName>JAMES</GivenName>
<Surname>GREEN</Surname>
</PersonName>
</CustomerInfo>
<ItineraryInfo>
<ReservationItems>
<Item RPH="1">
<FlightSegment AirMilesFlown="0484" ArrivalDateTime="08-13T08:45" DayOfWeekInd="7" DepartureDateTime="2017-08-13T07:05" ElapsedTime="01.40" FlightNumber="0465" IsPast="false" NumberInParty="01" ResBookDesigCode="Y" SegmentNumber="0001" SmokingAllowed="false" SpecialMeal="false" Status="HK" StopQuantity="00" eTicket="false">
<DestinationLocation LocationCode="HKG" Terminal="TERMINAL 1" TerminalCode="1"/>
<Equipment AirEquipType="773"/>
<MarketingAirline Code="CX" FlightNumber="0465"/>
<Meal Code="B"/>
<OriginLocation LocationCode="TPE" Terminal="TERMINAL 1" TerminalCode="1"/>
<SupplierRef ID="DCCX"/>
<UpdatedArrivalTime>08-13T08:45</UpdatedArrivalTime>
<UpdatedDepartureTime>08-13T07:05</UpdatedDepartureTime>
</FlightSegment>
</Item>
</ReservationItems>
<Ticketing RPH="01" TicketTimeLimit="T-"/>
</ItineraryInfo>
<ItineraryRef AirExtras="false" ID="PGAAHT" InhibitCode="U" PartitionID="AA" PrimeHostID="1S">
<Source AAA_PseudoCityCode="4PFI" CreateDateTime="2017-07-11T03:50" CreationAgent="AWS" HomePseudoCityCode="4PFI" LastUpdateDateTime="2017-07-11T03:50" PseudoCityCode="4PFI" ReceivedFrom="TEST" SequenceNumber="1"/>
</ItineraryRef>
<RemarkInfo>
<Remark RPH="001" Type="General">
<Text>TEXT</Text>
</Remark>
</RemarkInfo>
<SpecialServiceInfo RPH="001" Type="GFX">
<Service SSR_Code="SSR" SSR_Type="DOCS">
<Airline Code="CX"/>
<PersonName NameNumber="01.01">GREEN/JAMES</PersonName>
<Text>
HK1/P/FR/1234567890/FR/02DEC1980/M/26MAY2018/GREEN/JAMES/MALCOLM/H
</Text>
</Service>
</SpecialServiceInfo>
</TravelItinerary>
</TravelItineraryReadRS>
</PassengerDetailsRS>
</soap-env:Body>
</soap-env:Envelope>
After this request I recieved booking confirmation on my email. Then, I do DesignatePrinterLLSRQ and TravelItineraryReadRQ.
TravelItineraryReadRQ Request:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader">
<From>
<PartyId>WebServiceClient</PartyId>
</From>
<To>
<PartyId>WebServiceSupplier</PartyId>
</To>
<CPAId>4PFI</CPAId>
<ConversationId>SWS-Test-4PFI</ConversationId>
<Service>TravelItineraryRead</Service>
<Action>TravelItineraryReadRQ</Action>
<MessageData>
<MessageId>9314594d-6c40-406b-9029-b887b13906b6</MessageId>
<Timestamp>2017-07-11T08:36:19Z</Timestamp>
</MessageData>
</MessageHeader>
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">
<BinarySecurityToken>
Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/CERTG!ICESMSLB\/CRT.LB!-3255700571383677304!1140614!0
</BinarySecurityToken>
</Security>
</soap:Header>
<soap:Body>
<TravelItineraryReadRQ xmlns="http://services.sabre.com/res/tir/v3_9"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dd="http://webservices.sabre.com/dd2" Version="3.9.0">
<MessagingDetails>
<SubjectAreas>
<SubjectArea>FULL</SubjectArea>
</SubjectAreas>
</MessagingDetails>
<UniqueID ID=""/>
<EchoToken/>
</TravelItineraryReadRQ>
</soap:Body>
</soap:Envelope>
Response:
<?xml version="1.0" encoding="utf-8"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
<eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1.0"
soap-env:mustUnderstand="1">
<eb:From>
<eb:PartyId eb:type="URI">WebServiceSupplier</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId eb:type="URI">WebServiceClient</eb:PartyId>
</eb:To>
<eb:CPAId>4PFI</eb:CPAId>
<eb:ConversationId>SWS-Test-4PFI</eb:ConversationId>
<eb:Service>TravelItineraryRead</eb:Service>
<eb:Action>TravelItineraryReadRS</eb:Action>
<eb:MessageData>
<eb:MessageId>2506522311129290610</eb:MessageId>
<eb:Timestamp>2017-07-11T08:38:33</eb:Timestamp>
<eb:RefToMessageId>9314594d-6c40-406b-9029-b887b13906b6</eb:RefToMessageId>
</eb:MessageData>
</eb:MessageHeader>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
<wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">
Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/CERTG!ICESMSLB\/CRT.LB!-3255700571383677304!1140614!0
</wsse:BinarySecurityToken>
</wsse:Security>
</soap-env:Header>
<soap-env:Body>
<tir39:TravelItineraryReadRS xmlns:tir39="http://services.sabre.com/res/tir/v3_9"
xmlns:or8="http://services.sabre.com/res/or/v1_8"
xmlns:stl="http://services.sabre.com/STL/v01"
xmlns:or19="http://services.sabre.com/res/or/v1_9" Version="3.9.0">
<stl:ApplicationResults status="Complete">
<stl:Success timeStamp="2017-07-11T03:38:33.392-05:00"/>
</stl:ApplicationResults>
<tir39:TravelItinerary>
<tir39:CustomerInfo>
<tir39:Address>
<tir39:AddressLine Id="8" type="N">SABRE TRAVEL</tir39:AddressLine>
<tir39:AddressLine Id="9" type="A">3150 SABRE DRIVE</tir39:AddressLine>
<tir39:AddressLine Id="10" type="C">SOUTHLAKE, TX US</tir39:AddressLine>
<tir39:AddressLine Id="11" type="Z">76092</tir39:AddressLine>
</tir39:Address>
<tir39:ContactNumbers>
<tir39:ContactNumber LocationCode="IEV" Phone="817-555-1212-A" RPH="001" Id="7"/>
</tir39:ContactNumbers>
<tir39:PersonName WithInfant="false" NameNumber="01.01" RPH="1" elementId="pnr-4.1">
<tir39:Email Id="6">YURY.PATRIN#GMAIL.COM</tir39:Email>
<tir39:GivenName>JAMES</tir39:GivenName>
<tir39:Surname>GREEN</tir39:Surname>
</tir39:PersonName>
</tir39:CustomerInfo>
<tir39:ItineraryInfo>
<tir39:ReservationItems>
<tir39:Item RPH="1">
<tir39:FlightSegment AirMilesFlown="0484" ArrivalDateTime="08-13T08:45" DayOfWeekInd="7"
DepartureDateTime="2017-08-13T07:05"
SegmentBookedDate="2017-07-11T03:34:00" ElapsedTime="01.40"
eTicket="false" FlightNumber="0465" NumberInParty="01"
ResBookDesigCode="Y" SegmentNumber="0001" SmokingAllowed="false"
SpecialMeal="false" Status="HK" StopQuantity="00" IsPast="false"
CodeShare="false" Id="3">
<tir39:DestinationLocation LocationCode="HKG" Terminal="TERMINAL 1" TerminalCode="1"/>
<tir39:Equipment AirEquipType="773"/>
<tir39:MarketingAirline Code="CX" FlightNumber="0465">
<tir39:Banner>MARKETED BY CATHAY PACIFIC AIRWAYS</tir39:Banner>
</tir39:MarketingAirline>
<tir39:Meal Code="B"/>
<tir39:OperatingAirline Code="CX" FlightNumber="0465" ResBookDesigCode="Y">
<tir39:Banner>OPERATED BY CATHAY PACIFIC AIRWAYS</tir39:Banner>
</tir39:OperatingAirline>
<tir39:OperatingAirlinePricing Code="CX"/>
<tir39:DisclosureCarrier Code="CX" DOT="false">
<tir39:Banner>CATHAY PACIFIC AIRWAYS</tir39:Banner>
</tir39:DisclosureCarrier>
<tir39:OriginLocation LocationCode="TPE" Terminal="TERMINAL 1" TerminalCode="1"/>
<tir39:SupplierRef ID="DCCX"/>
<tir39:UpdatedArrivalTime>08-13T08:45</tir39:UpdatedArrivalTime>
<tir39:UpdatedDepartureTime>08-13T07:05</tir39:UpdatedDepartureTime>
</tir39:FlightSegment>
</tir39:Item>
</tir39:ReservationItems>
<tir39:Ticketing RPH="01" TicketTimeLimit="T-"/>
</tir39:ItineraryInfo>
<tir39:ItineraryRef AirExtras="false" ID="UJUDSY" InhibitCode="U" PartitionID="AA" PrimeHostID="1S">
<tir39:Source AAA_PseudoCityCode="4PFI" CreateDateTime="2017-07-11T03:34" CreationAgent="AWS"
HomePseudoCityCode="4PFI" PseudoCityCode="4PFI" ReceivedFrom="TEST"
LastUpdateDateTime="2017-07-11T03:34" SequenceNumber="1"/>
</tir39:ItineraryRef>
<tir39:RemarkInfo>
<tir39:Remark RPH="001" Type="General" Id="14">
<tir39:Text>TEXT</tir39:Text>
</tir39:Remark>
</tir39:RemarkInfo>
<tir39:SpecialServiceInfo RPH="001" Type="GFX" Id="12">
<tir39:Service SSR_Code="SSR" SSR_Type="DOCS">
<tir39:Airline Code="CX"/>
<tir39:PersonName NameNumber="01.01">GREEN/JAMES</tir39:PersonName>
<tir39:Text>
HK1/P/FR/1234567890/FR/02DEC1980/M/26MAY2018/GREEN/JAMES/MALCOLM/H
</tir39:Text>
</tir39:Service>
</tir39:SpecialServiceInfo>
<tir39:SpecialServiceInfo RPH="002" Type="GFX" Id="13">
<tir39:Service SSR_Code="SSR" SSR_Type="DOCS">
<tir39:Airline Code="CX"/>
<tir39:PersonName NameNumber="01.01">GREEN/JAMES</tir39:PersonName>
<tir39:Text>HK1/DB/02DEC1980/M/GREEN/JAMES</tir39:Text>
</tir39:Service>
</tir39:SpecialServiceInfo>
</tir39:TravelItinerary>
</tir39:TravelItineraryReadRS>
</soap-env:Body>
</soap-env:Envelope>
And then I do AirTicketLLSRQ.
Request:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader">
<From>
<PartyId>WebServiceClient</PartyId>
</From>
<To>
<PartyId>WebServiceSupplier</PartyId>
</To>
<CPAId>4PFI</CPAId>
<ConversationId>SWS-Test-4PFI</ConversationId>
<Service>AirTicketRQ</Service>
<Action>AirTicketLLSRQ</Action>
<MessageData>
<MessageId>9314594d-6c40-406b-9029-b887b13906b6</MessageId>
<Timestamp>2017-07-11T08:39:43Z</Timestamp>
</MessageData>
</MessageHeader>
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">
<BinarySecurityToken>
Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/CERTG!ICESMSLB\/CRT.LB!-3255700571383677304!1140614!0
</BinarySecurityToken>
</Security>
</soap:Header>
<soap:Body>
<AirTicketRQ xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" NumResponses="1" Version="2.10.0"
ReturnHostCommand="true">
<OptionalQualifiers>
<FlightQualifiers>
<VendorPrefs>
<Airline Code="CX"/>
</VendorPrefs>
</FlightQualifiers>
<MiscQualifiers>
<Ticket Type="ETR"/>
</MiscQualifiers>
<PricingQualifiers>
<PriceQuote>
<Record Number="1"/>
</PriceQuote>
</PricingQualifiers>
</OptionalQualifiers>
</AirTicketRQ>
</soap:Body>
</soap:Envelope>
Response:
<?xml version="1.0" encoding="utf-8"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
<eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1.0"
soap-env:mustUnderstand="1">
<eb:From>
<eb:PartyId eb:type="URI">WebServiceSupplier</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId eb:type="URI">WebServiceClient</eb:PartyId>
</eb:To>
<eb:CPAId>4PFI</eb:CPAId>
<eb:ConversationId>SWS-Test-4PFI</eb:ConversationId>
<eb:Service>AirTicketRQ</eb:Service>
<eb:Action>AirTicketLLSRS</eb:Action>
<eb:MessageData>
<eb:MessageId>393675312556970611</eb:MessageId>
<eb:Timestamp>2017-07-11T08:40:56</eb:Timestamp>
<eb:RefToMessageId>9314594d-6c40-406b-9029-b887b13906b6</eb:RefToMessageId>
</eb:MessageData>
</eb:MessageHeader>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
<wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">
Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/CERTG!ICESMSLB\/CRT.LB!-3255700571383677304!1140614!0
</wsse:BinarySecurityToken>
</wsse:Security>
</soap-env:Header>
<soap-env:Body>
<AirTicketRS xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:stl="http://services.sabre.com/STL/v01"
Version="2.10.0">
<stl:ApplicationResults status="NotProcessed">
<stl:Error type="BusinessLogic" timeStamp="2017-07-11T03:40:56-05:00">
<stl:SystemSpecificResults>
<stl:HostCommand LNIATA="757110">W¥PQ1¥ETR¥ACX</stl:HostCommand>
<stl:Message>PNR HAS BEEN UPDATED-IGN AND RETRY-0049</stl:Message>
<stl:ShortText>ERR.SWS.HOST.ERROR_IN_RESPONSE</stl:ShortText>
</stl:SystemSpecificResults>
</stl:Error>
</stl:ApplicationResults>
</AirTicketRS>
</soap-env:Body>
</soap-env:Envelope>
How can I fix this error? Maybe I am doing something wrong?
What you encountered is quite a normal situation (but unwanted).
Solution to this is to run (but only after you detect PNR HAS BEEN UPDATED-IGN AND RETRY error)
ignore command
rerun AirTicketRQ (exactly the same that failed in the first run)
As far as Ignore command is concerned what you should know is that it will ignore (cancel) all your PNR changes since the last successful EndTransactionRQ, so it's best to have everything saved before AirTicketRQ is expected to be run
Example of ignore command (IR in HostCommand will trigger ignore transaction) :
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<ns4:MessageHeader xmlns:ns8="http://www.w3.org/2000/09/xmldsig#" xmlns:ns7="http://www.opentravel.org/OTA/2002/11" xmlns:ns6="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ns5="http://www.w3.org/1999/xlink" xmlns:ns4="http://www.ebxml.org/namespaces/messageHeader">
<ns4:ConversationId> CONVERSATION_ID </ns4:ConversationId>
<ns4:From>
<ns4:PartyId ns4:type="urn:x12.org:IO5:01"> PARTY_ID_FROM </ns4:PartyId>
<ns4:Role></ns4:Role>
</ns4:From>
<ns4:To>
<ns4:PartyId ns4:type="urn:x12.org:IO5:01"> PARTY_ID_TO </ns4:PartyId>
<ns4:Role></ns4:Role>
</ns4:To>
<ns4:CPAId>GF</ns4:CPAId>
<ns4:Service ns4:type="OTA"></ns4:Service>
<ns4:Action>SabreCommandLLSRQ</ns4:Action>
</ns4:MessageHeader>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
<wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary"> BOOKING_PROVIDER_SESSION </wsse:BinarySecurityToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<SabreCommandLLSRQ xmlns="http://webservices.sabre.com/sabreXML/2003/07" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" TimeStamp="2014-03-04T14:00:00" Version="1.8.1">
<Request Output="SCREEN" CDATA="true">
<HostCommand>IR</HostCommand>
</Request>
</SabreCommandLLSRQ>
</soap:Body>
</soap:Envelope>
Sabre is launching a new Orchestrated AirTicketRQ service that will automate and simplify many of these items, and much much more magic. If you are interested, please let us know...

Apache CXF:The message has expired

Environment :
Apache CXF 2.7.8
Jboss EAP 6
SoapUI for testing client Side
I tried to implement for simple authentication i.e with password simple text type, it is working but when i tried to implement for password digest type ,then giving me exception:
unwinding now: org.apache.cxf.binding.soap.SoapFault: The message has
expired org.apache.ws.security.WSSecurityException: The message has
expired
I am giving new nonce value for each request and time within five min diff
WSS4JInInterceptor Bean class defination:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<jaxws:endpoint id="orderProcess" implementor="demo.order.OrderProcessImpl" address="/OrderProcess" >
<jaxws:inInterceptors>
<bean
class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
<constructor-arg>
<map>
<entry key="action" value="UsernameToken"/>
<entry key="passwordType" value="PasswordDigest"/>
<entry key="passwordCallbackRef" value-ref="myPasswordCallback"/>
</map>
</constructor-arg>
</bean>
</jaxws:inInterceptors>
</jaxws:endpoint>
<bean id="myPasswordCallback" class="service.ServerPasswordCallback" />
</beans>
Client xml request Code:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ord="http://order.demo/"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soapenv:Header>
<wsse:Security>
<wsse:UsernameToken>
<wsse:Username>joe</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">PE7F51/oyWFVMsiZURuUwjoZVPY=</wsse:Password>
<!--<wsu:Created>2013-12-17T13:12:00.429Z</wsu:Created>-->
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">efPSkfHXTM6NFDDD1CJHsw==</wsse:Nonce>
<wsu:Created>2013-12-23T12:17:15Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<ord:processOrder>
<!--Optional:-->
<arg0>
<!--Optional:-->
<customerID>234</customerID>
<!--Optional:-->
<itemID>0908923</itemID>
<price>23423</price>
<qty>1000</qty>
</arg0>
</ord:processOrder>
</soapenv:Body>
</soapenv:Envelope>
When i tried to call the service i am getting exception as
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode xmlns:ns1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">ns1:MessageExpired</faultcode>
<faultstring>The message has expired</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Can any one tell me where i am making mistake?
I suspect this is a bug in earlier version of wss4j. If you are parsing the date using SimpleDateFormat, you might want to set the time zone to UTC (Zulu time).
sdf.setTimeZone("UTC");
This however has been fixed in 2.0-beta.
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.wss4j/wss4j-ws-security-dom/2.0-beta/org/apache/wss4j/dom/message/token/UsernameToken.java#226
Edit: This is not a bug in wss4j. The specification states that the time zone must be in UTC.

SharePoint Web Services Team Discussion and Replies

I am trying to get a discussion with all it's replies from the sharepoint web services but only seem to be able to get the root message and not any of the replies. Below is the soap XML. What am I missing?
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.microsoft.com/sharepoint/soap/">
<soapenv:Header/>
<soapenv:Body>
<soap:GetListItems>
<!--Optional:-->
<soap:listName>Team Discussion</soap:listName>
<soap:viewFields>
<ViewFields>
<FieldRef Name='Title'/>
<FieldRef Name='ItemChildCount'/>
<FieldRef Name='Body'/>
</ViewFields>
</soap:viewFields>
<soap:queryOptions>
<QueryOptions>
<Folder>
"http://Lists/Team Discussion/Bite Me"
</Folder>
</QueryOptions>
</soap:queryOptions>
</soap:GetListItems>
</soapenv:Body>
</soapenv:Envelope>
The reply is:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetListItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<GetListItemsResult>
<listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
<rs:data ItemCount="2">
<z:row ows_Title="Hello" ows_ItemChildCount="3;#1" ows_Body="<div class="ExternalClass7B4989B3DC264716AD81B9CE55FD38FA"><p>​The text of the message</p></div>" ows_MetaInfo="3;#" ows__ModerationStatus="0" ows__Level="1" ows_ID="3" ows_UniqueId="3;#{6AF6D7DA-0D87-45EC-B002-AA0D153B6286}" ows_owshiddenversion="1" ows_FSObjType="3;#1" ows_Created="2012-01-11 12:21:26" ows_PermMask="0x7fffffffffffffff" ows_Modified="2012-01-11 12:21:26" ows_FileRef="3;#Lists/Team Discussion/Hello"/>
<z:row ows_Title="Bite Me" ows_ItemChildCount="1;#1" ows_Body="<div class="ExternalClass76A3DB4368714038B6B75DB0D807240B"><p>​Really?</p></div>" ows_MetaInfo="1;#" ows__ModerationStatus="0" ows__Level="1" ows_ID="1" ows_UniqueId="1;#{336518DC-B806-4DFB-9483-AB8DBB6258B6}" ows_owshiddenversion="1" ows_FSObjType="1;#1" ows_Created="2012-01-09 14:16:29" ows_PermMask="0x7fffffffffffffff" ows_Modified="2012-01-09 14:16:29" ows_FileRef="1;#Lists/Team Discussion/Bite Me"/>
</rs:data>
</listitems>
</GetListItemsResult>
</GetListItemsResponse>
</soap:Body>
</soap:Envelope>
EDIT: Each of the above posts should also have a reply.
I eventually found the magic query. It seems sub folders are only returned when you add a query based on date, i.e. this soap request works.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.microsoft.com/sharepoint/soap/">
<soapenv:Header/>
<soapenv:Body>
<soap:GetListItems>
<!--Optional:-->
<soap:listName>969E0130-5727-4E7D-A908-B3A5BC447E24</soap:listName>
<soap:viewFields>
<ViewFields>
<FieldRef Name='Title'/>
<FieldRef Name='Created'/>
<FieldRef Name='Author'/>
<FieldRef Name='Body'/>
</ViewFields>
</soap:viewFields>
<soap:query>
<Query>
<Where>
<Geq>
<FieldRef Name='Created' />
<Value Type='DateTime'>2010-08-20T14:00:00</Value>
</Geq>
</Where>
<OrderBy><FieldRef Name='ThreadIndex' Ascending='true' /></OrderBy>
</Query>
</soap:query>
<soap:queryOptions>
<QueryOptions>
<ViewAttributes Scope="RecursiveAll" IncludeRootFolder="False" />
</QueryOptions>
</soap:queryOptions>
</soap:GetListItems>
</soapenv:Body>
</soapenv:Envelope>
The essential parts are the query element with the date and the query option to specify the query is recursive.
imho shouldn't need the query as it should return everything by default.
The folder option listed in the other article didn't make any difference for me.
Have you checked out this article:
How to access SharePoint's Discussion Board using Web Services
http://geekswithblogs.net/kobush/archive/2007/03/12/108545.aspx