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

Interop with Apache SOAP

P: n/a
I have a web service writen by .NET:

[WebMethod]
[SoapRpcMethod]
public string[] Greetings(string[] names)
{
string[] gs = new string[names.Length];
for (int i = 0; i < gs.Length; i++)
gs[i] = string.Format("Hello, {0}", names[i]);

return gs;
}

It will be consumed by a Apache SOAP client (SOAPConnect for Lotus
Notes). Apache can send the string array (names) to .NET; but fail to
deserialize the return array (GreetingsResult).

Here is the web request (from Apache to .net)
<SOAP-ENV:Body>
<ns1:Greetings xmlns:ns1="urn:ws-jlta-com"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<names xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:Array" ns2:arrayType="xsd:string[2]">
<item xsi:type="xsd:string">biao</item>
<item xsi:type="xsd:string">yuan</item>
</names>
</ns1:Greetings>
</SOAP-ENV:Body>

This is the web response (from .net to Apache)
<soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<types:GreetingsResponse>
<GreetingsResult href="#id1" />
</types:GreetingsResponse>
<soapenc:Array id="id1" soapenc:arrayType="xsd:string[2]">
<Item>Hello, biao</Item>
<Item>Hello, yuan</Item>
</soapenc:Array>
</soap:Body>

As Apache SOAP BeanSerializer only can accept camel casing properties.
So I guess the problem is caused by .net return <Item> which is pascal
casing.

I tested by using SoapFormatter to serialize string array, its result
is <item>, so I am quite confused why .net web serivce returns <Item>.

Any solution for this?

Thanks in advance.

Nov 23 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Look's like there is a bug in Apache that doesn't interpret what the web
servie wsdl is telling it.

Get the the Apache gurus to fix their software.
"Biao" <ta*******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have a web service writen by .NET:

[WebMethod]
[SoapRpcMethod]
public string[] Greetings(string[] names)
{
string[] gs = new string[names.Length];
for (int i = 0; i < gs.Length; i++)
gs[i] = string.Format("Hello, {0}", names[i]);

return gs;
}

It will be consumed by a Apache SOAP client (SOAPConnect for Lotus
Notes). Apache can send the string array (names) to .NET; but fail to
deserialize the return array (GreetingsResult).

Here is the web request (from Apache to .net)
<SOAP-ENV:Body>
<ns1:Greetings xmlns:ns1="urn:ws-jlta-com"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<names xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:Array" ns2:arrayType="xsd:string[2]">
<item xsi:type="xsd:string">biao</item>
<item xsi:type="xsd:string">yuan</item>
</names>
</ns1:Greetings>
</SOAP-ENV:Body>

This is the web response (from .net to Apache)
<soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<types:GreetingsResponse>
<GreetingsResult href="#id1" />
</types:GreetingsResponse>
<soapenc:Array id="id1" soapenc:arrayType="xsd:string[2]">
<Item>Hello, biao</Item>
<Item>Hello, yuan</Item>
</soapenc:Array>
</soap:Body>

As Apache SOAP BeanSerializer only can accept camel casing properties.
So I guess the problem is caused by .net return <Item> which is pascal
casing.

I tested by using SoapFormatter to serialize string array, its result
is <item>, so I am quite confused why .net web serivce returns <Item>.

Any solution for this?

Thanks in advance.

Nov 23 '05 #2

P: n/a
Thanks for your reply. Apache has a new project for web service (Axis).
But in my situation, Apache SOAP is the only choice. I have to find a
way to serialize soap message which can be accepted by it.

Nov 23 '05 #3

P: n/a
The point is that is the responsibility of the consumer to format the
request as the provider requires it and interpret the result that the
provider provides.

It is like a contract where the provider says:

- you are required to submit the request in the format specified in
appendix A

- the response will always be provided in the format specified in appendix
B

But, I can't really believe that Apache can't deal with a an <Item> node as
opposed to an <item> tag.

"Biao" <ta*******@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Thanks for your reply. Apache has a new project for web service (Axis).
But in my situation, Apache SOAP is the only choice. I have to find a
way to serialize soap message which can be accepted by it.

Nov 23 '05 #4

P: n/a
The client application is on Lotus Notes(version 5), which has used for
several years. IBM gives a solution by using Apache SOAP for this
version of Lotus Notes. Our Lotus developer has very limited expertise
on web services, even on Java. So it is easier to do something in .NET
than Lotus Notes for the web service.

As Apache SOAP only supports encoding format. What I need is just an
equivalent of XmlArrayItemAttribute which can set the element name of
array item in literal format, such as SoapArrayItemAttribute. I am
trying to do soap extension to solve this problem now. Any suggestion?

Nov 23 '05 #5

P: n/a
You're missing the point.

Your supplier for widgets supplies them in cardboard cartons.

Someone in your firm decides in thier infinite wisdom that you want them in
plastic bags.

Do you expect the widget supplier to redesign his packaging operation to
suit the abberations of someone in your firm.

No! You create a procedure to extract the widgets out of the cartons and put
them in plastic bags when they arrive at your place.

That is exactly what you need to do in this case. Take the data supplied by
the web service and massage it to suit your needs.

It's not the webservice's problem that your Lotus developer has very limited
expertise on web services.

What you are are advocating is the age old problem of someone saying "I'm
not going to change my end - you change your end" and you caving in instead
of sticking to your guns.

The proper response is to modify the consumer to deal with what it gets.
"Biao" <ta*******@gmail.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
The client application is on Lotus Notes(version 5), which has used for
several years. IBM gives a solution by using Apache SOAP for this
version of Lotus Notes. Our Lotus developer has very limited expertise
on web services, even on Java. So it is easier to do something in .NET
than Lotus Notes for the web service.

As Apache SOAP only supports encoding format. What I need is just an
equivalent of XmlArrayItemAttribute which can set the element name of
array item in literal format, such as SoapArrayItemAttribute. I am
trying to do soap extension to solve this problem now. Any suggestion?

Nov 23 '05 #6

P: n/a
Thanks for your reply. It looks like there will be some political
actions to take!

Nov 23 '05 #7

P: n/a
I worked it out. It is not a casing problem, but an interop issue
between Apache SOAP and Microsoft web service.

This can be soloved by adding an type mapping to SOAPMappingRegistry,
and leave the java type null.

For detail pls see a post from Sanjiva Weerawarana
(http://marc.theaimsgroup.com/?l=soap...1982213396&w=2)

Nov 23 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.