我正在開發(fā)一個應(yīng)用程序,當(dāng)我用jaxws wsimport導(dǎo)入wsdl Web服務(wù)時,這抽象了Java類的復(fù)雜類型。但是它僅將主體響應(yīng)抽象為類,并且我需要在Web服務(wù)響應(yīng)標(biāo)頭中獲取一些數(shù)據(jù),如何在客戶端使用jaxws訪問Web服務(wù)響應(yīng)標(biāo)頭?代碼: //Instance of Service SessionCreateRQService sessionCreateService = new SessionCreateRQService(); SessionCreatePortType requestSessionCreate = sessionCreateService.getSessionCreatePortType(); //Get datas to request header MessageHeader messageHeader = getMessageHeader(MESSAGE_ID, timestamp, URI_PartyId, Services.SessionCreateRQ ,Actions.SessionCreateRQ); Holder<MessageHeader> holderMessage = new Holder<MessageHeader>(messageHeader); //Get another datas to request header Security security = getSecuritySessionCreateRQ(); Holder<Security> holderSecurity = new Holder<>(security); //Get datas to quest body SessionCreateRQ body = new SessionCreateRQ(); body.setPOS(getPOS()); //Call the websevice and receiving the response. // ---->>>I need access the response webservice header here.<<----- SessionCreateRS sessionCreateRS = requestSessionCreate.sessionCreateRQ(holderMessage, holderSecurity, body);謝謝你。
添加回答
舉報
0/150
提交
取消