470,849 Members | 681 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

Desperate SProxy problem consuming an ASP.NET Web Service

Hi all,

I have written a web service using the .net framework 2 and Visual
Studio 2005. I consume the managed service by native C++ using the "add
web reference" feature. This obviously shells out sproxy.exe to
generate the proxy code.

All well and good despite the fact sproxy seems seriously in need of an
update and from what i can gather on other threads possible not going
to. I am in a situation where I cannot use C++/CLI and the native
support seems present but poor quality.

My problem is that I use SoapHeaders to pass in authentication data.
This is fine using the managed generated proxy but the native proxy
simply contains an empty structure with the name of the soapheader. It
contains no properties.

I have tried pretty much everything i can think of. Evidently sproxy
supports soap headers but I cannot even get them to work with simple
test code. Has anybody else had any luck? I guess this may be down to
the fact that wsdl.exe uses newer versions of the web services file
formats and protocols than sproxy supports.

Any help would be appreciated.

Kind Regards,
Mark Everett

Mar 15 '06 #1
2 1898
Hi again,

As an example if you run this through sproxy.exe /wsdl the generated
output includes a blank header. This is so simple and I cannot see
anything wrong with the markup. I have stripped a lot of the additional
wsdl output from the .asmx?wsdl resulting in the following:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

<s:schema elementFormDefault="qualified"
<s:element name="HelloWorld">
<s:complexType />
<s:element name="HelloWorldResponse">
<s:element minOccurs="0" maxOccurs="1"
name="HelloWorldResult" type="s:string" />

<s:element name="TestHeader" type="tns:TestHeader" />
<s:complexType name="TestHeader">
<s:element minOccurs="0" maxOccurs="1" name="Test1"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Test2"
type="s:string" />


<wsdl:message name="HelloWorldSoapIn">
<wsdl:part name="parameters" element="tns:HelloWorld" />
<wsdl:message name="HelloWorldSoapOut">
<wsdl:part name="parameters" element="tns:HelloWorldResponse" />
<wsdl:message name="HelloWorldTestHeader">
<wsdl:part name="TestHeader" element="tns:TestHeader" />

<wsdl:portType name="ServiceSoap">
<wsdl:operation name="HelloWorld">
<wsdl:input message="tns:HelloWorldSoapIn" />
<wsdl:output message="tns:HelloWorldSoapOut" />

<wsdl:binding name="ServiceSoap" type="tns:ServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="HelloWorld">
<soap:operation soapAction="http://tempuri.org/HelloWorld"
style="document" />
<soap:body use="literal" />
<soap:header message="tns:HelloWorldTestHeader"
part="TestHeader" use="literal" />
<soap:body use="literal" />

<wsdl:service name="Service">
<wsdl:port name="ServiceSoap" binding="tns:ServiceSoap">
location="http://localhost:3693/simpleService/Service.asmx" />

Kind Regards,

Mar 16 '06 #2
Hi all,

The solution to this problem was to trick sproxy into outputting the
type data by creating a dummy method which uses the header type e.g.

[Web Method]
public AuthHeader Dumm(){ return null; }


Mar 22 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Rob Schieber | last post: by
2 posts views Thread by Glenn Venzke | last post: by
2 posts views Thread by s | last post: by
reply views Thread by plmanikandan | last post: by
3 posts views Thread by Jeremy Chapman | last post: by
1 post views Thread by =?Utf-8?B?R29yZG9u?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.