How to pass variable in webservice client(written in java) to invoke .net webservice( .asmx file).
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Khalid_Anwar
Posted On:   Monday, January 22, 2007 11:39 PM

How to pass variable in webservice client(written in java) to invoke .net webservice( .asmx file). i used WSDL2Java to generate .net webservice's webserviceNamesoap.java,webserviceNamesoapstub.java,webserviceNamelocator.java and webserviceName.java in c:/org/tempuri directory i used it properly as Web Service on IIS in .asmx file <%@ WebService Language="C#" Class="HelloWorld" %> using System; using System.Web.Services; public class HelloWorld : WebService { [WebMethod] public String SayHelloWorld() { return "Hello World"; } } ------------------------------------------- To consume this   More>>

How to pass variable in webservice client(written in java) to invoke .net webservice( .asmx file).
i used WSDL2Java to generate .net webservice's webserviceNamesoap.java,webserviceNamesoapstub.java,webserviceNamelocator.java and webserviceName.java in c:/org/tempuri directory

i used it properly as

Web Service on IIS in .asmx file

			<%@ WebService Language="C#" Class="HelloWorld" %>
			
using System;
using System.Web.Services;
public class HelloWorld : WebService
{
[WebMethod] public String SayHelloWorld()
{
return "Hello World";
}
}


-------------------------------------------

To consume this Web Service with AXIS, WSDL file for the HelloWorld
Web Service needs to be downloaded.


Now, to consume this Web Service, Apache AXIS provides a tool
WSDL2Java to convert WSDL specification file to Java code. This tool
generates the four Java classes, and that will take care of processing XML and
SOAP messaging, and makes the use of Web Service as simple as calling an object
on a local machine.

			> java org.apache.axis.wsdl.WSDL2Java
			http://localhost/HelloWorld.asmx?WSDL
		

The above tool will generate the following four class files which can
be used to access that Web Service.



  • HelloWorld.java
  • HelloWorldLocator.java
  • HelloWorldSoap.java
  • HelloWorldSoapStub.java

This is how the client program looks like:

			package org.tempuri;
			
public class Client
{
public static void main(String [] args)
{
try
{
HelloWorldLocator loc = new HelloWorldLocator();
HelloWorldSoap port = loc.getHelloWorldSoap();
System.out.println(port.sayHelloWorld());
}
catch(Exception e)
{System.out.println(e.getMessage());}
}
}


----------------------------------------------
i also set credentials like
_call.setUsername("user");
_call.setPassword("pwd");


but i have problem
log4j:warn no appenders found for logger(org.apache.axis.i18n.ProjectResourceBundle)
log4j:warn plz initialize log4j sys properly

AxisFault
faultCode {http//schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode
faultString java.net.ConnectException: Connection
timed out:connect
faultActor
faultNode
faultDetail
.........
.......

what sd i do,help me plz,

in timeout is set 36000 millisec

hoping ur quick resp
with regards
khalid
......    <<Less
About | Sitemap | Contact