By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,180 Members | 1,016 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,180 IT Pros & Developers. It's quick & easy.

Not able to create a .Net client for Java web service

P: n/a
Hi,
I have a java webservice running on Axis, Iam able to create a java client
to invoke the webservice and obtain the result.
But iam not able to invoke the service from .Net client..
Here are the steps i followed to create a .net client

I created a web reference("NetClient") for a webservice running in Axis
thru "Add Web Reference", it created succesfully.

The next step I should do in order to invoke the service is to
to instansiate that like
NetClient.IStringServicePort emp1 = new NetClient.IStringServicePort();
Where NetClient is the web reference and NetClient.IStringServicePort is the
service.
But what happens is NetClient object is not visible in my c# class.
can any one let me know what could be the problem..

Note: When I do not specify input message for the operation "sayXMLHello" it
works fine even with .Net client, but when
i give both input and output messages for "sayXMLHello" then iam facing the
problem I described above.
Please refer the .wsdl file i created for deploying in axis..

<definitions xmlns:tns="urn:StringService2"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns2="urn:StringService2"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="urn:StringService2"
name="XMLStringService">
<types>
<schema targetNamespace="urn:StringService2" xmlns:tns="urn:StringService2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://www.w3.org/2001/XMLSchema">

<complexType name="sayXMLHello">
<sequence>
<element name="String_1" type="string" nillable="true"/>
</sequence>
</complexType>
<complexType name="sayXMLHelloResponse">
<sequence>
<element name="result" type="string" nillable="true"/>
</sequence>
</complexType>
<element name="sayXMLHello" type="tns:sayXMLHello"/>
<element name="sayXMLHelloResponse" type="tns:sayXMLHelloResponse"/>
</schema>
</types>
<message name="IStringService_sayXMLHello">
<part name="parameters" element="ns2:sayXMLHello"/>
</message>
<message name="IStringService_sayXMLHelloResponse">
<part name="parameters" element="ns2:sayXMLHelloResponse"/>
</message>
<portType name="IStringService">
<operation name="sayXMLHello">
<input message="tns:IStringService_sayXMLHello"/>
<output message="tns:IStringService_sayXMLHelloResponse"/>
</operation>
</portType>
<binding name="IStringServiceBinding" type="tns:IStringService">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="sayXMLHello">
<soap:operation soapAction="urn:StringService2" style="document" />
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="XMLStringService">
<port name="IStringServicePort" binding="tns:IStringServiceBinding">
<soap:address
location="http://localhost:8080/axis/services/IStringServicePort"/>
</port>
</service>
</definitions>
Nov 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hello Dhananjayan,
In file explorer open up the Web References folder under your project
and open up the References.cs (in a subdirectory based on yr add reference)
file and see what the namespace is for the proxy and try to use that name.

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,
I have a java webservice running on Axis, Iam able to create a java
client
to invoke the webservice and obtain the result.
But iam not able to invoke the service from .Net client..
Here are the steps i followed to create a .net client
I created a web reference("NetClient") for a webservice running in
Axis thru "Add Web Reference", it created succesfully.

The next step I should do in order to invoke the service is to
to instansiate that like
NetClient.IStringServicePort emp1 = new
NetClient.IStringServicePort();
Where NetClient is the web reference and NetClient.IStringServicePort
is the
service.
But what happens is NetClient object is not visible in my c# class.
can any one let me know what could be the problem..
Note: When I do not specify input message for the operation
"sayXMLHello" it
works fine even with .Net client, but when
i give both input and output messages for "sayXMLHello" then iam
facing the
problem I described above.
Please refer the .wsdl file i created for deploying in axis..
<definitions xmlns:tns="urn:StringService2"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns2="urn:StringService2"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="urn:StringService2"
name="XMLStringService">
<types>
<schema targetNamespace="urn:StringService2"
xmlns:tns="urn:StringService2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://www.w3.org/2001/XMLSchema">
<complexType name="sayXMLHello">
<sequence>
<element name="String_1" type="string" nillable="true"/>
</sequence>
</complexType>
<complexType name="sayXMLHelloResponse">
<sequence>
<element name="result" type="string" nillable="true"/>
</sequence>
</complexType>
<element name="sayXMLHello" type="tns:sayXMLHello"/>
<element name="sayXMLHelloResponse" type="tns:sayXMLHelloResponse"/>
</schema>
</types>
<message name="IStringService_sayXMLHello">
<part name="parameters" element="ns2:sayXMLHello"/>
</message>
<message name="IStringService_sayXMLHelloResponse">
<part name="parameters" element="ns2:sayXMLHelloResponse"/>
</message>
<portType name="IStringService">
<operation name="sayXMLHello">
<input message="tns:IStringService_sayXMLHello"/>
<output message="tns:IStringService_sayXMLHelloResponse"/>
</operation>
</portType>
<binding name="IStringServiceBinding" type="tns:IStringService">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="sayXMLHello">
<soap:operation soapAction="urn:StringService2" style="document" />
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="XMLStringService">
<port name="IStringServicePort" binding="tns:IStringServiceBinding">
<soap:address
location="http://localhost:8080/axis/services/IStringServicePort"/>
</port>
</service>
</definitions>

Nov 23 '05 #2

P: n/a
Hi Dilip,
For me when I create the web reference the Reference.cs file is not getting
created.
any reason for this..
But iam able to see the Reference.map and <servicename>.wsdl file for my
created web reference in the web reference view..

