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

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

WCF webservice with callbacks to Java clients

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :SharePoint

I am new to WCF. I need to implement a WCF web service with callbacks/Events to clients.

How to implement this for a Java/Unix client? Is it supported?

Any sample code will be helpful.

View Complete Post

More Related Resource Links

C# / Java webservice


I am writting a client applicatin that acesses a webservice written by another company.  I need to test against this webservice but since it is live I need another place to test with.  I don't have access to the code from the webservice but have added a reference to my project.  I would like to create a test platform using C# which will run on IIS and not Java.

I have created a basic webserive using both the NetBeans platform and the VS/C# platform.  The problem I am having is if I dynamically change the web address from one to the other my client application complains that the webservice is invalid.  I have verified all the calls are the same.

Are there any setting with VS/C# that allow me to configure it to behave more like the Java webservice?  I don't have the server support to host the Java application for full testing along with other problems using the Java version.

I have run both services in the "WCF Test Client" and can see where the WCF service uses the varibles for request and the Java uses body/request but can't get the WCF to follow that format.  I read somewhere about changing the OperationContract with SoapRpcMethod but then the mentod is not longer exposed. I also tried a Web Service in .NET 3.5 instead of a WCF server but that seems to be more trouble and does not

WCF MTOM Client calling Java Webservice - Issues with File attachment Content ID encoded in SOAP mes

Hello,I'm having difficulty calling a MTOM enabled Java based web service that accepts an file as input..NET appeats to be generating a SOAP message where the reference to the binary part of the message is an encoded url.For Example:  <inc:Include href="cid:http%3A%2F%2Ftempuri.org%2F1%2F634000265217257868" xmlns:inc="http://www.w3.org/2004/08/xop/include"/>In fact, the Content ID defined in the SOAP message, looks nothing like the actual Content ID of the actual message part.Content-ID: <http://tempuri.org/1/634000265217257868=2787915398744@soapui.org>The service is invoked and executed on the java webserver...but the data element appears to be null.I do not believe the java web server understands the reference in the SOAP message because it is encoded....Or...perhaps it's because the Content-ID attribute has extract stuff on it.I'm working with a custom MTOM encoder in WCF....is there a way to generate your own Content ID or tell .NET not to encode the url?My frustration with .NET has reached an all new level with this project...Any help would be greatly appreciated.Here the SOAP message that is being generated:<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:ns="http://docs.oasis-open.org/ns/cmis/messaging/200901" xmlns:ns1="http://docs.oasis-open.org/ns/cmis/core/200901&q

Namespace Conflict while accessing webservice from java script






Hi All,

I am using Asp.Net with C# , I am trying to access web service from java script using below code


DCen.RC.RController.Update(_User, _UserId, _ContObjId, _IsUnrAllowed, _UserRatiowed, _Localed,  SucceededCallback, FailedCallback);<br/>

The above line is working fine in my local env. but when i am trying to deploy it on server it through exception and said "DCen not Defined "

Plese help me out


Thanks in advance

Are reliable sessions between JAVA ME clients and WCF services possible?


I'm struggling getting a reliable session working between a WCF service and a Java ME client; Java SE works fine.  I'd like to know if anyone out there has gotten this working or knows whether or not it is possible?

Thanks in advance.


WCF Service for Java clients


I'm developing WCF service that looks like will be used by Java clients. Message will be signed by certificate.

Expected request looks like:

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity- secext-1.0.xsd"
   <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
     <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
     <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
     <ds:Reference URI="#body">
       <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
      <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
      <ds:DigestValue>[body digest value]</ds:DigestValue>

Invoking Java Axis Webservice Issue


Hi Experts,

Here's my problem:

I have an asp.net app that invokes a java/axis based webservice through a wsdl file provided by my customer.

But, as i had no access to this webservice at the dev time, i've created a fake .net based webservice, with the same methods, returning some valid data, so i'd be able to test the integration interface.

The problem is, when i add the service reference on my app, pointing to my fake webservice (.net), it's class has a certain name, and when i point it to my customer's wsdl file, it's class has a different name.

Generated class name when i add the service reference by:
    - .NET fake webservice = "TransferenciaEndpointSoapClient"
    - wsdl file of the java/axis webservice = "TransferenciaEndpointClient"

I want the class i've created in my fake webservice to keep the same name of the wsdl, when i add the service reference on my app.

I tried to add a "web reference" instead of a "service reference", but it did not work. I also tried to change the name of the class on the "Reference.cs" file, it works on my environment, but it doesn't when i put the generated bin on my customer's environment. I'd like to sol

connecting sharepoint webservice in java

hi..  i m creating a blackberry application in which i have to connect a sharepoint webservice and retrive and post values from that..but that webservice is password protected.. it ask's username and password when i try to view the webservice itself..  is there any way to solve this authentication problem in java ?

Problem Java call .NET webservice.


I created a very simple webservice (below)

namespace PmtCommu


    [WebService(Namespace = "http://tempuri.org/")]

    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]


    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 

    // [System.Web.Script.Services.ScriptService]

    public class PmoWebService : System.Web.Services.WebService



        public string PmoSvc_Test(string strVal)


            string retVal = string.Format("You sent me {0}.", strVal);

            // my code logging the strVal.

            return retVal;


I tested with .NET client. NO problem.

BUT, my service need to be consumed by Java client. I have trouble passing the parameter in.

I can see the "You sent me ." in my log and as a return value.

Following is the Java Code:


Manually configure (custom) binding for Java-based webservice



