Discussion:
Adding element to SOAP envelope in c#
(too old to reply)
Scott
2009-10-07 23:34:02 UTC
Permalink
I am consuming a web service WITHOUT a WSDL.

I have overridden SoapHttpClientProtocol to create my own WebService
request.

The problem is that the server responding to my requests wants a <c-
gensym3> element between the name of the method and the parameters.

like this:
<soap:Body>
<Method1 xmlns="namespace">
<c-gensym3> <!--THIS IS WHAT I NEED TO ADD-->
<data>xxxyyy</data>
</c-gensym3>
</Method1 >
</soap:Body>

How can I add the <c-gensym3> element into my request?
Paul
2009-10-08 09:05:35 UTC
Permalink
Is there any reason why you cannot use a WSDL?

There I was thinking SOAP was a standard only to find SOAP-Lite well thats
what the tag relates too.

http://cookbook.soaplite.com/

http://support.microsoft.com/kb/308438

Life would be so much easier if everyone stuck to C# instead of these Mickey
Mouse implementations...;-)
Post by Scott
I am consuming a web service WITHOUT a WSDL.
I have overridden SoapHttpClientProtocol to create my own WebService
request.
The problem is that the server responding to my requests wants a <c-
gensym3> element between the name of the method and the parameters.
<soap:Body>
<Method1 xmlns="namespace">
<c-gensym3> <!--THIS IS WHAT I NEED TO ADD-->
<data>xxxyyy</data>
</c-gensym3>
</Method1 >
</soap:Body>
How can I add the <c-gensym3> element into my request?
Scott
2009-10-08 13:27:32 UTC
Permalink
Thanks for your reply. The vendor of the web service, written using
SOAP::Lite in Perl, does not supply a WSDL.

The reference you provided and the additional searches I've done point
to solutions going from Perl Client to a c# server.

However, I'm trying to do this:

c# Web Service Client ----> Perl SOAP:Lite Server

I CAN get the web service to work using a raw HttpWebRequest and
subsequent messing with the XML structure of the request led me to
believe that the only difference between it working and not working
was the inclusion of the <c-gensym3> tag.

So - I'm trying to figure out how to get access to the XML document
somewhere after I call Invoke and then insert the XML element manually
(Yes, we love interoperability).

At this point I'd go down any path (other than using raw requests) to
solve this problem.
Paul
2009-10-08 14:17:11 UTC
Permalink
In this situation you would have been better off had they used resful
services.

Sorry don't know enough to help any more bud.
Post by Scott
Thanks for your reply. The vendor of the web service, written using
SOAP::Lite in Perl, does not supply a WSDL.
The reference you provided and the additional searches I've done point
to solutions going from Perl Client to a c# server.
c# Web Service Client ----> Perl SOAP:Lite Server
I CAN get the web service to work using a raw HttpWebRequest and
subsequent messing with the XML structure of the request led me to
believe that the only difference between it working and not working
was the inclusion of the <c-gensym3> tag.
So - I'm trying to figure out how to get access to the XML document
somewhere after I call Invoke and then insert the XML element manually
(Yes, we love interoperability).
At this point I'd go down any path (other than using raw requests) to
solve this problem.
Scott
2009-10-08 21:51:59 UTC
Permalink
Yes! REST would have been the better approach.

Creating a WSDL with POD::WSDL would have made my life easier.

Creating a custom HTML implementation would have even been preferred
over their SOAP::Lite implementation - Ugggg.

In any case....

Microsoft has a walk through of modifying the SOAP message here -
http://msdn.microsoft.com/en-us/library/s25h0swd(VS.80).aspx

And here is a very good example of the chainstream -
http://hyperthink.net/blog/inside-of-chainstream/

CHEERS!
not_a_commie
2009-10-09 14:43:59 UTC
Permalink
One option is to just send your SOAP XML through a standard
HttpWebRequest. That's what I do -- make a WebRequest with the XML
that the webservice requires. SoapHttpClientProtocol is a pain IMO.
Continue reading on narkive:
Loading...