.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

WSE 2.0 to WCF connect to Java service

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :WCF

Hi All,

I currently have a WSE 2.0 client that connects successfully to a Java web service and I'm trying to get a WCF client to do the same thing. I've tried basicHttpBinding, wsHttpBinding, and also customBinding with different variations with no success. I'm hoping if I post my _working_ WSE client code that someone can easily translate it to either a config or code based solution.

string _javaSignCertName = "java_messagesign_test";
string _javaSSLCertName = "*.javaWS.com"
string _javaWebServiceURL = "https://javatest.javaservices.com:443/JavaServiceWS";
javaServiceWS_vs0 javaService = null;

// WSE 2.0 method
X509CertificateStore store = X509CertificateStore.LocalMachineStore(X509CertificateStore.MyStore);


// Look in the local machine store.
X509CertificateCollection col = (X509CertificateCollection)store.FindCertificateBySubjectString(_javaSignCertName);
Microsoft.Web.Services2.Security.X509.X509Certificate cert = 

View Complete Post

More Related Resource Links

Enter your credentials to connect to the web service


When trying to publish an InfoPath 2007 form template (as a Content Type), I am getting the following message with a UserName/Password dialog box:
Enter your credentials to connect to the following web service: http://MySitePath/_vti_bin/Webs.asmx

When I enter my credentials, the above dialog box appears again. I have carefully entered my credential. Another thing I noticed that despite this error I see the form got created at the destination library. The only thing is that the Content Type did not get created and hence is not available in the "Site Content Type Gallery".

We are using Sharepoint 2007 enterprise edition. And I have recently published the InfoPath form templates several time as Content type without any issue.


Please help. Thanks........

Error: The search request was unable to connect to the Search Service.

When attempting a search, I get the the error message "The search request was unable to connect to the Search Service. "  The search sevice has been started in Central Administration.  Does anyone have suggesting as to how to troubleshoot this issue?   Thank you in advance for your help.

WCF and Java Web Service Interop -- WS-Securtity 1.0 with MutualCertificate

I am trying to use WCF to call a Java Web Service.  The Web Service has several security requirements based on the Basic Security Profile 1.0:- The client and service should both use certificates  - The certificates will be used to sign and encrypt the message.- In addition, a supporting UsernameToken should be included.Based on those requirements, it seems like I should be using the MutualCertificate (or MutualCertificateDuplex) authentication mode:<customBinding> <binding name="Custom11">  <textMessageEncoding messageVersion="Soap11" />  <security defaultAlgorithmSuite="TripleDesRsa15" allowSerializedSigningTokenOnReply="true"    authenticationMode="MutualCertificate" requireDerivedKeys="false"    includeTimestamp="true" messageProtectionOrder="EncryptBeforeSign"    messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"    requireSecurityContextCancellation="false">  </security>  <httpTransport /> </binding></customBinding>And then I need to add a supporting token for the user name.  Something like:BindingElementCollection elements = binding.CreateBindingElements();SecurityBindingElement security = elements.Find<SecurityBindingElement>();UserNameSecuri

.NET Client and Java Web Service Interoperability

I have a .net client that consumes an operation on a java based web service that appears to work accept for an issue with passing Boolean values back to the service in the soap message. Any member of the complex type that are defined as Boolean in the service contract will not be present in the soap message generated from the client even though they are set in the code. Sample Client Code: UpdateChecklistItemStatusPortTypeClient     proxy = new UpdateChecklistItemStatusPortTypeClient();     updateChecklistItemStatusReq request = new updateChecklistItemStatusReq(); request.ouid =   "P000122112"; request.applicationId =   "00000032"; request.adminFunction =   "ADMA"; request.checklistItemTypeCode =   "UHSTRN"; request.ceebCode =   "052046"; request.transcriptTerm =   "FINAL"; request.transcriptScores =   true;     updateChecklistItemStatusRsp response = new updateChecklistItemStatusRsp(); response = proxy.UpdateChecklistItemStatusOp(request); Client Soap Message Generated: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">   

Search service is not able to connect to the machine that hosts the administration component

