Link to home
Start Free TrialLog in
Avatar of sach7
sach7

asked on

CLIENT SIDE JAVA CODE TO INTERACT WITH A DOTNET APPLICATION

I am trying to write a client side code(java) to support an already developed dot net appliocation. client side is a standalone application.(no web server/app server).i am stuck..can you pls help me.. i  am using DII. The services method that i have written is as follows

public void services ( String name )
            throws Exception
            {
      
            String wsdlURL = "";(a url)
              String namespace = "";(a string name)
              String serviceName = "";( a webservice name)
              QName serviceQN = new QName(namespace, serviceName);

              ServiceFactory serviceFactory = ServiceFactory.newInstance();
              /* The "new URL(wsdlURL)" parameter is optional */
              Service service = serviceFactory.createService(new URL(wsdlURL), serviceQN);

              String operationName = "HelloWorld";
             
              Call call = service.createCall();
              call.setPortTypeName(serviceQN);
              call.setOperationName(new QName(namespace, operationName));
              call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY, "");
              call.setProperty(Call.OPERATION_STYLE_PROPERTY, "Wrapped");
              call.addParameter("name",serviceQN,ParameterMode.IN);
              call.setReturnType(serviceQN);
              Object[] inParams = new Object[] { name };
              String ret = (String) call.invoke(inParams);
              System.out.println ( ret ) ;
      }
}
pls help ASAP
ASKER CERTIFIED SOLUTION
Avatar of Mayank S
Mayank S
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, Venabili :)