this is a follow up to my question Error "An unsupported security policy assertion was detected" when processing a WSDL with Svcutil.exe.

It seems that I'll get no further feedback on this, so I'll go with the assumption that it's not possible to use Svcutil.exe to generate functional client code from the WSDLs of the there mentioned services.

The main problem seems to be the security policies which are completely ignored, so no meanigful binding gets generated.

Therefore I guess I've to manually set up a (custom) binding to produce requests the conform to what the services expecting.
Here's an example for a service requests, it uses an SCT (issued by the corresponding STS) for authentication:

<?xml version="1.0" encoding="UTF-8"

Unable to consume a Java webservice from .Net client ( 2005 )



Am trying to consume a Java webservice deployed in Weblogic using Apache axis plugin. I am unable to add the Web reference from .Net client Below find the error thrown by .Net client

AXIS error

Sorry, something seems to have gone wrong... here are the details:

Fault - makeTypeElement() was told to create a type "{http://discovery.co.za/PolicyDetails/}>>>PolicyDetailsReply>PolicyResultsList>PolicyResults", with no containing element
AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException faultSubcode: faultString: makeTypeElement() was told to create a type "{http://discovery.co.za/PolicyDetails/}>>>PolicyDetailsReply>PolicyResultsList>PolicyResults", with no containing element faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}hostname:dhpxenvdi8
Error message from the Apache server :
2011/05/11 10:38:46 AM> <Error> <HTTP> <BEA-101362> <[weblogic.servlet.internal.WebAppServletContext@1404d1 - appName: 'PolicyDetailsWSServiceEAR', name: 'PolicyDetailsWSService', context-path: '/PolicyDetailsWSService', spec-version: '2.5'] could not deserialize the servlet-context scoped attribute with name: "AxisEngine"
java.io.NotSerializableException: org.apache.axis.configura

Making Ajax Callbacks to the Server Using jQuery with ASP.NET

In the first part of this article series I introduced jQuery's functionality and how it provides a rich client side programming model. This time around I'll expand on these concepts and show you how you can use jQuery in combination with ASP.NET using it as an AJAX backend to retrieve data. I'll also discuss how you can create ASP.NET controls and otherwise interact with jQuery content from ASP.NET pages in WebForms.

jQuery is just a JavaScript library so it will work seamlessly with ASP.NET both from page code as well as through backend driven code using the Page.ClientScript object or ScriptManager. You can use jQuery on its own as a client side and Ajax library that communicates with ASP.NET or you can use jQuery in combination with ASP.NET AJAX. The two actually complement each other quite well as jQuery provides functionality that the ASP.NET AJAX library does not and vice versa. For the most part the interaction between the two libraries is trouble free except for a few very rare edge cases.

WCF Tutorial - Events and Callbacks

we described how to make a very simple client/server application where clients would call functions on the server through a shared interface. In this tutorial, I'm going to expand that application to allow the server to execute functions on the client by using callbacks. Essentially, this is WCF's mechanism to allow events to be raised from the server to it's connected clients.

WCF Callbacks Hanging WPF Applications

I have a WPF application that communicates with a pretty basic WCF service. Whenever a callback is issued in the middle of a request, the WPF application completely hangs. It's obviously a synchronization issue, however I've gone through the forums and articles and set every imaginable attribute on every imaginable object with no successful outcome.

saving XML output from webservice


 I created a webservice that takes casenum as input and gives results as a dataset in an XML.

I could make a web client to display the resulting dataset in a grid view. Pls see my code copied below.

Now I want to create a console client that takes the casenum as input, to call the webservice and saves the resulting xml for further processing, but can't figure out how to just capture the xml to save. Here's the code for my web client. I would appreciate if you could help modify this tocapture the resulting xml to save file locally.

Thank You.

namespace ResultsWebServicesClient
    public partial class _Default : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)

        private void BindDataToGrid(string CaseNum)
            FG_Results results = new FG_Results();
            DataSet ds1 = new DataSet();
            ds1 = results.Get_FG_Results(CaseNum);
            GridView1.AutoGenerateColumns = true;
            GridView1.DataSource = ds1.Tables[0];

        protected void GetResults(object sender, EventArgs e)


HTTP Post and WebService


I am working on a application which will accept the data in the post request. My application also wants to expose a web service and want to call another web service. Considering all these 3 action that I want to do, can I create a single application which will have a web form which will accept the POST request and expose a web service at the same time.

Although it may be possible to achieve this, Is this a correct way of doing it?

Calling webservice from the server


I have a sample web service and aspx file. I deployed them to an existing website that contains classic asp files.

web-service: --- using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; [WebService(Namespace = "http://localhost/MyWebServices/")] public class MembershipRegisWebService : System.Web.Services.WebService { public MembershipRegisWebService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string HelloWorld() { return "Hello World."; } }

aspx.cs file: --- using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Services; public partial class CallWebService : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { MembershipRegisWebService mrWs = new MembershipRegisWebService(); Response.Write("Calling web service:" + mrWs.HelloWorld()); } }

It runs locally, but it shows an error when running it from the server:

Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the follow

Printing crystal report from webservice



I am trying to print crystal repot directly from a C# application, which is calling webservice. I am able to display report in crystalreportviewer by passing the webservice call to datasource. However, is there anyway, I can print directly without showing the report?

Alternatively, I was trying return ReportDocument object from webservice, which would solve my problem, but I was unable to return the ReportDocument because of serialization issue. Is it even possible? Thank you


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