473,769 Members | 6,160 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2046
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:definitio ns xmlns:soap="htt p://schemas.xmlsoap .org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
xmlns:mime="htt p://schemas.xmlsoap .org/wsdl/mime/"
xmlns:tns="http ://tempuri.org/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="h ttp://schemas.xmlsoap .org/wsdl/soap12/"
xmlns:http="htt p://schemas.xmlsoap .org/wsdl/http/"
targetNamespace ="http://tempuri.org/"
xmlns:wsdl="htt p://schemas.xmlsoap .org/wsdl/">

<wsdl:types>
<s:schema elementFormDefa ult="qualified"
targetNamespace ="http://tempuri.org/">
<s:element name="HelloWorl d">
<s:complexTyp e />
</s:element>
<s:element name="HelloWorl dResponse">
<s:complexTyp e>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1"
name="HelloWorl dResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>

<s:element name="TestHeade r" type="tns:TestH eader" />
<s:complexTyp e name="TestHeade r">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Test1"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Test2"
type="s:string" />
</s:sequence>
</s:complexType>

</s:schema>
</wsdl:types>

<wsdl:message name="HelloWorl dSoapIn">
<wsdl:part name="parameter s" element="tns:He lloWorld" />
</wsdl:message>
<wsdl:message name="HelloWorl dSoapOut">
<wsdl:part name="parameter s" element="tns:He lloWorldRespons e" />
</wsdl:message>
<wsdl:message name="HelloWorl dTestHeader">
<wsdl:part name="TestHeade r" element="tns:Te stHeader" />
</wsdl:message>

<wsdl:portTyp e name="ServiceSo ap">
<wsdl:operati on name="HelloWorl d">
<wsdl:input message="tns:He lloWorldSoapIn" />
<wsdl:output message="tns:He lloWorldSoapOut " />
</wsdl:operation>
</wsdl:portType>

<wsdl:binding name="ServiceSo ap" type="tns:Servi ceSoap">
<soap:binding transport="http ://schemas.xmlsoap .org/soap/http" />
<wsdl:operati on name="HelloWorl d">
<soap:operati on soapAction="htt p://tempuri.org/HelloWorld"
style="document " />
<wsdl:input>
<soap:body use="literal" />
<soap:header message="tns:He lloWorldTestHea der"
part="TestHeade r" use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>

<wsdl:service name="Service">
<wsdl:port name="ServiceSo ap" binding="tns:Se rviceSoap">
<soap:address
location="http://localhost:3693/simpleService/Service.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definition s>

Kind Regards,
Mark

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; }

Cheers,
Mark

Mar 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3185
by: Rob Schieber | last post by:
I am pretty frustrated with Microsoft and their lack of support with the Sproxy.exe tool included with VS.Net. Im using VS.Net EA and I wanted to create a C++ webreference to the Amazon.com web service: http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl Now Sproxy.exe blows errors left and right when you try to add this. It seems that Sproxy doesn't now how to interpret attributes, lists, annotations etc... ...
3
6510
by: Matt D | last post by:
I've got two web services that use the same data types and that clients will have to consume. I read the msdn article on sharing types (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service07162002.asp) but I don't want clients to have to add two web references and then manually have to edit the proxy classes. After doing some searching I found that putting references to multiple web services in a .disco...
6
2337
by: kbs | last post by:
Hi, I'm looking for some good examples that illustrate how to code a web service that exposes a custom collection so that the properties of the collection are accessible on the client without having to do a httpwebreqeust call.
1
2168
by: Eric | last post by:
Hallo all, I have to find a bug in an existing software I have taken over from someone that left our company. It's written in VC++ 7.1 using ATL and connects to a webservice calling a method there. (It's a Windows Service running in a DLL with svchost.exe using a thread that impersonates some person using RpcImpersonateClient() etc..) The problem is that the SOAP request needs to connect with NTLM authentication. With a network sniffer I...
2
1459
by: Glenn Venzke | last post by:
Is there any way to tell what type of application is consuming a web service? I'm writing a web service that returns a string with 2 carriage returns. What I want to do is replace these carriage returns with "<br>" tags ONLY if a web application is consuming.
2
1353
by: s | last post by:
'project with web service <webmethod()> _ public function myws(id as integer) 'do db stuff with id and build document Dim xd As New XmlDataDocument xd.Load("D:\Inetpub\webservice_xml\redbook.xml") Return xd end function
0
1571
by: plmanikandan | last post by:
I need to develop a application to consume a webservice. For consuming web service i tried a example in Consuming a Web Service in C# in http://www.csharphelp.com.But i am uanble to use that webservices in http://upload.eraserver.net/circle24/worldtime/worldtime.asmx?WSDL.Can anybody give me simple example(website link) for consuming webservice(other than local host). Mani
3
6097
by: Jeremy Chapman | last post by:
I've writtin a very simple web service in axis which returns an array of classes. I consume it in a .net app. When receiving the response, my .net app generates an error "Cannot assign object of type System.Object to an object of type PersonWS.WorkGroupData.". I've included the wsdl of the consumed axis web service, the request/responses of the web service by the .net app and the exception and stack trace. Hoping someone can tell me...
1
1653
by: =?Utf-8?B?R29yZG9u?= | last post by:
Hi; I can consume a web service from an asp.net application with no problem. The web service connects to a remote server through ODBC and returns a data set to the consuming software. When I try to consume the WS from a windows app is gives a 407 error. I didn't think that the consuming application had to worry about connecting
0
10211
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7409
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3959
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.