The Source for Java Technology Collaboration

Home » java.net Forums » GlassFish » Metro and JAXB

Thread: .NET/C# client to Metro web service

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 4 - Last Post: Jul 7, 2009 11:28 AM by: jdg6688
adamspe

Posts: 3
.NET/C# client to Metro web service
Posted: Jun 15, 2009 11:24 AM
  Click to reply to this thread Reply

I am running several Metro/WSIT (java source based) web services on tomcat and I'm attempting to verify interoperability with a C# client but cannot at all get it to consume the WSDL metro exposes. I'm using Metro 1.5 which claims interoperability with .NET 3.0 although I'm not exactly certain what that means since I haven't seen any examples or materials that show this working.

I'm particularly interested in getting a C# client to deal with a Saml Sender Vouches secured web service does anyone know of any good resources or examples along these lines?

I don't think the security is the issue as it stands however (at least not yet). At one point I know I generated C# proxy object using the wsdl/wsewsdl3.exe utility without issue but now it seems to complain that it doesn't support some rather simple XML schema stating:

"Found more than one parameter on method Delete while multiple parameters are not supported".

None of my methods take anything too terribly complicated, some simple beans and primitive types (mostly string/boolean). In this case it's two string arrays/lists which have simple XML schema like:

<xs:complexType name="Delete">
<xs:sequence>
<xs:element name="ufids" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="propertyNames" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>

I simply can't imagine that .NET is so inept as to not be able to deal with this. I've searched around and found others who received the same error but found no acceptable answers, some claim that the java side is using data types that aren't basic profile compliant, etc. but this simply isn't the case.

So I guess this is a bit more of two questions in:

1.) Has anyone run into an error like this and found out how to deal with it (does it require a change on the java side of things)
2.) Does anyone know of any decent resources/examples/books, etc. that might aid in writing C# clients to secure web services (again particularly a Saml Sender Vouches secured service).

jdg6688

Posts: 859
Re: .NET/C# client to Metro web service
Posted: Jun 15, 2009 11:52 AM   in response to: adamspe
  Click to reply to this thread Reply

For the security side, .Net WCF support Saml Sender Vouches secured web service
only through an WS-Trust based STS.

You may find many scenarios we have tested with .Net here:

http://mssoapinterop.org/ilab/, check the parts for WS-Trust 1.0 and
WS-Trust 1.3.

You may find some samples here:

https://wsit.dev.java.net/source/browse/wsit/wsit/samples/ws-trust/interop/

You can build STS and services using Netbeans:

https://metro.dev.java.net/guide/Example_Applications.html#ahiey

Thanks!

Jiandong

jdg6688

Posts: 859
Re: .NET/C# client to Metro web service
Posted: Jun 15, 2009 1:20 PM   in response to: jdg6688
  Click to reply to this thread Reply

This is an interesting blog from Microsoft om this:

http://blogs.msdn.com/mszcool/archive/2009/01/23/identity-interoperability-geneva-beta-1-sts-with-net-client-and-netbeans-6-5-metro-1-3-wsit-java-client-working-again.aspx

adamspe

Posts: 3
Re: .NET/C# client to Metro web service
Posted: Jun 30, 2009 12:56 PM   in response to: jdg6688
  Click to reply to this thread Reply

Thanks for the info. I'm trying to look into this but I can't seem to get any of the interop sample from

https://wsit.dev.java.net/source/browse/wsit/wsit/samples/ws-trust/interop/

to function period.

The glassfish targets seem specific to v2 so just to seeif I could get something working I backed up to v2

The src/mutual-certificate-10 contains a readme.txt that seems unrelated to it. I followed those instructions to run the /wsit/wsit/samples/ws-trust/src/fs example and that one seems to work fine (but it's not in the interop directory and doesn't use an STS)

After doing the install/configure trying 'ant s-s-s' in each of the src directories (figuring Sun Across the board would be the most likely to function, though I get similar failures with my desired 'ant m-s-s') I get:

mutual-certificate-10:
SEVERE: WST0017:Could not obtain STS metadata. MEX call to STS http://localhost:8080/jaxws-trust-interop-mutual-certificate10-sts/sts failed.
(everything seemed to deploy fine, the failure is in the run-glassfish target)

