laxmidhar prad

Ranch Hand
+ Follow
since Feb 05, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by laxmidhar prad

Hi
I am calling .net webservice from java ,it compiles but return null as aresult. Actually what parameter i am sending as argument to .net webservice Here is my code
import java.io.*;
import java.net.*;
import java.util.*;
import org.apache.soap.*;
import org.apache.soap.encoding.SOAPMappingRegistry;
import org.apache.soap.encoding.soapenc.StringDeserializer;
import org.apache.soap.rpc.*;
import org.apache.soap.util.xml.QName;

public class Test_client {

public static void main (String[] args)
throws Exception {

System.out.println("\n\nCalling the SOAP Server to say hello\n\n");
URL url = new URL ("http://153.58.19.96/ASVWS/ASVWS.asmx");
String name = "satya";
Call call = new Call ( );
String s="//";
String p="/";
//call.setTargetObjectURI("xmlns=http:"+s+"tempuri.org"+p);
SOAPMappingRegistry soapMappingRegistry = new SOAPMappingRegistry();
soapMappingRegistry.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("http://temp.org/", "HelloWorldResult"),null,null, new StringDeserializer());
call.setTargetObjectURI( "http://temp.org/");
call.setMethodName("HelloWorld");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setSOAPMappingRegistry(soapMappingRegistry);
Vector params = new Vector ( );
params.addElement (new Parameter("name", String.class, name, "http://schemas.xmlsoap.org/soap/encoding/"));
call.setParams (params);

System.out.print("The SOAP Server says: ");

Response resp = call.invoke(url,"http://temp.org/HelloWorld" );

if (resp.generatedFault ( )) {
Fault fault = resp.getFault ( );
System.out.println ("\nOuch, the call failed: ");
System.out.println (" Fault Code = " + fault.getFaultCode());
System.out.println (" Fault String = " + fault.getFaultString ( ));
} else {
System.out.println("Here");
Parameter result = resp.getReturnValue ( );
System.out.print(result.getValue ( ));
System.out.println( );
}
}
}




Here is my wsdl file



