null parameter problem while calling .net web service from java client

Hello,
I have a C# .NET web service and a Java client .
My java client is able to call the C# method , but when the client calls methods containing complex type parameters , they are ending up being null on the .net side eventhough I am sending the parameters with valid values.
I traced also the SOAP messages and they are also semms OK. But why are they arriving null to .net side. What goes wrong? Did anybody
whom faced this problem could solve it and how.

As I see this is a very common problem as I searched similar forums. So any acceptable answer will be useful to many people suffering this problem.

Thanks to everyone that answers me...
-1
zagorbrick
7/25/2005 1:56:23 PM
asp.net.xml-web-services 7071 articles. 0 followers. Follow

4 Replies
1364 Views

Similar Articles

[PageSpeed] 14
Get it on Google Play
Get it on Apple App Store

Check to see that the elements/attributes on the request SOAP message
sent by the java client to the server are in the correct namespace (as
required by the service definition)

Tomas Restrepo [MVP]
tomasr@mvps.org
1
tomasr
7/26/2005 2:34:02 AM
-
Here is the part of the SOAP message that I copied from the MSSOAP toolkit Trace tool :

 <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:SessionInfo"
   xmlns:ns3
="http://datatypes.a.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
              <HostID href="#id9" />
              <returnCode href="#id10" />
              <sessionId href="#id11" />
              <userId xsi:type="xsd:string">a</userId>
          <userLevel href="#id12" />
      </multiRef>

***********************************************************************************************************
And this is the corresponding class that I built by using wsdl.exe tool

[System.Xml.Serialization.SoapTypeAttribute("SessionInfo", "http://datatypes.a.com")]
public class SessionInfo
{
   
    /// <remarks/>
    public int OwnerHostID;
   
    /// <remarks/>
    public ReturnCode returnCode;
   
    /// <remarks/>
    public int sessionId;
   
    /// <remarks/>
    public string userId;
   
    /// <remarks/>
    public int userLevel;
}
*******************************************************************************************
This is from the abstract class that I built using wsdl.exe tool

    [System.Web.Services.WebMethodAttribute()]
    [System.Web.Services.Protocols.SoapRpcMethodAttribute("http://a.com/notifyTableData",  RequestNamespace="http://a.com", ResponseNamespace="http://a.com")]

    public abstract void notifyTableData(SessionInfo in0);

*********************************************************************************************

And This is from my implementation class

        [WebMethod]
        public  override void notifyTableData(SessionInfo session)
        {   
            try
            {
                if( session!= null )
                {
                    remoteOperations.notifyTableData(session);
                }
                else
                {
                    Logger.append("session is null",Logger.INFO);
                }
            }           
            catch (Exception exc)
            {
                Logger.append("Exception @ NotificationService.notifyTableData "+exc.ToString(),Logger.ERROR);
            }
        }



*********************************************************************************************
Looking at the above codes I don't see anything wrong but if there is could you explain me. Hence I should say that
the web service methods with no attributes work fine but those only getting parameters as input do not work as the
parameters are  coming null to the service.

1
zagorbrick
7/26/2005 5:53:53 AM
I think you need to put this attribute:
  [System.Web.Services.Protocols.SoapRpcMethodAttribute("http://a.com/notifyTableData",  RequestNamespace="http://a.com", ResponseNamespace="http://a.com")]

on the method of the implementation class (the one derived from the WSDL.exe-generated one), because the ASP.NET runtime, unfortunately, does not look for those attributes in base classes, only in the implementation one...


Tomas Restrepo [MVP]
tomasr@mvps.org
0
tomasr
7/27/2005 11:47:03 AM
thank you very much that solved my problem :)
0
zagorbrick
7/28/2005 9:20:56 AM
Reply:

Similar Artilces:

