POST /NameWebService/EchoService.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/EchoName"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<EchoName xmlns="http://tempuri.org/">
<name>string</name>
</EchoName>
</soap:Body>
</soap:Envelope>
The Java Axis client formats the Request as follows:
POST /NameWebService/EchoService.asmx HTTP/1.0
Content-Length: 449
Host: supernova-4
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://tempuri.org/EchoName"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:EchoName xmlns:ns1="http://tempuri.org/">
<name xsi:type="xsd:string">Fred</name>
</ns1:EchoName>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
This is exactly the same (if you take into account the XML namespace
changes). But I manually modified the message to be as follows (and it
works):
POST /NameWebService/EchoService.asmx HTTP/1.0
Content-Length: 437
Host: supernova-4
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://tempuri.org/EchoName"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<!-- remove the namespace tag on EchoName-->
<EchoName xmlns="http://tempuri.org/">
<name xsi:type="xsd:string">Fred</name>
</EchoName>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Using this SOAP Request, the .NET WebService works. The only difference is
that Apache Axis added the "ns1" tag to the EchoName which in my mind is
completely acceptable XML formatting of the SOAP message but that confuses
the .NET Framework WebService.
To my eye, this appears to be a bug in the Framework. Any ideas how to get
around this?
Jim
Martin
This posting is provided "AS IS" with no warranties, and confers no rights.
<WebMethod()> Public Function EchoName(ByVal name As String) As String
EchoName = "Your name is " & name
End Function
"Martin Petersen-Frey" <marty@redmond> wrote in message
news:AZFtjq12BHA.2312@cpmsftngxa10...
[SoapDocumentMethod(
RequestNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Encoded)
]
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://fssb.myfico.com"
xmlns:types="http://fssb.myfico.com/encodedTypes"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encodin
g/">
<q1:HelloWorld xsi:type="q1:HelloWorld"
xmlns:q1="http://tempuri.org/">
<str xsi:type="xsd:string">string</str>
</q1:HelloWorld>
</soap:Body>
</soap:Envelope>
Dima
>.
>
I may look into it more in the future, but for now, .NET appears to be out
of the question for this application.
Jim
"Dima Maltsev" <dimam...@fairisaac.com> wrote in message
news:570801c1dc14$21897e00$37ef2ecf@TKMSFTNGXA13...
I'm looking into this. I'll get back to you.
I took a look at your question. Actually the XML in the SOAP envelope the
Apache client is sending to the Web Service is not correct. When the
Apache client specifies the alias "ns1" for the "http://tempuri.org/"
namespace instead of making it the default namespace for that parameter it
must also add the alias to all child tags that are a part of that
namespace. It didn't do this. If you don't do that, the ASP.NET Web
Service can't indentify the parameter and ignores it. To get the correct
behavior you need to change the SOAP envelope you posted which is:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:EchoName xmlns:ns1="http://tempuri.org/">
<name xsi:type="xsd:string">Fred</name>
</ns1:EchoName>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
To:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:EchoName xmlns:ns1="http://tempuri.org/">
<ns1:name xsi:type="xsd:string">Fred</ns1:name>
</ns1:EchoName>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Note that all I did was to change the <name
xsi:type="xsd:string">Fred<name> tag to
<ns1:name xsi:type="xsd:string">Fred</ns1:name>. The child tags need to
specified as being part of that namespace.
Do that and you'll find that the Web Service works as expected.
Let me know if you have any questions about this.
I just answered the question earlier. The XML in the SOAP envelope the
Apache client is sending to the Web Service is not correct. When the
Apache client specifies the alias "ns1" for the "http://tempuri.org/"
namespace instead of making it the default namespace for that parameter it
must also add the alias to all child tags that are a part of that
namespace. It didn't do this. If you don't do that, the ASP.NET Web
Service can't indentify the parameter and ignores it. Going with SOAP
Encoding, as you suggest, will fix this because namespaces are no longer
needed to identify parameter types but that isn't the root of the
problem. Doc/Literal is the way to go in most cases.