0

I have need to build a c# web client that can consume an existing java weblogic web service that uses wsse security. Changing the existing java weblogic web service to work with C# is not an option. I have hopes a solution is easily found.

For the client, I am using c# with Microsoft.Web.Services3 in VisualStudio 2010. I know Web.Services3 has been deprecated, but I am unable to find a WCF solution that works where I can add the needed wsse:Security tags, and in the order the required by the web service.

Using Web.Service3, the generated soap request does not include the needed soap attribute tags in the soap body. Using soapUI to test, the only difference between the working and non-working request is the missing "wsmp:" tag in the soap body. If I can find a way to insert "wsmp:" into the method tag of the soap body, the c# request will work.

In the soap body, it is missing the web service defined soap header tags "wsmp:". Is there a way to insert this tag in to the client request in c#?

This is the body that is needed --

`<soapenv:Body>
<wsmp:getForm xmlns:wsmp="http://www.microstrat.com/wsmpServices/1.0">
<wsmp:documentid><documentid>8502</documentid><formnumpacketid /></wsmp:documentid>
</wsmp:getForm>
</soapenv:Body>`

This is the body that is generated-- note the getForm instead of wsmp:getForm tag:

`<soapenv:Body>
<getForm xmlns="http://www.microstrat.com/wsmpServices/1.0">
<documentid xmlns=""><documentid>8502</documentid><formnumpacketid /></documentid>
</getForm>
</soapenv:Body>`

Any help or pointers on how to go from what is generated to what is needed?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
  • What happened when you used WCF? It should just work. WSE is unlikely to work as well, as it is not completely up to date with the standards. Also, if you have to do something not supported directly, WCF is far more extensible than WSE, and is actively supported, with a huge community of users to help you. – John Saunders Dec 23 '11 at 23:30

1 Answers1

0

Looks like the xml generated at C# end is indeed valid, so I guess it's the peculiarity of the Java server that is forcing this requirement on you.

I don't know the internals of the WSE library enough to force the library to use a particular xml namespace prefix, but here's one approach I've used successfully to rewrite the SOAP xmls in a manner that I see fit: Modifying SOAP requests with GetWebRequest

Cheers, Anash

Community
  • 1
  • 1
Anash P. Oommen
  • 607
  • 3
  • 10