Hi, i have a problem, I have a Java Client and i call my webservice on
..NET.
This run perfectly just except when i send parameters don't work fine.
I send my code :
This is my java client......... .
import java.io.*;
import java.util.*;
import java.net.*;
import org.w3c.dom.*;
import org.apache.soap .util.xml.*;
import org.apache.soap .*;
import org.apache.soap .encoding.*;
import org.apache.soap .encoding.soape nc.*;
import org.apache.soap .rpc.*;
import org.apache.soap .transport.http .SOAPHTTPConnec tion;
public class TpmClient {
public static void main(String[] args) throws Exception {
URL url = new URL ("http://localhost/InterfazTpm/InterfazTpm.asm x");
SOAPMappingRegi stry smr = new SOAPMappingRegi stry ();
StringDeseriali zer sd = new StringDeseriali zer ();
smr.mapTypes (Constants.NS_U RI_SOAP_ENC, new QName ("", "Result"),
null, null, sd);
// create the transport and set parameters
SOAPHTTPConnect ion st = new SOAPHTTPConnect ion();
// build the call.
Call call = new Call ();
call.setSOAPTra nsport(st);
call.setSOAPMap pingRegistry (smr);
call.setTargetO bjectURI ("http://tempuri.org/message/");
call.setMethodN ame("GenerarTpm ");
call.setEncodin gStyleURI
("http://schemas.xmlsoap .org/soap/encoding/");
Vector params = new Vector();
params.addEleme nt(new Parameter("cdin fo", int.class, "9396", null));
params.addEleme nt(new Parameter("nume roorden", int.class, "213100",
null));
call.setParams( params);
Response resp = null;
try {
resp = call.invoke (url, "http://tempuri.org/GenerarTpm");
}
catch (SOAPException e) {
System.err.prin tln("Caught SOAPException (" + e.getFaultCode () +
"): " + e.getMessage ());
return;
}
// check response
if (resp != null && !resp.generated Fault()) {
Parameter ret = resp.getReturnV alue();
Object value = ret.getValue();
System.out.prin tln ("Answer--> " + value);
}
else {
Fault fault = resp.getFault ();
System.err.prin tln ("Generated fault: ");
System.out.prin tln (" Fault Code = " + fault.getFaultC ode());
System.out.prin tln (" Fault String = " + fault.getFaultS tring());
}
}
}
this is my web service........ ........
public class InterfazTpm : System.Web.Serv ices.WebService
{
public InterfazTpm()
{
InitializeCompo nent();
}
private IContainer components = null;
private void InitializeCompo nent()
{
}
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Disp ose();
}
base.Dispose(di sposing);
}
#endregion
[WebMethod]
public string GenerarTpm(int cdinfo,int numeroorden)
{
CTpm OrderTpm =new CTpm(cdinfo,num eroorden);
return ("Tpm Generado"+numer oorden);
}
}
}
I like know where is the error or how can i resolve to recieve the
parameters.
Please answer me, i don't know what to do now