Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1

    Default Help! WCF web service client problem


    Hi guys. I've encountered some difficulty in the development of my WS client.

    Server: c#
    Client: Java ME
    type: static stub client (generated stub classes after supplying the wsdl)

    The situation I want to do:
    In the client application, the user can choose which web service to connect to by changing the IP.



    How can I achieve this?

    Sorry newbie sad ko ani. Inputs would help a lot. Thanks so much in advance!

    *Side note:
    There are 3 types of webservice clients in Java. Static stub, dynamic proxy, Dynamic Invocation Interface. However, it is stated here Understanding the Web Services Subset API for Java ME that JavaME has no direct support on dynamic proxy and DII.

    I want a work-around that can still achieve my objective.

  2. #2
    Hi,

    I'm a j2ee guy, so not so familiar with java me. But anyway I have a couple of questions to help us get a clearer picture:

    1. Since you're using static stub client, do you mean there are more than one web service host that you need to point to? Or are you referring to multiple endpoints?

    2. The IP you're referring to, is that the IP of the web service host / machine? for example:
    http://<ip_adress_1>:80/WebService?wsdl
    and
    http://<ip_adress_2>:80/WebService?wsdl

    ^^If this is the case then since you're using static stub client, it really doesn't matter whether you use IP address 1 or 2 at runtime. You can set the IP addresses to a variable with an if-else condition. for eg.

    String wsIP = "10.1.1.89";
    if (condition) {
    wsIP = "10.1.1.90";
    }

    then in your service locator class (one of the classes generated) look for the endpoint url then change it to:

    "http://" + wsIp + ":80/WebService?wsdl";

    (port = 80 is just an example)

    You can externalize the IP addresses so as not to hard code them and to be able to change them at runtime.


    Hope this helps! and hope I'm making sense. =)

  3. #3
    ^^

    Given the condition above, I'm assuming that if you have 2 web service hosts, they generate a common wsdl and have common endpoints. So pointing to ws1 or ws2 is not a problem and you would probably get different data from both servers.

  4. #4
    Quote Originally Posted by maddox22 View Post
    ^^

    Given the condition above, I'm assuming that if you have 2 web service hosts, they generate a common wsdl and have common endpoints. So pointing to ws1 or ws2 is not a problem and you would probably get different data from both servers.
    Yep that's exactly the situation. You understood my problem so well! I'm gonna try out your suggestion and post a feedback soon.

  5. #5
    Just to confirm:
    2 files will be affected? Service1.wsclient (xml) and Service1_Stub.java

    Is this right?

  6. #6
    Can you post what's inside Service1.wsclient & Service1_Stub.java?

  7. #7
    Service1_Stub.java

    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;
        }
    }
    Service1.wsclient
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <wsclientconfig serviceType="jsr-172" version="1.0">
        <client>
            <project>ma2</project>
            <class location="${src.dir}" type="service1.Service1"/>
            <property name="DataBinding" value="false"/>
            <property name="cldc11" value="true"/>
        </client>
        <services>
            <service file="Service1.wsdl" url="http://1.1.1.1:8080/Design_Time_Addresses/SOAP11demo/Service1/?wsdl"/>
        </services>
    </wsclientconfig>

  8. #8
    Unsay trigger sa imo user kung gusto sila mu-point ug lain nga WS i.p.? Naa event gikan sa user diba?

    Kani nga line:

    _propertyValues = new Object[] { "http://153.59.110.25:8001/myservice" };


    i-apply imo condition for the 2 IPs

    mr-mobile ni diba? dili ko familiar ani. but Service1_Stub.java ang imo i-modify.

  9. #9
    How do you call Service1_Stub? Try to overload the constructor and i-pass ang end point.

    Code:
        public Service1_Stub(String endPoint) {
           _propertyNames = new String[] { ENDPOINT_ADDRESS_PROPERTY };
           _propertyValues = new Object[] { endPoint };
        }
    then use this constructor to instantiate, so you can externalize your logic.

  10. #10
    yep2 mao na akong gi buhat. So no need na to sa Service1.wsclient?

  11.    Advertisement

Page 1 of 2 12 LastLast

Similar Threads

 
  1. web service problem
    By deathdodger in forum Programming
    Replies: 19
    Last Post: 07-02-2010, 12:34 AM
  2. GG CLIENT PROBLEM :( help mga bro
    By babyodc in forum Software & Games (Old)
    Replies: 4
    Last Post: 09-26-2007, 09:55 PM
  3. WEB SERVER - IIS Problem i can't view ASP Files... help pls
    By kibotizer in forum Websites & Multimedia
    Replies: 46
    Last Post: 08-01-2007, 11:59 AM
  4. help me bout THIN CLIENT
    By giovanni in forum Networking & Internet
    Replies: 1
    Last Post: 04-26-2007, 01:09 AM
  5. HELP: Nokia 3230 insert simcard problem
    By psyd_1 in forum Gizmos & Gadgets (Old)
    Replies: 28
    Last Post: 02-22-2007, 11:09 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top