cancel
Showing results for 
Search instead for 
Did you mean: 

Calling Java Proxy From stand alone application

former_member190313
Active Participant
0 Kudos

Hi all,

I have created Client Java proxy. I am trying to write a stand alone java class to call this proxy. Can anybody help me for the code.?

Thanks

Sheetal

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member190313
Active Participant
0 Kudos

Hi madhu,

Thanks for ur quick reply.

but the document which u have given , i am trying the same example. for client proxy. but its not working .

it gives errors when we call response object

Thanks

Sheetal

Former Member
0 Kudos

Hi,

http://help.sap.com/saphelp_nw04s/helpdata/en/b6/55e3952a902447847066a0df27b0d6/frameset.htm

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d06315a6-e66e-2910-039c-ba8bbbd2...

Code example for server proxies

package com.sap.xi.xI.demo.airline;

public class FlightSeatAvailabilityQueryIn_PortTypeImpl

extends com.sap.aii.proxy.xiruntime.core.AbstractProxy

implements FlightSeatAvailabilityQueryIn_PortType {

public

com.sap.xi.xI.demo.airline.FlightSeatAvailabilityResponse_Type

flightSeatAvailabilityQueryIn

(com.sap.xi.xI.demo.airline.FlightSeatAvailabilityQuery_Type

flightSeatAvailabilityQuery)

throws

com.sap.xi.xI.demo.airline.FlightNotFound_Message_Exception,

com.sap.aii.proxy.xiruntime.core.SystemFaultException,

com.sap.aii.proxy.xiruntime.core.ApplicationFaultException{

boolean error = false;

String errorText = "";

// get input parameters

FlightID_Type flightID = flightSeatAvailabilityQuery.getFlightID();

String airlineID = flightID.getAirlineID();

String connectionID = flightID.getConnectionID();

java.util.Calendar flightDate = flightID.getFlightDate();

// check input parameters

if (airlineID.length()==0) {

error = true;

errorText = "airline ID is missing";

}

if (connectionID.length()==0) {

error = true;

errorText = "connection ID is missing";

}

if (error){

com.sap.xi.xI.demo.agency.ExchangeFaultData_Type standard =

new com.sap.xi.xI.demo.agency.ExchangeFaultData_Type();

FlightNotFound_Type flightNotFoundType =

new FlightNotFound_Type();

FlightNotFound_Message flightNotFoundMessage =

new FlightNotFound_Message();

FlightNotFound_Message_Exception flightNotFound =

new FlightNotFound_Message_Exception();

// put error text to fault message

standard.setFaultText(errorText);

flightNotFoundType.setStandard(standard);

flightNotFoundMessage.setFlightNotFound(flightNotFoundType);

flightNotFound.setFlightNotFound_Message(flightNotFoundMessage);

// throw flight not found message exception

throw flightNotFound;

} else {

// provide output parameters

// (just return any fix values)

FlightSeatAvailabilityResponse_Type response =

new FlightSeatAvailabilityResponse_Type();

response.setBusinessFreeSeats(18);

response.setBusinessMaxSeats(20);

response.setEconomyFreeSeats(188);

response.setEconomyMaxSeats(200);

response.setFirstFreeSeats(12);

response.setFirstMaxSeats(15);

return response;

}

}

}

Thanks,

Madhu

Former Member
0 Kudos