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

Web service namespace prefix

P: n/a
I have created a web service in C# that needs to receive a SOAP request from
some system I have no control over. An example of the SOAP request is given
below:-

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:getVImage xmlns:ns1="urn:anpr::images"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<ImageId xsi:type="xsd:string">24071581</ImageId>
</ns1:getVImage>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The problem is the namespace prefix ns1 in the <ns1:getVImage part of the
request. The standard web service I have created through Visual Studio .Net
cannot interpret this prefix so the request fails. The only references I have
found to fixing this problem have described (without much detail) using
[AssertNamespaceBinding("ns1", "http://schemas.xmlsoap.org/soap/envelope/")].
Unfortunately I get an error compiling the web service when using this
declaration:- "The type or namespace name 'AssertNamespaceBinding' could not
be found (are you missing a using directive or an assembly reference?)."

So the question is how do I get this name space to work, or is there another
way of achieving the same thing?

Cheers

Nov 23 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.