How to call a .net web service from another .net web service?
Hi all,I have developed two asp .net web services using visual studio .net 2003.I wish to call one web service from another web service.I tried adding a web reference of the web service in another web service and was able to do so.but i m not able to access the web methods provided by the web servicecould you please suggest a way to go about itExpecting quick replyThanxCharmy try to make sure that you reference it in the web reference and call it properly this is sample  [WebMethod()] public double CalcDistance(int x1, int y1, int x2, int y2) { Calculator.Service1 calc = new...

Web service in .NET from Java Web Service
Hi there,I'm pretty new to .net (although i have years of experience with the old vb 6, access 2k, as well as java)... and need some with perhaps either some syntax or something.Here is the wsdl.<wsdl:definitions targetNamespace="http://www.dynix.com/schema/book">−<wsdl:types>−<schema targetNamespace="GetBookInfoByISBN">−<complexType name="BookInfoType">−<sequence><element maxOccurs="1" minOccurs="0" name="Title" nillable="true" type="xsd:string"/><element maxOccurs=&quo...

.NET web services Vs Java Web Services
Hello, does anyone know of a book or good source of information that compares .NET and Java Web Services? (I would like soemthing neutral if possible). I am thinking of approaching this subject for my dissertation? Many Thanks Rob Hi Rob, Last year I had to give a powepoint presentation on Web Services. I noticed some good books at barnes and noble that discussed the subject. These books were specific to Java and discussed Web Services in a very clear fashion. They gave some elementary examples that were easy to understand. I have not yet had the pleasure of creatin .NET Web Servi...

How to call .net web service from Java web application?
Hi all,  I have a vb .net web service.How do i call .net web service from Java web application?What all resources I need?Can you please provide a sample application where a java application is invoking methods of .net web service? Thank you Hi, First I am not familiar with java language, but web services are universal operating system and language independent. It doesn't matter where the services is or in what language is written you just invoke it  and it gives you "replay".  Probably you must reffer to java consuming web services.   Regard...

web services calling services simultaneosly problem in .net 2.0
hi i m facing a problemwe are using desktop client and webservices in that client request the a webservice asyncthat remains on server until a specific condition is satisfiedand rest of the web services are called syncronsly these services run on localhost without any problembut if client and server machines are diffrent it hangs the applicationdont knw wht is the reasn and after some time operation has timed out exceptions comelet me tell u one more thingboth the services are using different sessionsthanx in advance for ur help   i have made sample application to test the scnerio...

problem in using java web services from .net client
I am trying to make a .net client for a java web service made using JAX-WS 2.0 . Actually the web service maintains session of the client. Well i did create a client from java and it worked. But i am having problem in consuming the web service from .net client. According to the specification of that web service i have to set the SESSION_MAINTAIN_PROPERTY of the BindingProvider true to indicate whether or not the client wants to participate in session with service endpoint. It is done in java client in following way:Hello proxy = new HelloService()...

How To: Call a Java EE Web Service from a .Net Client
Hi, I have to call a Java Web Service from a .Net Client .I'm using VS2008 (.net 3.5) Did you face the same situation ? The web service offers some methods. Each method returns a xml file and a xml attachment. I found this article.http://blogs.msdn.com/bursteg/archive/2008/07/19/how-to-call-a-java-ee-web-service-from-a-net-client.aspx . Do you think that this is a good resource ?  I watched something about WCF. Have I to use WCF ? How can I manage xml attachment ? thank you for your attention .     It's a good resource and there are also other way...

Cannot call a web service from java script using ajax in .net 3.5 web applications
As like 2005 .net websites i tried to consume a web service from client side java script  using Ajax script manager in  .net 3.5 (2008) version web application it was not working, Event it works with 3.5 web sites, What i have to do to solve the issue. Thanks in advance Hi, can you create the least amount of code to reproduce it and post it? This gives us the ability to check out your code and better guide you. Also please check out this article: Create a Simple WCF Web Service and Use In JavaScript With Visual Studio 2008 and .Net 3.5.  Grz, Kris.Read my blog. Handy Fire...

Call a SECURED (with glassfish) Java EE Web Service from a .Net Client
Hi, Im trying to call a java web service in visual studio 2008 using a simple forms application. The problem that I'm running into is with the security. Can someone point me in the right direction as far as calling a secured java EE web service using .Net? Thanks. Adam Im unfamiliar with glassfish, however if the web service's security is WS-Security compliant, then you'll have to use WSE 3.0 (addon by Microsoft to make web services more useful) or Windows Communication Foundation. Thanks for the reply. Can you point me in the direction of using WSE to call a java...

Problem calling Web Service using the DynamicPopulate Extender
Hi, I'm quite new to ASP.Net AJAX so please forgive my ignorance.  I have downloaded and installed the RC1 version and am following through some of the tutorial videos.  I am having a problem with the Dynamic Populate Extender example.  I have created some asp controls with onclick events calling a javascript function.  From there I am attempting to use a dynamic populate extender control to call a web service - it's a function declared on that ASPX page as the tutorial explains in necessary and decorated with the System.Web.Services.WebMEthod AND System.Web.Script.Serv...

Problem when calling web service client SP with XML parameter from ASA 9.0.2.3632
Hello, I have a problem when calling web service client stored procedure with XML type parameter from ASA 9.0.2. Suppose web service client stored procedure is like this: create procedure ws_test(in input XML) result(output XML,returnParams XML) url 'http://www.google.com' type 'SOAP:DOC' namespace 'www.google.com' I execute it with structured XML input parameter: call ws_test('<input><x>22</x><y>33</y></input>') On ASA 9.0.2.3632 HTTP trace shows the following SOAP request body: <SOAP-ENV:Body> &...

Java Call to .Net Web Service
Hi, I have a web service that needs a dataset as in parameter in my .net application. A Java application is going to call this web service. There seems some problem which the Java app can not pass in a parameter as dataset. xml serialized string. The .net application can not translate the string back to dataset. Can someone help?Dave Dave That's one of the most asked questions about web services.  You will have real difficulties trying to use DataSets in an interop environment.  You can improve the situation a little by using strongly typed DataSets, but ideally y...

Problems with Web Service Call with .NET
We need to call a Web Service from one of our partners application. Their Web Service has been running for several years and other companies have been able to connect to it and download data with different pieces of software or languages When i try to setup this web service call in Powerbuilder 11.1 Build 8123, i am having problems. Even when using .NET to call the service Creating the Proxy works just fine as i select the service and then the methods. Deploying the proxy works great also. However when i call the very first function in the service SdkLogin, i am getting the gene...

Client .NET Web Service Java
 Hi, I am reading some docs about Web Services and I have some questions,  1) If I have a Web service wrote in Java, Can I use it from a asp or a Windows form??2) If It's not possible, and the webservice only have to recive 2 parameters (for instance add(int a, int b)) can I write myself the SOAP message and pass it to the Java WebService?? I'm not sure about all of this, because to make a client for a webservice you only have to know what parameters are needed. Thanx for your help! Please remember to click “Mark as Answer” on the post that helps you, and to click...

