473,387 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Interop with Apache SOAP

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
7 2832
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
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
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
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
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
Thanks for your reply. It looks like there will be some political
actions to take!

Nov 23 '05 #7
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bbalet.free.fr | last post by:
Hello, Anyone succeed to make work a .Net WebService client WSE with WSS4J (I always get the error message 'Signature Verification failed') ? On the server my WSDD config is: <deployment...
1
by: bbalet.free.fr | last post by:
Hello, Anyone succeed to make work a .Net WebService client WSE with WSS4J (I always get the error message 'Signature Verification failed') ? On the server my WSDD config is: <deployment...
5
by: vthakur | last post by:
Hello: I have a Axis Web Service that sets the sessionid in the SOAP header for persisting the session. The client is a .Net client that processes the header as an Unknown Header. It sets the...
2
by: furrypop | last post by:
Hi, I'm trying to get the Perl SOAP::Lite examples to work on a Windows PC, running Apache 2.2.4. Apache is definitely serving CGI scripts, as I've tested a dummy Hello World thing. I'm also...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.