Code:
package service1;
import javax.xml.rpc.JAXRPCException;
import javax.xml.namespace.QName;
import javax.microedition.xml.rpc.Operation;
import javax.microedition.xml.rpc.Type;
import javax.microedition.xml.rpc.ComplexType;
import javax.microedition.xml.rpc.Element;
public class Service1_Stub implements Service1, javax.xml.rpc.Stub {
private String[] _propertyNames;
private Object[] _propertyValues;
public Service1_Stub() {
_propertyNames = new String[] { ENDPOINT_ADDRESS_PROPERTY };
_propertyValues = new Object[] { "http://153.59.110.25:8001/myservice" };
}
@Override
public void _setProperty( String name, Object value ) {
int size = _propertyNames.length;
for (int i = 0; i < size; ++i) {
if( _propertyNames[i].equals( name )) {
_propertyValues[i] = value;
return;
}
}
String[] newPropNames = new String[size + 1];
System.arraycopy(_propertyNames, 0, newPropNames, 0, size);
_propertyNames = newPropNames;
Object[] newPropValues = new Object[size + 1];
System.arraycopy(_propertyValues, 0, newPropValues, 0, size);
_propertyValues = newPropValues;
_propertyNames[size] = name;
_propertyValues[size] = value;
}
public Object _getProperty(String name) {
for (int i = 0; i < _propertyNames.length; ++i) {
if (_propertyNames[i].equals(name)) {
return _propertyValues[i];
}
}
if (ENDPOINT_ADDRESS_PROPERTY.equals(name) || USERNAME_PROPERTY.equals(name) || PASSWORD_PROPERTY.equals(name)) {
return null;
}
if (SESSION_MAINTAIN_PROPERTY.equals(name)) {
return new Boolean(false);
}
throw new JAXRPCException("Stub does not recognize property: " + name);
}
protected void _prepOperation(Operation op) {
for (int i = 0; i < _propertyNames.length; ++i) {
op.setProperty(_propertyNames[i], _propertyValues[i].toString());
}
}
public Integer WSStartUp(Integer dwVersionsRequired) throws java.rmi.RemoteException {
Object inputObject[] = new Object[] {
dwVersionsRequired
};
Operation op = Operation.newInstance( _qname_operation_WSStartUp, _type_WSStartUp, _type_WSStartUpResponse );
_prepOperation( op );
op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "http://tempuri.org/IService1/WSStartUp" );
Object resultObj;
try {
resultObj = op.invoke( inputObject );
} catch( JAXRPCException e ) {
Throwable cause = e.getLinkedCause();
if( cause instanceof java.rmi.RemoteException ) {
throw (java.rmi.RemoteException) cause;
}
throw e;
}
return (Integer )((Object[])resultObj)[0];
}
@Override
public Integer WSAsyncGetInfo(Short hService, Integer dwCategory, byte[] lpQueryDetails, Integer dwTimeOut, Integer lpRequestID) throws java.rmi.RemoteException {
Object inputObject[] = new Object[] {
hService,
dwCategory,
lpQueryDetails,
dwTimeOut,
lpRequestID
};
Operation op = Operation.newInstance( _qname_operation_WSAsyncGetInfo, _type_WSAsyncGetInfo, _type_WSAsyncGetInfoResponse );
_prepOperation( op );
op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "http://tempuri.org/IService1/WSAsyncGetInfo" );
Object resultObj;
try {
resultObj = op.invoke( inputObject );
} catch( JAXRPCException e ) {
Throwable cause = e.getLinkedCause();
if( cause instanceof java.rmi.RemoteException ) {
throw (java.rmi.RemoteException) cause;
}
throw e;
}
return (Integer )((Object[])resultObj)[0];
}
public Integer WSAsyncDeregister(Short hService, Integer dwEventClass, Integer lpRequestID) throws java.rmi.RemoteException {
Object inputObject[] = new Object[] {
hService,
dwEventClass,
lpRequestID
};
Operation op = Operation.newInstance( _qname_operation_WSAsyncDeregister, _type_WSAsyncDeregister, _type_WSAsyncDeregisterResponse );
_prepOperation( op );
op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "http://tempuri.org/IService1/WSAsyncDeregister" );
Object resultObj;
try {
resultObj = op.invoke( inputObject );
} catch( JAXRPCException e ) {
Throwable cause = e.getLinkedCause();
if( cause instanceof java.rmi.RemoteException ) {
throw (java.rmi.RemoteException) cause;
}
throw e;
}
return (Integer )((Object[])resultObj)[0];
}
public Integer WSCleanUp() throws java.rmi.RemoteException {
Object inputObject[] = new Object[] {
};
Operation op = Operation.newInstance( _qname_operation_WSCleanUp, _type_WSCleanUp, _type_WSCleanUpResponse );
_prepOperation( op );
op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "http://tempuri.org/IService1/WSCleanUp" );
Object resultObj;
try {
resultObj = op.invoke( inputObject );
} catch( JAXRPCException e ) {
Throwable cause = e.getLinkedCause();
if( cause instanceof java.rmi.RemoteException ) {
throw (java.rmi.RemoteException) cause;
}
throw e;
}
return (Integer )((Object[])resultObj)[0];
}
public Integer WSAsyncRegister(Short hService, Integer dwEventClass, Integer lpRequestID) throws java.rmi.RemoteException {
Object inputObject[] = new Object[] {
hService,
dwEventClass,
lpRequestID
};
Operation op = Operation.newInstance( _qname_operation_WSAsyncRegister, _type_WSAsyncRegister, _type_WSAsyncRegisterResponse );
_prepOperation( op );
op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "http://tempuri.org/IService1/WSAsyncRegister" );
Object resultObj;
try {
resultObj = op.invoke( inputObject );
} catch( JAXRPCException e ) {
Throwable cause = e.getLinkedCause();
if( cause instanceof java.rmi.RemoteException ) {
throw (java.rmi.RemoteException) cause;
}
throw e;
}
return (Integer )((Object[])resultObj)[0];
}
public WndProcStruct clientProcesscall() throws java.rmi.RemoteException {
Object inputObject[] = new Object[] {
};
Operation op = Operation.newInstance( _qname_operation_clientProcesscall, _type_clientProcesscall, _type_clientProcesscallResponse );
_prepOperation( op );
op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "http://tempuri.org/IService1/clientProcesscall" );
Object resultObj;
try {
resultObj = op.invoke( inputObject );
} catch( JAXRPCException e ) {
Throwable cause = e.getLinkedCause();
if( cause instanceof java.rmi.RemoteException ) {
throw (java.rmi.RemoteException) cause;
}
throw e;
}
return WndProcStruct_fromObject((Object[])((Object[]) resultObj)[0]);
}
public Integer WSAsyncExecute(Short hService, Integer dwCommand, String lpCmdData, Integer dwTimeOut, Integer lpRequestID) throws java.rmi.RemoteException {
Object inputObject[] = new Object[] {
hService,
dwCommand,
lpCmdData,
dwTimeOut,
lpRequestID
};
Operation op = Operation.newInstance( _qname_operation_WSAsyncExecute, _type_WSAsyncExecute, _type_WSAsyncExecuteResponse );
_prepOperation( op );
op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "http://tempuri.org/IService1/WSAsyncExecute" );
Object resultObj;
try {
resultObj = op.invoke( inputObject );
} catch( JAXRPCException e ) {
Throwable cause = e.getLinkedCause();
if( cause instanceof java.rmi.RemoteException ) {
throw (java.rmi.RemoteException) cause;
}
throw e;
}
return (Integer )((Object[])resultObj)[0];
}
@Override
public Integer WSAsyncOpen(String lpszLogicalName, String lpszAppID, Integer dwTraceLevel, Integer dwTimeOut, Short lphService, Integer dwSrvcVersionsRequired, WFSVERSION2 lpSrvcVersion, WFSVERSION2 lpSPIVersion, Integer lpRequestID) throws java.rmi.RemoteException {
Object inputObject[] = new Object[] {
lpszLogicalName,
lpszAppID,
dwTraceLevel,
dwTimeOut,
lphService,
dwSrvcVersionsRequired,
WFSVERSION2_toObject( lpSrvcVersion ),
WFSVERSION2_toObject( lpSPIVersion ),
lpRequestID
};
Operation op = Operation.newInstance( _qname_operation_WSAsyncOpen, _type_WSAsyncOpen, _type_WSAsyncOpenResponse );
_prepOperation( op );
op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "http://tempuri.org/IService1/WSAsyncOpen" );
Object resultObj;
try {
resultObj = op.invoke( inputObject );
} catch( JAXRPCException e ) {
Throwable cause = e.getLinkedCause();
if( cause instanceof java.rmi.RemoteException ) {
throw (java.rmi.RemoteException) cause;
}
throw e;
}
return (Integer )((Object[])resultObj)[0];
}
public Integer WSAsyncClose(Short hService, Integer lpRequestID) throws java.rmi.RemoteException {
Object inputObject[] = new Object[] {
hService,
lpRequestID
};
Operation op = Operation.newInstance( _qname_operation_WSAsyncClose, _type_WSAsyncClose, _type_WSAsyncCloseResponse );
_prepOperation( op );
op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "http://tempuri.org/IService1/WSAsyncClose" );
Object resultObj;
try {
resultObj = op.invoke( inputObject );
} catch( JAXRPCException e ) {
Throwable cause = e.getLinkedCause();
if( cause instanceof java.rmi.RemoteException ) {
throw (java.rmi.RemoteException) cause;
}
throw e;
}
return (Integer )((Object[])resultObj)[0];
}
private static Object WFSVERSION2_toObject( WFSVERSION2 obj ) {
if(obj == null) return null;
Object result[] = new Object[ 3 ];
result[0] = obj.getWHighVersion();
result[1] = obj.getWLowVersion();
result[2] = obj.getWVersion();
return result;
}
private static WndProcStruct WndProcStruct_fromObject( Object obj[] ) {
if(obj == null) return null;
WndProcStruct result = new WndProcStruct();
result.setMsg((Integer )obj[0]);
result.setWfsdata((String )obj[1]);
result.setWfsresult((String )obj[2]);
return result;
}
protected static final QName _qname_operation_WSAsyncDeregister = new QName( "http://tempuri.org/", "WSAsyncDeregister" );
protected static final QName _qname_operation_WSAsyncGetInfo = new QName( "http://tempuri.org/", "WSAsyncGetInfo" );
protected static final QName _qname_operation_WSStartUp = new QName( "http://tempuri.org/", "WSStartUp" );
protected static final QName _qname_operation_WSAsyncClose = new QName( "http://tempuri.org/", "WSAsyncClose" );
protected static final QName _qname_operation_WSAsyncOpen = new QName( "http://tempuri.org/", "WSAsyncOpen" );
protected static final QName _qname_operation_WSAsyncExecute = new QName( "http://tempuri.org/", "WSAsyncExecute" );
protected static final QName _qname_operation_clientProcesscall = new QName( "http://tempuri.org/", "clientProcesscall" );
protected static final QName _qname_operation_WSAsyncRegister = new QName( "http://tempuri.org/", "WSAsyncRegister" );
protected static final QName _qname_operation_WSCleanUp = new QName( "http://tempuri.org/", "WSCleanUp" );
protected static final QName _qname_WSAsyncDeregisterResponse = new QName( "http://tempuri.org/", "WSAsyncDeregisterResponse" );
protected static final QName _qname_WSAsyncCloseResponse = new QName( "http://tempuri.org/", "WSAsyncCloseResponse" );
protected static final QName _qname_WSStartUp = new QName( "http://tempuri.org/", "WSStartUp" );
protected static final QName _qname_clientProcesscallResponse = new QName( "http://tempuri.org/", "clientProcesscallResponse" );
protected static final QName _qname_WSAsyncExecute = new QName( "http://tempuri.org/", "WSAsyncExecute" );
protected static final QName _qname_WSStartUpResponse = new QName( "http://tempuri.org/", "WSStartUpResponse" );
protected static final QName _qname_WSCleanUpResponse = new QName( "http://tempuri.org/", "WSCleanUpResponse" );
protected static final QName _qname_WSAsyncGetInfoResponse = new QName( "http://tempuri.org/", "WSAsyncGetInfoResponse" );
protected static final QName _qname_WSAsyncRegister = new QName( "http://tempuri.org/", "WSAsyncRegister" );
protected static final QName _qname_WSAsyncDeregister = new QName( "http://tempuri.org/", "WSAsyncDeregister" );
protected static final QName _qname_WSAsyncGetInfo = new QName( "http://tempuri.org/", "WSAsyncGetInfo" );
protected static final QName _qname_WSAsyncOpenResponse = new QName( "http://tempuri.org/", "WSAsyncOpenResponse" );
protected static final QName _qname_WSAsyncClose = new QName( "http://tempuri.org/", "WSAsyncClose" );
protected static final QName _qname_WSAsyncOpen = new QName( "http://tempuri.org/", "WSAsyncOpen" );
protected static final QName _qname_clientProcesscall = new QName( "http://tempuri.org/", "clientProcesscall" );
protected static final QName _qname_WSAsyncExecuteResponse = new QName( "http://tempuri.org/", "WSAsyncExecuteResponse" );
protected static final QName _qname_WSAsyncRegisterResponse = new QName( "http://tempuri.org/", "WSAsyncRegisterResponse" );
protected static final QName _qname_WSCleanUp = new QName( "http://tempuri.org/", "WSCleanUp" );
protected static final Element _type_WSStartUpResponse;
protected static final Element _type_WSCleanUpResponse;
protected static final Element _type_WSAsyncCloseResponse;
protected static final Element _type_WSAsyncOpen;
protected static final Element _type_WSAsyncDeregister;
protected static final Element _type_WSAsyncOpenResponse;
protected static final Element _type_WSCleanUp;
protected static final Element _type_clientProcesscallResponse;
protected static final Element _type_WSAsyncGetInfoResponse;
protected static final Element _type_WSAsyncExecute;
protected static final Element _type_WSAsyncRegisterResponse;
protected static final Element _type_WSAsyncRegister;
protected static final Element _type_WSAsyncGetInfo;
protected static final Element _type_WSStartUp;
protected static final Element _type_WSAsyncExecuteResponse;
protected static final Element _type_clientProcesscall;
protected static final Element _type_WSAsyncClose;
protected static final Element _type_WSAsyncDeregisterResponse;
static {
_type_WSAsyncDeregisterResponse = new Element( _qname_WSAsyncDeregisterResponse, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "WSAsyncDeregisterResult" ), Type.INT, 0, 1, false )}), 1, 1, false );
_type_WSAsyncCloseResponse = new Element( _qname_WSAsyncCloseResponse, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "WSAsyncCloseResult" ), Type.INT, 0, 1, false )}), 1, 1, false );
_type_WSStartUp = new Element( _qname_WSStartUp, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "dwVersionsRequired" ), Type.INT, 0, 1, false )}), 1, 1, false );
_type_clientProcesscallResponse = new Element( _qname_clientProcesscallResponse, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "clientProcesscallResult" ), _complexType( new Element[] {
new Element( new QName( "http://schemas.datacontract.org/2004/07/SOAP11demo", "Msg" ), Type.INT, 0, 1, false ),
new Element( new QName( "http://schemas.datacontract.org/2004/07/SOAP11demo", "wfsdata" ), Type.STRING, 0, 1, true ),
new Element( new QName( "http://schemas.datacontract.org/2004/07/SOAP11demo", "wfsresult" ), Type.STRING, 0, 1, true )}))}), 1, 1, false );
_type_WSAsyncExecute = new Element( _qname_WSAsyncExecute, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "hService" ), Type.SHORT, 0, 1, false ),
new Element( new QName( "http://tempuri.org/", "dwCommand" ), Type.INT, 0, 1, false ),
new Element( new QName( "http://tempuri.org/", "lpCmdData" ), Type.STRING, 0, 1, true ),
new Element( new QName( "http://tempuri.org/", "dwTimeOut" ), Type.INT, 0, 1, false ),
new Element( new QName( "http://tempuri.org/", "lpRequestID" ), Type.INT, 0, 1, false )}), 1, 1, false );
_type_WSStartUpResponse = new Element( _qname_WSStartUpResponse, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "WSStartUpResult" ), Type.INT, 0, 1, false )}), 1, 1, false );
_type_WSCleanUpResponse = new Element( _qname_WSCleanUpResponse, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "WSCleanUpResult" ), Type.INT, 0, 1, false )}), 1, 1, false );
_type_WSAsyncGetInfoResponse = new Element( _qname_WSAsyncGetInfoResponse, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "WSAsyncGetInfoResult" ), Type.INT, 0, 1, false )}), 1, 1, false );
_type_WSAsyncRegister = new Element( _qname_WSAsyncRegister, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "hService" ), Type.SHORT, 0, 1, false ),
new Element( new QName( "http://tempuri.org/", "dwEventClass" ), Type.INT, 0, 1, false ),
new Element( new QName( "http://tempuri.org/", "lpRequestID" ), Type.INT, 0, 1, false )}), 1, 1, false );
_type_WSAsyncDeregister = new Element( _qname_WSAsyncDeregister, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "hService" ), Type.SHORT, 0, 1, false ),
new Element( new QName( "http://tempuri.org/", "dwEventClass" ), Type.INT, 0, 1, false ),
new Element( new QName( "http://tempuri.org/", "lpRequestID" ), Type.INT, 0, 1, false )}), 1, 1, false );
_type_WSAsyncGetInfo = new Element( _qname_WSAsyncGetInfo, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "hService" ), Type.SHORT, 0, 1, false ),
new Element( new QName( "http://tempuri.org/", "dwCategory" ), Type.INT, 0, 1, false ),
new Element( new QName( "http://tempuri.org/", "lpQueryDetails" ), Type.BYTE, 0, Element.UNBOUNDED, true ),
new Element( new QName( "http://tempuri.org/", "dwTimeOut" ), Type.INT, 0, 1, false ),
new Element( new QName( "http://tempuri.org/", "lpRequestID" ), Type.INT, 0, 1, false )}), 1, 1, false );
_type_WSAsyncOpenResponse = new Element( _qname_WSAsyncOpenResponse, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "WSAsyncOpenResult" ), Type.INT, 0, 1, false )}), 1, 1, false );
_type_WSAsyncClose = new Element( _qname_WSAsyncClose, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "hService" ), Type.SHORT, 0, 1, false ),
new Element( new QName( "http://tempuri.org/", "lpRequestID" ), Type.INT, 0, 1, false )}), 1, 1, false );
_type_WSAsyncOpen = new Element( _qname_WSAsyncOpen, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "lpszLogicalName" ), Type.STRING, 0, 1, true ),
new Element( new QName( "http://tempuri.org/", "lpszAppID" ), Type.STRING, 0, 1, true ),
new Element( new QName( "http://tempuri.org/", "dwTraceLevel" ), Type.INT, 0, 1, false ),
new Element( new QName( "http://tempuri.org/", "dwTimeOut" ), Type.INT, 0, 1, false ),
new Element( new QName( "http://tempuri.org/", "lphService" ), Type.SHORT, 0, 1, false ),
new Element( new QName( "http://tempuri.org/", "dwSrvcVersionsRequired" ), Type.INT, 0, 1, false ),
new Element( new QName( "http://tempuri.org/", "lpSrvcVersion" ), _complexType( new Element[] {
new Element( new QName( "http://schemas.datacontract.org/2004/07/SOAP11demo", "wHighVersion" ), Type.SHORT, 0, 1, false ),
new Element( new QName( "http://schemas.datacontract.org/2004/07/SOAP11demo", "wLowVersion" ), Type.SHORT, 0, 1, false ),
new Element( new QName( "http://schemas.datacontract.org/2004/07/SOAP11demo", "wVersion" ), Type.SHORT, 0, 1, false )})),
new Element( new QName( "http://tempuri.org/", "lpSPIVersion" ), _complexType( new Element[] {
new Element( new QName( "http://schemas.datacontract.org/2004/07/SOAP11demo", "wHighVersion" ), Type.SHORT, 0, 1, false ),
new Element( new QName( "http://schemas.datacontract.org/2004/07/SOAP11demo", "wLowVersion" ), Type.SHORT, 0, 1, false ),
new Element( new QName( "http://schemas.datacontract.org/2004/07/SOAP11demo", "wVersion" ), Type.SHORT, 0, 1, false )})),
new Element( new QName( "http://tempuri.org/", "lpRequestID" ), Type.INT, 0, 1, false )}), 1, 1, false );
_type_clientProcesscall = new Element( _qname_clientProcesscall, _complexType( new Element[] {
}), 1, 1, false );
_type_WSAsyncExecuteResponse = new Element( _qname_WSAsyncExecuteResponse, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "WSAsyncExecuteResult" ), Type.INT, 0, 1, false )}), 1, 1, false );
_type_WSCleanUp = new Element( _qname_WSCleanUp, _complexType( new Element[] {
}), 1, 1, false );
_type_WSAsyncRegisterResponse = new Element( _qname_WSAsyncRegisterResponse, _complexType( new Element[] {
new Element( new QName( "http://tempuri.org/", "WSAsyncRegisterResult" ), Type.INT, 0, 1, false )}), 1, 1, false );
}
private static ComplexType _complexType( Element[] elements ) {
ComplexType result = new ComplexType();
result.elements = elements;
return result;
}
}