Soap header with prefix

W

wakeup

Hi,

I have to use Java (axis) webservice that will be called with my .net
client. Now they gave me the specification on what their common soap header
will look like, listed below:


<sec:autentication>

<sec:username>user</sec:username>

<sec:password>pass</sec:password>

</sec:autentication>



I have modified the .net generated proxy clases (references.cs) for send
soap header, but I send this:

<autentication>

<username>user</username>

<password>pass</password>

</autentication>

How can I set the "sec" prefix in tags when send from my .net client?


Thanks in advance
 
J

John Saunders

wakeup said:
Hi,

I have to use Java (axis) webservice that will be called with my .net
client. Now they gave me the specification on what their common soap
header
will look like, listed below:


<sec:autentication>

<sec:username>user</sec:username>

<sec:password>pass</sec:password>

</sec:autentication>



I have modified the .net generated proxy clases (references.cs) for send
soap header, but I send this:

<autentication>

<username>user</username>

<password>pass</password>

</autentication>

How can I set the "sec" prefix in tags when send from my .net client?

The prefixes are irrelevant. You need to get the correct namespace.

What happens if you don't modify the proxy class?

John
 
J

John Saunders

wakeup said:
Failed to retrieve the SOAP Header or it's details properly.

I'm sorry, I can't tell if you're joking or not. That's not an exception.
System.NullReferenceException is an exception. "Object reference is not set
to an instance of an object" is an exception message. Sometimes, one even
includes a stack trace when discussing an exception.

When you're trying to get help, it's better to provide more information,
rather than less.

John
 
P

Peter Ritchie [C# MVP]

I'm curious. Have you added the web service as a web reference to your
application? If so, you get this error when you invoke one of the web
services methods?

If it's a header extension, there should be an extra property for each
header element in your web serivce class. If the element is
"authentication", you should have an "authentication" property on the
generated web service class.

As I mentioned on forums.microsoft.com/msdn, it doesn't matter what the
namespace prefix is; but if the web service has marked the authentication
element as mandatory (minOccurs="1") and you're doing nothing with an
"authentication" property in your code, that might be why you're getting that
error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top