• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 187
  • Last Modified:

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
0
sach7
Asked:
sach7
  • 2
1 Solution
 
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now