<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://tempuri.org/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
targetNamespace="http://tempuri.org/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified"
targetNamespace="http://tempuri.org/">
<s:element name="GetASVResults_Object">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1"
name="branchNumber" type="s:int" />
<s:element minOccurs="0" maxOccurs="1"
name="accountNumber" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="amount"
type="s:int" />
<s:element minOccurs="0" maxOccurs="1"
name="chequeImage" type="s:base64Binary" />
<s:element minOccurs="0" maxOccurs="1"
name="PresentingBankNumber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="PresentingBranchNuber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="sequenceNumber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="ChequeNumber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="PostingDate" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetASVResults_ObjectResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1"
name="GetASVResults_ObjectResult" type="tns:Results" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="Results">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="result"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="rejectreason" type="s:string" />
</s:sequence>
</s:complexType>
<s:element name="GetASVResults_AD">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1"
name="branchNumber" type="s:int" />
<s:element minOccurs="0" maxOccurs="1"
name="accountNumber" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="amount"
type="s:int" />
<s:element minOccurs="0" maxOccurs="1"
name="chequeImage" type="s:base64Binary" />
<s:element minOccurs="0" maxOccurs="1"
name="PresentingBankNumber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="PresentingBranchNuber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="sequenceNumber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="ChequeNumber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="PostingDate" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetASVResults_ADResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1"
name="GetASVResults_ADResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetASVResults">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1"
name="branchNumber" type="s:int" />
<s:element minOccurs="0" maxOccurs="1"
name="accountNumber" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="amount"
type="s:int" />
<s:element minOccurs="0" maxOccurs="1"
name="chequeImage" type="s:base64Binary" />
<s:element minOccurs="0" maxOccurs="1"
name="PresentingBankNumber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="PresentingBranchNuber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="sequenceNumber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="ChequeNumber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="PostingDate" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetASVResultsResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1"
name="GetASVResultsResult" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="result"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="rejectReasonCode" type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="strExceptionMessage" type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="signatureNumber" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Add">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="a"
type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="b"
type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="AddResult"
type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="HelloWorld">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="s"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="HelloWorldResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1"
name="HelloWorldResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="GetASVResults_ObjectSoapIn">
<wsdl:part name="parameters"
element="tns:GetASVResults_Object" />
</wsdl:message>
<wsdl:message name="GetASVResults_ObjectSoapOut">
<wsdl:part name="parameters"
element="tns:GetASVResults_ObjectResponse" />
</wsdl:message>
<wsdl:message name="GetASVResults_ADSoapIn">
<wsdl:part name="parameters" element="tns:GetASVResults_AD" />
</wsdl:message>
<wsdl:message name="GetASVResults_ADSoapOut">
<wsdl:part name="parameters"
element="tns:GetASVResults_ADResponse" />
</wsdl:message>
<wsdl:message name="GetASVResultsSoapIn">
<wsdl:part name="parameters" element="tns:GetASVResults" />
</wsdl:message>
<wsdl:message name="GetASVResultsSoapOut">
<wsdl:part name="parameters"
element="tns:GetASVResultsResponse" />
</wsdl:message>
<wsdl:message name="AddSoapIn">
<wsdl:part name="parameters" element="tns:Add" />
</wsdl:message>
<wsdl:message name="AddSoapOut">
<wsdl:part name="parameters" element="tns:AddResponse" />
</wsdl:message>
<wsdl:message name="HelloWorldSoapIn">
<wsdl:part name="parameters" element="tns:HelloWorld" />
</wsdl:message>
<wsdl:message name="HelloWorldSoapOut">
<wsdl:part name="parameters"
element="tns:HelloWorldResponse" />
</wsdl:message>
<wsdl:portType name="ASVWSSoap">
<wsdlperation name="GetASVResults_Object">
<wsdl:input message="tns:GetASVResults_ObjectSoapIn" />
<wsdlutput message="tns:GetASVResults_ObjectSoapOut" />
</wsdlperation>
<wsdlperation name="GetASVResults_AD">
<wsdl:input message="tns:GetASVResults_ADSoapIn" />
<wsdlutput message="tns:GetASVResults_ADSoapOut" />
</wsdlperation>
<wsdlperation name="GetASVResults">
<wsdl:input message="tns:GetASVResultsSoapIn" />
<wsdlutput message="tns:GetASVResultsSoapOut" />
</wsdlperation>
<wsdlperation name="Add">
<wsdl:input message="tns:AddSoapIn" />
<wsdlutput message="tns:AddSoapOut" />
</wsdlperation>
<wsdlperation name="HelloWorld">
<wsdl:input message="tns:HelloWorldSoapIn" />
<wsdlutput message="tns:HelloWorldSoapOut" />
</wsdlperation>
</wsdl:portType>
<wsdl:binding name="ASVWSSoap" type="tns:ASVWSSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdlperation name="GetASVResults_Object">
<soapperation soapAction="http://tempuri.org/GetASVResults_Object"
style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdlutput>
<soap:body use="literal" />
</wsdlutput>
</wsdlperation>
<wsdlperation name="GetASVResults_AD">
<soapperation soapAction="http://tempuri.org/GetASVResults_AD"
style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdlutput>
<soap:body use="literal" />
</wsdlutput>
</wsdlperation>
<wsdlperation name="GetASVResults">
<soapperation soapAction="http://tempuri.org/GetASVResults"
style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdlutput>
<soap:body use="literal" />
</wsdlutput>
</wsdlperation>
<wsdlperation name="Add">
<soapperation soapAction="http://tempuri.org/Add"
style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdlutput>
<soap:body use="literal" />
</wsdlutput>
</wsdlperation>
<wsdlperation name="HelloWorld">
<soapperation soapAction="http://tempuri.org/HelloWorld"
style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdlutput>
<soap:body use="literal" />
</wsdlutput>
</wsdlperation>
</wsdl:binding>
<wsdl:binding name="ASVWSSoap12" type="tns:ASVWSSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdlperation name="GetASVResults_Object">
<soap12peration soapAction="http://tempuri.org/GetASVResults_Object"
style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdlutput>
<soap12:body use="literal" />
</wsdlutput>
</wsdlperation>
<wsdlperation name="GetASVResults_AD">
<soap12peration soapAction="http://tempuri.org/GetASVResults_AD"
style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdlutput>
<soap12:body use="literal" />
</wsdlutput>
</wsdlperation>
<wsdlperation name="GetASVResults">
<soap12peration soapAction="http://tempuri.org/GetASVResults"
style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdlutput>
<soap12:body use="literal" />
</wsdlutput>
</wsdlperation>
<wsdlperation name="Add">
<soap12peration soapAction="http://tempuri.org/Add"
style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdlutput>
<soap12:body use="literal" />
</wsdlutput>
</wsdlperation>
<wsdlperation name="HelloWorld">
<soap12peration soapAction="http://tempuri.org/HelloWorld"
style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdlutput>
<soap12:body use="literal" />
</wsdlutput>
</wsdlperation>
</wsdl:binding>
<wsdl:service name="ASVWS">
<wsdl:port name="ASVWSSoap" binding="tns:ASVWSSoap">
<soap:address location="http://153.58.19.96/ASVWS/ASVWS.asmx" />
</wsdl:port>
<wsdl:port name="ASVWSSoap12" binding="tns:ASVWSSoap12">
<soap12:address location="http://153.58.19.96/ASVWS/ASVWS.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>



