Accessing Web-Services with .NET

hi everyone one i made a webservice in php to get string and transform this string into upper case and also i made another function to make a mirror for my text

EX:
john will return JOHN and nhoj in the second function

the user of my website wants to use this webservice but in .NET

my WSDL code is:


<?xml version ='1.0' encoding ='UTF-8' ?>
<definitions name='Scramble' 
  targetNamespace='http://www.o-survey.com/john_test/johns/scramble2.wdsl' 
  xmlns:tns='http://www.o-survey.com/john_test/johns/scramble2.wdsl' 
  xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' 
  xmlns='http://schemas.xmlsoap.org/wsdl/'> 

<message name='getRot13Request'> 
  <part name='symbol' type='xsd:string'/> 
</message> 
<message name='getRot13Response'> 
  <part name='Result' type='xsd:string'/> 
</message> 
<message name='getMirrorRequest'> 
  <part name='symbol' type='xsd:string'/> 
</message> 
<message name='getMirrorResponse'> 
  <part name='Result' type='xsd:string'/> 
</message> 

<portType name='ScramblePortType'> 
  <operation name='getRot13'>
    <input message='tns:getRot13Request'/> 
    <output message='tns:getRot13Response'/>   
  </operation>
  <operation name='getMirror'>
    <input message='tns:getMirrorRequest'/> 
    <output message='tns:getMirrorResponse'/>   
  </operation>    

</portType> 

<binding name='ScrambleBinding' type='tns:ScramblePortType'> 
  <soap:binding style='rpc' 
    transport='http://schemas.xmlsoap.org/soap/http'/> 
  <operation name='getRot13'> 
    <soap:operation soapAction='urn:localhost-scramble#getRot13'/> 
    <input> 
      <soap:body use='encoded' namespace='urn:localhost-scramble' 
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </input> 
    <output> 
      <soap:body use='encoded' namespace='urn:localhost-scramble' 
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </output> 
  </operation>
  <operation name='getMirror'> 
    <soap:operation soapAction='urn:localhost-scramble#getMirror'/> 
    <input> 
      <soap:body use='encoded' namespace='urn:localhost-scramble' 
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </input> 
    <output> 
      <soap:body use='encoded' namespace='urn:localhost-scramble' 
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </output> 
  </operation>       

</binding> 

<service name='ScrambleService'> 
  <port name='ScramblePort' binding='ScrambleBinding'> 
    <soap:address location='http://www.o-survey.com/john_test/johns/server2.php'/> 
  </port> 
</service>
</definitions> 


My problem is that when the user tried to get the result in .NET he received the attached error image.

i tried to test my webservice in the website http://www.soapclient.com/soaptest.html and i put in the text field this link [COLOR=“Red”]http://www.o-survey.com/john_test/johns/scramble2.wsdl[/COLOR] and it get result so how i can solve this one? or where is the error

I’m confused. You attached PHP code - which works in PHP
But you posted in the .NET forum and are asking about .NET

“the user of my website wants to use this webservice but in .NET”

I think he wants the Web Service coveted in .NET, or consume the Web Service in .NET.

The webservice is not a valid SOAP service. I think the php community will be able to offer better suggestions on how to rectify it. As it seems to be the on the php side.

I added “trace” to the client and did a getLastResponse()

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
			xmlns:ns1="urn:localhost-scramble"
			xmlns:xsd="http://www.w3.org/2001/XMLSchema"
			xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
			xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
			SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
	<SOAP-ENV:Body>
		<ns1:getMirrorResponse>
			<Result xsi:type="xsd:string">ippississim</Result>
		</ns1:getMirrorResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

No errors that I see. What does the .NET client look like? Is it looking for the DISCO namespace?

I wonder if .NET needs the file extension to be .wsdl

In other words, instead of
… server2.php?WSDL

it wants
scramble2.wsdl

Either that or it might be choking on the ?

Maybe you could do some kind of URL rewrite so a Request for .wsdl goes to the .php?WSDL file?

the client wants to use my PHP webservice using ASP.NET
and he got the attached error image.

i tried to use the website : http://www.soapclient.com/soaptest.html and my web service is working well…

but i dont know how to help him in uysing my webservice in aSP.NET coz i dont know ASP… please reply

i tried to put scramble2.wsdl instead of server2.php?wsdl but it did not work…

how i can solve it?

I went to http://www.o-survey.com/john_test/johns/scramble2.wsdl and it returned
Content-type: text/plain
headers. That should be XML no? i.e. try
text/xml

could you please tell mee how did u use it in ASP?

I didn’t use .NET, I used my browser and looked at the HTTP headers the server was sending. If you’re server is PHP you can send headers or associate the file extension with the correct content type.

If you’re server is .NET, I’m sorry but I wouldn’t know that, I’ve only worked with SOAP using PHP

But one of the good things about SOAP is it’s language independent, that is, your server can be PHP and the client can be .NET (or any other combination).

I’m guessing that PHP reads the returned XML OK (even though returned as text) but .NET needs the content type header to be XML

Once you get the header correct try again with a .NET client, my bet is it will then work OK - or at least not that error.