I encounter the error above when trying to set up Sharepoint Server Search. I have tried both setting up search manually through Central admin (just selecting default for everything) as well as through Powershell (using this: http://stsadm.blogspot.com/2009/12/creating-sharepoint-2010-enterprise.html). I'm using the farm admin as Search account as well as account for Application pools, so I guess permissions should not be the issue.Creating new Search service application seems to be successful, but when going to Searchadministration after creation, then System status displays the error above. Event log does add any info and just displays same error message ("SearchApi.cs throws exception:The search service is not able to connect to the machine that hosts the administration component. Verify that the administration component 'db397ab0-d9b0-46c4-9077-dc8be62bf586' in search application 'TNS Enterprise Search Service Application' is in a good state and try again."). I have found this http://blog.fpweb.net/sharepoint-2010-server-search-troubleshooting/ stating that the solution is not to use MSDN version of Windows 2008, but does give any explanation why.Any ideas would be appriciated.Best regardsThomas

Unable to connect a web service from SharePoint 2010

Hi, I have a requirement to connect to a webservice from SharePoint 2010 without passing Network credentials explicitly. If i am already logged into the SharePoint 2010 portal , I should be able to click on Search (which is a web service which retrieves search results from Oracle UCM) and retrieve the result. I tried localhost.ServiceX myProxy = new localhost.ServiceX(); myProxy.Credentials = System.Net.CredentialCache.DefaultCredentials; also myProxy.UseDefaultCredentials = True Still i am unable to authenticate. Default credentials returns null value.   Kindly help.

WCF Security Interoperability with Java web service

Hi everybody, I'm implementing a WCF client which talks to a Java web service secured with x509 certificates and username token. The service requires both signing and encryption as message protection. Thanks to Yaron Naveh and some other guys on this forum I've managed to solve the signing stuff, but the encryption seems to be much more difficult. The problem I'm facing now is the server cannot decrypt my messages - I'm getting HTTP 500 errors. I've got a request example from the service vendor and compared with the messages my client generates, there is only one difference: in the example provided by service vendor I can see an extra tag KeyInfo under the EncryptedData, which seems to me reasonable to be there, but I don't know why WCF doesn't put that item. These are the two SOAP request sections I'm talking about: My WCF client: <s:Body u:Id="_1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <e:EncryptedData Id="_2" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns:e="http://www.w3.org/2001/04/xmlenc#"> <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/> <e:CipherData> <e:CipherValue> <!-- Removed--> </e:CipherValue> </e:Cipher

Search request unable to connect to the Search Service.

I have searched through other similiar topics and have not been able to get it working again properly. I've tried deleting the Search Service account out and all associated information and created a new one. My crawl logs show that they are successfull and that I have content available in my local sites, as well as my people listed. I have disabled loopback checks, given the default content access account owner access on the databases. Everytime I do a search, I get that error message listed as the subject. I'm running a 4 server farm setup with 1 DB, 1 App, and 2 WFE's. Everything was working fine and now I can't get back working right. I have hammering at it all day and need some additional input of where to look. I'm no SharePoint expert by any means, but I'm slowly getting used to everything. Please help!

Infopath 2010 cannot connect to Rest web service

Hi all, I recently tried to access an Excel spreadsheet range as a Rest web service in Infopath 2010; no luck.  Here are the steps I followed: 1. [Successful] Upload Excel spreadsheet with the said ranges onto a Sharepoint document library 2. [Successful] Bind the Excel spreadsheet range (I have one called Regions) in the Sharepoint document library as a Rest web service in Infopath form's listbox control during design time as follows - http://mosscrm/sites/sandbox/_vti_bin/excelrest.aspx/eventbudgets/lookups.xlsx/model/ranges('Regions')?$format=atom 3. [Failed] Then I tried to preview the form, but the actual data in the Excel range failed to populate the Infopath listbox control.  The error I got was: "Could not open "http://<localhost>/sites/<site name>/_vti_bin/ExcelRest.aspx/EventBudgets/Lookups.xlsx/Model/Ranges('EventTypes')?$format=atom"   The error I then got from Infopath was a pop-up saying: The query cannot be run for the following DataObject: Event Types InfoPath cannot run the specified query. The file is not a valid XML file. Not enough storage is available to process this command . If anyone out there has experienced a similar issue and resolved it, please kindly share your solution approach. Thanks.

problem with calling soap service written (most probably in java)

Hi evebody, I'm experiencing problem calling third-party service written in java (mostprobably). When i call service i get following response: <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <env:Header></env:Header> <env:Body> <env:Fault xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <faultcode>env:Server</faultcode> <faultstring>Content root name does not match element name: {http://foo.bar/}arg0 != arg0</faultstring> </env:Fault> </env:Body> </env:Envelope> I've used command line java utility provided by service provider and found following difference: soap request, generated by wcf (similar results with webservices)   <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <baz xmlns="http://foo.bar/"> <arg0 xmlns="">string value</arg0> <arg1 xmlns="">string value</arg1> <arg2 xmlns="">string value</arg2> </baz> </s:Body> </s:Envelope> request, generated by java utility: <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:baz xmlns:ns2="http://foo.bar/"> <arg0>string value</arg0> <arg

WCF - Java web service interop - Signed outgoing message not accepted

Hi, I try to sign a message using a certificate and a private key to call a java (JBoss) web service, but the server refuses to accept my signed message. It only echoes back the same message that I've sent. I have successfully signed the outgoing message using the certificate, and the structure of the message look alright when I compare it to an exampel message supplied by the web service creator. I use a custom binding declared as shown below <binding name="FSACustomServiceBinding"                  closeTimeout="00:01:00"                  openTimeout="00:01:00"                  receiveTimeout="00:10:00"                  sendTimeout="00:01:00">           <textMessageEncoding             messageVersion="Soap11" />           <security             authenticationMode="MutualCertificate"             requireDerivedKeys="false"             keyEntropyMode="ClientEntropy"        &nb



The search service is not able to connect to the machine that hosts the administration component

I'm expierencing this error message and am not sure what to do to fix this.  I don't want to break anything else on our farm.   The search service is not able to connect to the machine that hosts the administration component. Verify that the administration component '9139bef7-69a3-4125-9d0e-e09484cc24ee' in search application 'Search Service Application' is in a good state and try again. Nothing appears under topology.  It just continues to load.  Any suggestions would be appreciated.

WCF - Java web service interop - Problem with asymmetric binding

Hi, I try to communicate with a Java web service and run into the following error: Error: System.ServiceModel.Security.MessageSecurityException: The incoming message was signed with a token which was different from what used to encrypt the body.  This was not expected. Server stack trace:    at System.ServiceModel.Security.TokenTracker.RecordToken(SecurityToken token)    at System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlDictionaryReader reader, Int32 position, Byte[] decryptedBuffer, SecurityToken encryptionToken, String idInEncryptedForm, TimeSpan timeout)    at System.ServiceModel.Security.ReceiveSecurityHeader.ExecuteFullPass(XmlDictionaryReader reader)    at System.ServiceModel.Security.StrictModeSecurityHeaderElementInferenceEngine.ExecuteProcessingPasses(ReceiveSecurityHeader securityHeader, XmlDictionaryReader reader)    at System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan timeout, ChannelBinding channelBinding, ExtendedProtectionPolicy extendedProtectionPolicy)    at System.ServiceModel.Security.MessageSecurityProtocol.ProcessSecurityHeader(ReceiveSecurityHeader securityHeader, Message& message, SecurityToken requiredSigningToken, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)    at System.ServiceModel.Security.AsymmetricSecurity