Please help me out to resolve this issue


Thanks in advance
14 years ago
Can Anybody Please send me the Sample Code to get User's Full Name From Active Directory under particular group using java LDAP




Thanks in Advance
14 years ago

Hany Shafik wrote:Please post the wsdl, as it describes how you will call the Web Service.




Sorry for delay

here is the WSDL



14 years ago
Exception in thread "main" [SOAPException: faultCode=SOAP-ENV:Client; msg=No Deserializer found to deserialize a 'http://schemas.xmlsoap.org/soap/envelope/:Parameter' using encoding style 'null'.; targetException=java.lang.IllegalArgumentException: No Deserializer found to deserialize a 'http://schemas.xmlsoap.org/soap/envelope/:Parameter' using encoding style 'null'.]
at org.apache.soap.rpc.Call.invoke(Call.java:244)

MY CODE
-----------------



import java.io.*;
import java.net.*;
import java.util.*;
import org.apache.soap.*;
import org.apache.soap.encoding.SOAPMappingRegistry;
import org.apache.soap.encoding.soapenc.StringDeserializer;
import org.apache.soap.rpc.*;
import org.apache.soap.util.xml.QName;

public class Test_client {

public static void main (String[] args)
throws Exception {

System.out.println("\n\nCalling the SOAP Server to say hello\n\n");
URL url = new URL ("http://localhost/ASVWS/ASVWS.asmx?wsdl");
String name = "satya";
Call call = new Call ( );
String s="//";
String p="/";
//call.setTargetObjectURI("xmlns=http:"+s+"tempuri.org"+p);
SOAPMappingRegistry soapMappingRegistry = new SOAPMappingRegistry();
soapMappingRegistry.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("http://tempuri.org/", "HelloWorldResult"),null,null, new StringDeserializer());
call.setTargetObjectURI( "http://tempuri.org/");
call.setMethodName("HelloWorld");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setSOAPMappingRegistry(soapMappingRegistry);
Vector params = new Vector ( );
params.addElement (new Parameter("name", String.class, name, "http://schemas.xmlsoap.org/soap/encoding/"));
call.setParams (params);

System.out.print("The SOAP Server says: ");

Response resp = call.invoke(url,"http://tempuri.org/HelloWorld" );

if (resp.generatedFault ( )) {
Fault fault = resp.getFault ( );
System.out.println ("\nOuch, the call failed: ");
System.out.println (" Fault Code = " + fault.getFaultCode());
System.out.println (" Fault String = " + fault.getFaultString ( ));
} else {
System.out.println("Here");
Parameter result = resp.getReturnValue ( );
System.out.print(result.getValue ( ));
System.out.println( );
}
}
}



Please any help me out on this issue

Thanks in Advance
14 years ago
sir
without using new ,can we create object or not
18 years ago
2d
what is 2d in java
18 years ago
sir
is java 100% object oriented or not
18 years ago
sir,If interface has got four methods,and I like to implement only two methods, how this could be achieved?
18 years ago
sir please explain what is the markerinterface
18 years ago
first of all i am very much thankful to everyone who gave me answer to my question,but except only one man,he is mr Ankur Sharma .he really made me depressed.as a beginer i ask this question. i like mrSunil Kumar Gupta
's answer .thank you sir.
18 years ago
sir
can you tell me what is the markerinterface
18 years ago
sir
can anybody tell me what is the mean of cup 0f cofee symbol in java
18 years ago
sir
what is the difference betwee ngeneric servlet & http servlet
18 years ago
sir
kindly tell me what is the difference between ovrride & overload
18 years ago
sir
kindly tell me Which of the following are valid syntax for the main() method required by a Java application? & why

A. public static void main(String args[]){}
B. static public void main(String args[]){}
C. static public void main(String[] args){}
D. public static void main(String[] args){}
E. static public void main(String args){}
18 years ago