Web resources about - null parameter problem while calling .net web service from java client - asp.net.xml-web-services

Parameter - Wikipedia, the free encyclopedia
A parameter (from the Ancient Greek παρά , "para", meaning "beside, subsidiary" and μέτρον , "metron", meaning "measure"), in its common meaning, ...

fb_source Parameter - Facebook-Entwickler
This document lists the complete list of values for the fb_source parameter that is returned with th...

Google / Firefox Parameter - Flickr - Photo Sharing!
HS what? www.seroundtable.com/archives/017105.html

Cat 8: TIA performance standards committee chairman previews parameters of forthcoming twisted-pair cable ...
Category 8, the next-generation twisted-pair cabling specification, is still in development, but the outlook looks quite positive that it will ...

Philippine president asks for 'parameters' of Mayon Volcano tours
Philippine president asks for 'parameters' of Mayon Volcano tours People's Daily Online ... 26, 27, 28, 29, 30, 31. Jan, Feb, Mar, Apr, May, ...

Alternatives to boolean parameters
... ) { PrintLine ( item . Name ); if ( printDetails ) { PrintLine ( item . Description ); } } } Aha! Now can see that the boolean parameter ...

Exporting Error (Error in Parameter...: Apple Support Communities
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability ...

Apple tech monitors device aging, adjusts operating parameters to ensure optimal performance
... describing a method of monitoring the aging of a device's electronics, comparing the data with a global average and modifying operating parameters ...

Is it poor programming practice to pass parameters as objects?
... a free, community-powered network of 100+ Q&A sites . Risser asked: So, we've got a guy who likes to write methods that take Objects as parameters, ...

Parameter Short Film Competition sponsored by Grolsch
Grolsch presents Parameter The A.V. Club Short Film Competition Please Enter Your Date of Birth Ineligible entry Enter For people over the age ...

Resources last updated: 1/15/2016 5:15:17 AM