Q
Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

Create a .NET client for Web service

I am unable to create a .NET client for a simple Web service, however, I am able to access the service using Java. Can you please tell me what I am doing wrong?

<definitions xmlns:tns="urn:StringService2"
             xmlns="http://schemas.xmlsoap.org/wsdl/"
             xmlns:ns2="urn:StringService2"
             xmlns:xsd="https://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="https://www.w3.org/2001/XMLSchema-instance"
	             xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
	             xmlns="https://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/> 
		<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>

You have a namespace error in your WSDL document. In your lt;bindinggt; and lt;portgt; definitions you reference wsdl elements using the "tns" namespace prefix, but you have not defined this namespace prefix in your wsdl lt;definitions> element. Either add a namespace declaration for the "tns" namespace prefix to your <definitions>element or change the references to use the "ns2" prefix instead, for example:

<binding name="IStringServiceBinding" type="ns2 :IStringService">

and

<port name="IStringServicePort" binding="ns2:IStringServiceBinding">

This was last published in March 2005

Dig Deeper on Development implications of microservices architecture

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide.com

SearchWinDevelopment

DevOpsAgenda

Close