Unable to connect to local host service when a splash screen is show before start the services

Hi all:

I want to show a splash screen before start the local host services, the host can be open without error, however the client (Form1) is not able to connect to the service. Without the splash screen, every thing work fine. Any idea why ?

Here is the code.

Imports System.ServiceModel

<ServiceContract()> _
Public Interface IHelloWorldService
   <OperationContract()> _
   Function SayHello(ByVal name As String) As String
End Interface

Public Class HelloWorldService
   Implements IHelloWorldService

   Public Function SayHello(ByVal name As String) As String Implements IHelloWorldService.SayHello
      Return String.Format("Hello, {0}", name)
   End Function
End Class

Module Module1
   Private host As ServiceHost
   Private frmSplash As Form

   Sub Main()
      AddHandler AppDomain.CurrentDomain.AssemblyLoad, Addres

How to consume java base SOAP web service XWSS?


I have java base SOAP web service XWSS. I installed WES 3.0 + VS2008

When I’s setting Security.Takens.Add() I’m getting message:
SoapContext.Security is obsolete.
Consider deriving from SendSecurityFilter or ReceiveSecurityFilter and creating a custom policy assertion that generates these filters.

Does it require some web service updates?
Do you have any samples how to create Custom Policy?

calling JAVA web service?




I am totally a beginner in web service. My vendor provide me a Java base web service and I just create a windows application to test it.  However, when i call the service, it returns including part of the previous result. My vendor doesn't know anything about .NET and they say should be my cookies problem. I tried many different methods but the problem still exist.

I add the web service by using service reference and I also have to change the allowCookies to "true" to make it work. My config as below, does anyone have any clue? I can only call the service using the second endpoint 12 because the endpoint 11 doesn't work at all.


        <binding name="SearchProcessServiceSoap11Binding" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          allowCookies="false" bypassProxyOnLocal="false" hostN
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend