permaculture playing cards*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes WCF Web Service to SOAP 1.1? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "WCF Web Service to SOAP 1.1?" Watch "WCF Web Service to SOAP 1.1?" New topic
Author

WCF Web Service to SOAP 1.1?

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi y'all!
I am going to be a little lazy and throw in a question, despite not having made a lot of research myself:
I am trying to create a WCF web service client that talks to a WSIT web service created in Java, running on GlassFish.
However, it seems the WCF web service client insists on using SOAP 1.2 messages (type: application/soap+xml, instead of text/xml) despite the web service in GlassFish being a SOAP 1.1 web service.
My question is: How do I configure the WCF web service to use SOAP 1.1 instead?
I have all the wonders of Visual Studio 2008 at my disposal.
Thanks in advance for any answers or clues!
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi Ivan!
I think I have found a solution to your problem:
The configuration generated by WCF is incorrect and you must create a new, custom, binding yourself.
In the project directory, locate a file named app.config.xml (or something similar).


This works for plain web service, but I am unsure if it is enough when it comes to WSIT web services, using MTOM, security or such.
Best regards!
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Thanks a lot!
I will check out the part with the WSIT web services and let you know!
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi again!
Having done some mighty hard thinkin', the suspicion rose in me that the Metro web service stack that provides WSIT for GlassFish perhaps was not entirely up to date in GlassFish 2.1. Confirming with the installed libraries in GlassFish 2.1 confirmed this: Version 1.1.3 (if I remember correctly).
So downloading Metro 1.5, installing it and the following the instructions at https://metro.dev.java.net/1.5/docs/install.html to install it in GlassFish.
Configuring the web service properties in NetBeans, I can now choose compatibility with .NET 3.5!
The improvement gained is that now I cannot even generate a service reference in Visual Studio for a WSIT web service developed in Java and deployed to GlassFish that uses WS-Reliable Messaging. There is this very interesting error:

The WS-RM policy under the namespace http://docs.oasis-open.org/ws-rx/wsrmp/200702
requires the wsrmp:ExactlyOnce, wsrmp:AtLeastOnce, or wsrmp:AtMostOnce assertion.
The AtLeastOnce element under the http://docs.oasis-open.org/ws-rx/wsrmp/200702
namespace was found.

Yeah, I can also see that the AtLeastOnce element is used in my WSDL, no big surprise...

Even though I seem to answer most of my questions myself, I'll give it another try and ask:
Anyone seen this kind of error before? How to set things right?
Thanks in advance!
Deepika Joshi
Ranch Hand

Joined: Feb 24, 2009
Posts: 268
Hi Ivan Krizsan,

I do not understand even ABC of this post but your dedication is inspiring.

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hello!
OK, since this is stuff you'll need for the certification, I'll try to explain a bit:
WSIT is a joint effort of Sun and Microsoft to enable web services and web service clients developed in Java and developed using WCF (Windows Communication Foundation) to talk to each other. A little bit like the WS-I BasicProfile, but for WSIT there are also code supplied so, theoretically, you should be able to create a client using C# and WCF that accesses a Java web service and not have to bother about the underlying details.
Metro is the Java web services stack (libraries) that GlassFish uses. Metro also implements the WSIT standard.
WS-RM is a standard, WS-Reliable Messaging, that can help you to ensure that messages sent to a web service really gets there. It is also possible to configure WS-Reliable Messaging so that the order of the messages sent are preserved when they reach the web service and you can also specify whether you want a message to be delivered exactly once or if at least once (with possible duplicate message(s)) is good enough.

Since I am a skeptic I want to try things out myself, before I believe. So far, when trying to have a WCF web service client talk to a Java web service, I have encountered a lot of problems. However, it is too early to say whether the problem is me or WSIT/WCF.
Please do not hesitate to ask if there is anything unclear!
Best regards!
Deepika Joshi
Ranch Hand

Joined: Feb 24, 2009
Posts: 268
Thanks a lot for replying with so much detail.
Thanks.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Well, so the story comes to an end:
It seems like the compatibility between .NET 3.5 and Metro 1.5 is not entirely complete.
I reverted back to .NET 3.0, still using the Metro 1.5 implementation in GlassFish, but selecting .NET 3.0/Metro 1.0 compatibility in NetBeans and suddenly things started working much better. I didn't even have to perform the "hack" creating a custom binding, as described above.
Alas, it still seems like there are areas which are incomplete; for instance WCF won't recognize the AtMostOnce and AtLeastOnce assertions, it seems. But despite those assertions being present in the WSDL, the WCF client is still able to access the Java web service successfully.
Complete step-by-step instructions will appear in my SCDJWS 5 study notes.
Best wishes.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WCF Web Service to SOAP 1.1?