mutual-certificate-11:
[java] Run Scenario: Scenario_5_IssuedTokenForCertificate_MutualCertificate11
[java] STS_Endpoint_Address:http://127.0.0.1:8080/jaxws-trust-interop-mutual-certificate11-sts/sts
[java] Service_Endpoint_Address:http://127.0.0.1:8080/jaxws-trust-interop-mutual-certificate11/simple
[java] Service_Endpoint_ConfigName:Scenario_5_IssuedTokenForCertificate_MutualCertificate11
[java] Result: FAIL
[java] Debuglog: Getting test parameters
[java] FederatedService_Endpoint_Address =
[java] SecurityTokenService_Endpoint_Address =
[java] System.ArgumentNullException: Value cannot be null.
[java] Parameter name: uriString
[java] at System.Uri..ctor(String uriString)
[java] at XwsInterop.HostedClient.HostedClientSoapImpl.SetCredentials(ChannelFactory channelFactory, String scenarioName, String stsUrl)
[java] at XwsInterop.HostedClient.HostedClientSoapImpl.RunTest(String configName, String stsUrl, String serviceUrl)
[java]

secureconversation-mutual-certificate-11 (using the Sun STS uncommented from etc/client-config/wsit-client.xml)

generate-client:
[wsimport] Consider using <depends>/<produces> so that wsimport won't do unnecessary compilation
[wsimport] command line: wsimport -d /home/padams/misc_srcs/metro/samples/ws-trust/interop/src/build/classes -extension -g -keep -verbose http://localhost:8080/jaxws-trust-interop-secureconversation-mutual-certificate11/simple?wsdl -b /home/padams/misc_srcs/metro/samples/ws-trust/interop/src/secureconversation-mutual-certificate-11/etc/custom-client.xml -b /home/padams/misc_srcs/metro/samples/ws-trust/interop/src/secureconversation-mutual-certificate-11/etc/custom-schema-client.xml
[wsimport] [failed to localize] wsimport.ParsingWSDL()
[wsimport] [failed to localize] wsimport.ErrorMessage([failed to localize] internalizer.XPathEvaluatesToNoTarget(/xs:schema))
[wsimport] [failed to localize] ConsoleErrorReporter.LineXOfY(49, file:/home/padams/misc_srcs/metro/samples/ws-trust/interop/src/secureconversation-mutual-certificate-11/etc/custom-client.xml)
[wsimport]
[wsimport] [failed to localize] wsimport.WarningMessage([failed to localize] wsdlmodeler.warning.port.SOAPBinding12(Scenario_6_IssuedTokenForCertificateSecureConversation_MutualCertificate11))
[wsimport] [failed to localize] ConsoleErrorReporter.LineXOfY(249, http://localhost:8080/jaxws-trust-interop-secureconversation-mutual-certificate11/simple?wsdl)
[wsimport]
[wsimport] [failed to localize] Parsing.ParseFailed()

I can open that WSDL fine in the browser.

If I could get any one of these running I could see if they might be useful from a C# client but I can't and none seem to illustrate SAML interoperability. The real use case I need to prove out is an SSO scenario where the server trusts the client via certificate exchange and the client asserts a username without the need to supply a password (like SAML SV). Though any other interoperability with .NET where WS-Security/Trust is involved I'd like to see actually functioning.

As for interoperability do these samples/tests simply emulate a .NET client? There's no .NET/C# or VB code involved here?

As for writing an STS myself via Netbeans it's a bit of a pain since my final target platform is tomcat but the wizard for writing an STS requires glassfish (won't even allow me to create one until I set my server to glassfish even though the base classes are just part of metro).

Is there any decent documentation on what an STS should do? All of the examples I find on-line seem identical and simply extend com.sun.xml.ws.security.trust.sts.BaseSTSImpl and do nothing themselves internally. I guess I can go find the source for BaseSTSImpl and try to understand what it's doing. If I need to write one of these to interoperate with a .NET client this is hardly very useful however...

I've bought books on these J2EE/.NET interop but of course with how fast things move they're now hardly too useful since they talk about JWSDP and earlier versions of WCF.

jdg6688

Posts: 859
Re: .NET/C# client to Metro web service
Posted: Jul 7, 2009 11:28 AM   in response to: adamspe
  Click to reply to this thread Reply

Ok. We will check and fix the sample.

The contract between Metro based service and STS and .Net client is the WSDL.

So if you can run an all Java sample, you should get an idea what is going on.

Try out this one:

http://fisheye5.cenqua.com/browse/wsit/wsit/samples/ws-trust/basic

You will find how Metro STS works here:
https://wsit.dev.java.net/docs/trust-whitepaper.pdf
http://blogs.sun.com/enterprisetechtips/entry/using_ws_trust_support_in

Thanks!

Jiandong




 XML java.net RSS