I have a java SOAP 2.2 client talking to a .Net service. I did not have any problems with the Request, but the Response was a pain. After the .Net Service identified the response with a String attribute and I used the SOAPMappingRegistry, all was fine.
However with Regards to my Request code - I am not importing an XML doc, but constructing one using a Vector of Parameter objects. I do not specify an XSI within the params - only the element, class type, value and the Constants.NS_URI_SOAP_ENC encoding. So my client is essentially creating the same XML as your .Net friends want.
But on a philosophical note, it is the service that dictates the format of the Request. As lond as there is not MS proprietary plumbing, then why argue.
-----Original Message-----
From: John Bowen
To: soap user
Sent: 10/04/2001 3:09 PM
Subject: Help with parameters in Apache SOAP client and .NET SOAP service
Hi all,
I'm pulling my hair out trying to get my Apache SOAP [v2.2] client
working
with a .NET asmx service.
When I send my SOAP request the server reads the parameters I'm
passing it
as null values and rejects my requests no matter what data I fill these
parameters with. We're arguing back and forth on whose XML is at fault,
and
I need some opinions on if my client request is at least SOAPvalid or
not.
Unfortunately the SOAP server isn't in-house, it's another company and
I
don't have control or can even snoop around the box. After a few days
of
headaches and searching Google I did fix one of the interoperability
problems by creating a new StringDeserializer to get around that pesky
deserializer exception thrown when the .NET service doesn't return
xsi:type
information with the response.
Here is the XML I'm sending as a request:
--------------
POST /userservice/userservice.asmx HTTP/1.0
Host: www.candyland.com
Content-Type: text/xml; charset=utf-8
Content-Length: 655
SOAPAction: "http://www.candyland.com/soap_MakeNewUser"
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:soap_MakeNewUser xmlns:ns1="http://www.candyland.com"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<User_Name xsi:type="xsd:string">myUserName</User_Name>
<User_Password
xsi:type="xsd:string">myPassword</User_Password>
<Email_Address
xsi:type="xsd:string">[EMAIL PROTECTED]</Email_Address>
</ns1:soap_MakeNewUser>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--------------
The argument the .NET programmer makes is that his .NET server expects
just <User_Name>name</User_Name>, but the spec I read on w3.org tells me
there's no problem with including the xsi:type information in my
parameters.
This shouldn't be this difficult, my code is based on the few examples
I've found on the net on doing this and it seems relatively
straightforward.
Anyone with ideas or had similar problems with Apache SOAP clients and
.NET services before?
- John