473,769 Members | 2,643 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can i send parameters in java client to .net web service

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

Mar 2 '06 #1
0 2235

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
9873
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ********************************** package Celcom.Client;
7
7116
by: David Laub | last post by:
I've also posted this issue to a Sun/java formum, but since it appears to be an integration issue, this may be the better place to posr: I have written a dot net/c# Web Services doesn't fully work with J2ME client a) c# web service works with c# WIndows Client (local & remote web service) b) c# web service works with J2ME client - when the Web Service is local c) c# web service fails with J2ME client - when the Web Service is remote ...
6
5486
by: Yoel | last post by:
Hi, I'm trying consuming web services over SSL by an ASP .Net client without success. System Architecture: My Server side contains the following layers, starting from the client side: (Client side) WSD firewall
18
44665
by: A.M | last post by:
Hi, Is there any way to call a WSS web service method by using browser and see the XML result in browser as well? I have been told that there is query string syntax for calling webservices.
2
1965
by: Pablo | last post by:
Hi at all! How can i send a DATA (not a DataTime) Type to a Java WebService? In .NET we have only a DataTime that is incompatible with the Data (calendar) Type of Java! How can i resolve this problem? I can't modify the java web-service and i need to send a simple data!!! AAARGH :P Help me! Tnx at all!
0
2196
by: Eric | last post by:
Hello I wan't to use a client PHP XMLRPC with my Java server XMLRPC. For simple type, all works fine. But for type like array, my server java lose my parameters ! How can I know if it comes from my PHP client or my Java server ? here is my code
2
3034
by: rhea | last post by:
I'm a Web Services newbie and I'm hoping some more experienced developers can help me out. I've written a .NET 2.0 web service that takes an XML file as input. The SOAP envelope is pre-defined within the XML document. I then send this XML to another web service (written in java) and that's where I encounter problems. After using a port sniffer, it looks as though the XML file I'm sending is being wrapped inside another SOAP envelope...
0
930
by: MaDukhiSaa | last post by:
Hi Experts, I am developing an application where i hava java client and Web service is serving this client. I would like to send some data back to Java client without request from Java client. How can it be solved? Is there any solution except shared database and Runtime Bridge. Bye!
2
3836
by: btcoder | last post by:
Hi, my jsp page uses sun.net.smtp.SmtpClient to send email. It worked fine until the hosted location was moved to another server. Now it generates the sun.net.smtp.SmtpProtocolException and the hosting company can't find what's wrong with it so I'm here hoping somebody can help. The hosting company tried sending email from the server and it was okay and found no restrictions that prevents my page to access the smtp server. What could cause...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10212
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3962
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.