1 Reply Latest reply on Oct 13, 2005 2:00 PM by Thomas Diesler

    Problem in passing parameters to .NET Web Service using Axis

    Anand kumar Newbie

      Hi Thomas,

      plz help me form this.


      I am new to Apache axis and web services
      The below code is invoking the .Net web service but it is not passing the values which sent to the .NET web service .



      Here is my code:
      <%@ page import="java.util.Date,org.apache.axis.client.Call,
      org.apache.axis.client.Service,javax.xml.namespace.QName,
      java.io.IOException ,org.apache.axis.soap.SOAPConstants,
      javax.xml.rpc.ParameterMode,java.net.URL,
      org.apache.axis.encoding.XMLType,javax.xml.rpc.ServiceFactory;" %>


      Greeting World



      <%= " To Day's Date :"%>
      <%= new Date() %>

      <%

      try{

      String endpoint = "http://192.9.200.64/WebService1/Service1.asmx";

      Service service = new Service();
      QName Qname = new QName(" http://tempuri.org/WebService1/Service1","HelloWorld");
      Call call = (Call) service.createCall(Qname);

      call.setTargetEndpointAddress (new java.net.URL(endpoint));

      call.setProperty(call.SOAPACTION_USE_PROPERTY, new Boolean(true));
      call.setProperty(call.SOAPACTION_URI_PROPERTY," http://tempuri.org/WebService1/Service1/HelloWorld");

      call.setOperationName(new QName("http://tempuri.org/WebService1/Service1","HelloWorld")) ;

      call.addParameter("str",XMLType.XSD_STRING,ParameterMode.IN);
      call.setReturnType(XMLType.XSD_STRING);


      String msg = (String) call.invoke(new Object[]{" Anand "});
      out.println ("Received : " + msg +" ");


      }catch(Exception e)
      {
      out.println("error "+ e.getMessage());
      e.printStackTrace();
      }


      %>




      Out put for this Above is :

      To Day's Date : Wed Sep 28 10:29:00 IST 2005 Received : null


        • 1. Re: Problem in passing parameters to .NET Web Service using
          Thomas Diesler Master

          What version of jboss is this?

          <%@ page import="java.util.Date,org.apache.axis.client.Call,
          org.apache.axis.client.Service,javax.xml.namespace.QName,
          java.io.IOException ,org.apache.axis.soap.SOAPConstants,
          javax.xml.rpc.ParameterMode,java.net.URL,
          org.apache.axis.encoding.XMLType,javax.xml.rpc.ServiceFactory;" %>
          


          We do not support org.apache.axis in whatever flavour (FAQ wiki for details)

          If you have to use Apache Axis instead of our web service offering, you would need to go to Apache for their support offering