SQL Anywhere 9.0.2 Consume Web Service

I have created a self-hosted WCF service that exposes two
end-points: one MEX end-point to expose the WSDL and another
using basic http bindings. I am trying to communicate to the
service directly from our Database, and while I am able to
retrieve the WSDL exposed via the MEX end-point, I am unable
to talk to the method I have exposed on the basic HTTP
end-point. The method is nothing more than a method that
takes a single integer value and returns that same value
Example: int TestCall(int iValue)
I have defined my stored procedure to call this method as
follows:
CREATE PROCEDURE "DBA"."TestCall"(in iValue integer)
result(RtnCode INTEGER)
on exception resume
url
'http://localhost:8080/CS.Scheduler.DataSyncService.ServiceContract/IDataSyncService'
namespace 'http://tempuri.org/IDataSyncService'
type 'SOAP:DOC'
The SOAP message envelope being sent to the service is
formatted as follows:

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:m="http://tempuri.org/IDataSyncService">
<s:Header
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<To s:mustUnderstand="1"
xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://localhost:8080/CS.Scheduler.DataSyncService.ServiceContract/IDataSyncService</To>
<Action s:mustUnderstand="1"
xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IDataSyncService/TestCall</Action>
</s:Header>
<SOAP-ENV:Body>
<m:TestCall>
<m:iValue>7654321</m:iValue>
</m:TestCall>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The service exception being thrown is as follows:
OperationFormatter encountered an invalid Message body.
Expected to find node type 'Element' with name 'TestCall'
and namespace 'http://tempuri.org/'. Found node type
'Element' with name 'm:TestCall' and namespace
'http://tempuri.org/IDataSyncService'
If I generate a proxy from the WSDL and call the service via
the proxy from a Console application, the call works just
fine, and the SOAP message Envelope is formatted as:

<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<To s:mustUnderstand="1"
xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://localhost:8080/CS.Scheduler.DataSyncService.ServiceContract/IDataSyncService</To>
<Action s:mustUnderstand="1"
xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IDataSyncService/TestCall</Action>
</s:Header>
<s:Body>
<TestCall xmlns="http://tempuri.org/">
<value>39393</value>
</TestCall>
</s:Body>
</s:Envelope>
I have tried changing the namespace to use just
"http://tempuri.org", but that fails outright because then
it cannot find the end-point.
I would believe this should work, but I am wholly unfamiliar
with how Sybase consumes Web Services and the help files
contain little information, and I've found nothing helpful
about this on the web thus far, so I am hoping someone here
can point me in the right direction.
Thank you,
D.
0
Douglas
1/13/2011 6:36:45 PM
📁 sybase.sqlanywhere.general
📃 32637 articles.
⭐ 22 followers.

💬 0 Replies
👁️‍🗨️ 2166 Views


Reply: