Tech Off Thread

4 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Change the Default Soap Style

Back to Forum: Tech Off
  • User profile image

    I need to call a java web service from C# and I am having a problem.  By default the soap sent by .NET is formatted like <soap:Envelope>.  The service that I am calling needs soap formatted like <soapenv:Envelope>. 

    I know there must be a way to configure the web reference to send the soap in the needed format because it seems to parse the return soap fine and it is in the same format.  Unfortunatly the WSDL I was given for the service doesn't configure the web reference properly and I don't know how to do it manually. 

    Anyone here know how to do it?  I have a hack in place but it's kind of ugly.

  • User profile image

    As long as the namespace declaration for soap or soapenv is the same, the destination service should handle it.

    For example, the following fragment would be valid (but incomplete)...

    <fred:Envelope xmlns:fred="" fred:encodingStyle="">
       Message information

    If the service you are communicating with is having problems with soap vs. soapenv I'd jump on the vendor of the service to get them to sort out their problem.

  • User profile image

    Yes, I know it shouldn't matter but unfortunatly it does.  And while I agree that it is their problem in the sense that they created it, it is my problem in the sense that I still have to find a way around it.  The client has

    I have in fact found a way around it (read: hack) by replacing the generated SOAP with my own hardcoded SOAP right before it goes across the wire but I'm looking for a cleaner solution, hopefully one where I can tell .NET how to format the SOAP instead of bypassing it.

  • User profile image

    You said that you found a way around the standard soap style in one of your posts and I was simply wondering if I could get an example in c# on how you were able to accomplish this.  I am using a c# client to consume a java web service.  The main problem that I can tell from looking at the outgoing soap message is that it is using soap while the java client that is able to work correctly uses soapenv.  I am trying to do basic user authentication with the usernametoken and am having trouble.  It could also be that my <wsa:Action> is set along with other addressing ws features and I need to remove them.


    Please help me on this one.


Conversation locked

This conversation has been locked by the site admins. No new comments can be made.