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
sach7Asked:
Who is Participating?
 
Mayank SAssociate Director - Product EngineeringCommented:
Download WSDL2Java and try creating a proxy for the web-service using it. Then the proxy will handle calling of the methods, etc for you and all you need to do in  your code is create an object of the proxy locally and invoke its methods locally like normal method-calls.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Thanks, Venabili :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.