"Dilip Krishnan" wrote:
Hello Dhananjayan,
In file explorer open up the Web References folder under your project
and open up the References.cs (in a subdirectory based on yr add reference)
file and see what the namespace is for the proxy and try to use that name.

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,
I have a java webservice running on Axis, Iam able to create a java
client
to invoke the webservice and obtain the result.
But iam not able to invoke the service from .Net client..
Here are the steps i followed to create a .net client
I created a web reference("NetClient") for a webservice running in
Axis thru "Add Web Reference", it created succesfully.

The next step I should do in order to invoke the service is to
to instansiate that like
NetClient.IStringServicePort emp1 = new
NetClient.IStringServicePort();
Where NetClient is the web reference and NetClient.IStringServicePort
is the
service.
But what happens is NetClient object is not visible in my c# class.
can any one let me know what could be the problem..
Note: When I do not specify input message for the operation
"sayXMLHello" it
works fine even with .Net client, but when
i give both input and output messages for "sayXMLHello" then iam
facing the
problem I described above.
Please refer the .wsdl file i created for deploying in axis..
<definitions xmlns:tns="urn:StringService2"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns2="urn:StringService2"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="urn:StringService2"
name="XMLStringService">
<types>
<schema targetNamespace="urn:StringService2"
xmlns:tns="urn:StringService2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://www.w3.org/2001/XMLSchema">
<complexType name="sayXMLHello">
<sequence>
<element name="String_1" type="string" nillable="true"/>
</sequence>
</complexType>
<complexType name="sayXMLHelloResponse">
<sequence>
<element name="result" type="string" nillable="true"/>
</sequence>
</complexType>
<element name="sayXMLHello" type="tns:sayXMLHello"/>
<element name="sayXMLHelloResponse" type="tns:sayXMLHelloResponse"/>
</schema>
</types>
<message name="IStringService_sayXMLHello">
<part name="parameters" element="ns2:sayXMLHello"/>
</message>
<message name="IStringService_sayXMLHelloResponse">
<part name="parameters" element="ns2:sayXMLHelloResponse"/>
</message>
<portType name="IStringService">
<operation name="sayXMLHello">
<input message="tns:IStringService_sayXMLHello"/>
<output message="tns:IStringService_sayXMLHelloResponse"/>
</operation>
</portType>
<binding name="IStringServiceBinding" type="tns:IStringService">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="sayXMLHello">
<soap:operation soapAction="urn:StringService2" style="document" />
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="XMLStringService">
<port name="IStringServicePort" binding="tns:IStringServiceBinding">
<soap:address
location="http://localhost:8080/axis/services/IStringServicePort"/>
</port>
</service>
</definitions>


Nov 23 '05 #3

P: n/a
Dhananjayan,

You need to choose "show all files" option for the project and you will see
the file then. If your Add Rererence is successful then proxy must have been
created and should be able to see

hth
Sriram
"Dhananjayan" wrote:
Hi Dilip,
For me when I create the web reference the Reference.cs file is not getting
created.
any reason for this..
But iam able to see the Reference.map and <servicename>.wsdl file for my
created web reference in the web reference view..

"Dilip Krishnan" wrote:
Hello Dhananjayan,
In file explorer open up the Web References folder under your project
and open up the References.cs (in a subdirectory based on yr add reference)
file and see what the namespace is for the proxy and try to use that name.

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,
I have a java webservice running on Axis, Iam able to create a java
client
to invoke the webservice and obtain the result.
But iam not able to invoke the service from .Net client..
Here are the steps i followed to create a .net client
I created a web reference("NetClient") for a webservice running in
Axis thru "Add Web Reference", it created succesfully.

The next step I should do in order to invoke the service is to
to instansiate that like
NetClient.IStringServicePort emp1 = new
NetClient.IStringServicePort();
Where NetClient is the web reference and NetClient.IStringServicePort
is the
service.
But what happens is NetClient object is not visible in my c# class.
can any one let me know what could be the problem..
Note: When I do not specify input message for the operation
"sayXMLHello" it
works fine even with .Net client, but when
i give both input and output messages for "sayXMLHello" then iam
facing the
problem I described above.
Please refer the .wsdl file i created for deploying in axis..
<definitions xmlns:tns="urn:StringService2"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns2="urn:StringService2"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="urn:StringService2"
name="XMLStringService">
<types>
<schema targetNamespace="urn:StringService2"
xmlns:tns="urn:StringService2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://www.w3.org/2001/XMLSchema">
<complexType name="sayXMLHello">
<sequence>
<element name="String_1" type="string" nillable="true"/>
</sequence>
</complexType>
<complexType name="sayXMLHelloResponse">
<sequence>
<element name="result" type="string" nillable="true"/>
</sequence>
</complexType>
<element name="sayXMLHello" type="tns:sayXMLHello"/>
<element name="sayXMLHelloResponse" type="tns:sayXMLHelloResponse"/>
</schema>
</types>
<message name="IStringService_sayXMLHello">
<part name="parameters" element="ns2:sayXMLHello"/>
</message>
<message name="IStringService_sayXMLHelloResponse">
<part name="parameters" element="ns2:sayXMLHelloResponse"/>
</message>
<portType name="IStringService">
<operation name="sayXMLHello">
<input message="tns:IStringService_sayXMLHello"/>
<output message="tns:IStringService_sayXMLHelloResponse"/>
</operation>
</portType>
<binding name="IStringServiceBinding" type="tns:IStringService">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="sayXMLHello">
<soap:operation soapAction="urn:StringService2" style="document" />
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="XMLStringService">
<port name="IStringServicePort" binding="tns:IStringServiceBinding">
<soap:address
location="http://localhost:8080/axis/services/IStringServicePort"/>
</port>
</service>
</definitions>


Mar 7 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.