Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / August 2007

Tip: Looking for answers? Try searching our database.

Interop question for WCF Gurus

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Reg - 29 Aug 2007 19:14 GMT
Hello,

I have a WCF Web Service using wsHttpDualBinding because I need a callback
to Java client.

I read Mr. A.Gupta's blog that if WCF Service uses wsHttpDualBinding for
interop working is not guaranteed.

I also tried to config wsHttpDualBinding in WCF Service Config file as
follows:

<bindings>
 <customBinding>
   <binding name="Binding1">
     <reliableSession />
     <compositeDuplex />
     <oneWay />
     <textMessageEncoding
                    messageVersion="Soap12WSAddressing10"
                    writeEncoding="utf-8" />
     <httpTransport authenticationScheme="Anonymous"
                    bypassProxyOnLocal="false"
                    hostNameComparisonMode="StrongWildcard"
                    proxyAuthenticationScheme="Anonymous"
                    realm=""
                    useDefaultWebProxy="true" />
   </binding>
 </customBinding>
</bindings>

A C# Client works without problems.

But when using Axis client which is a Java Standalone application following
code:

class ClientUtil
{
   public static OMElement getOMElement()
   {
       OMFactory fac = OMAbstractFactory.getOMFactory();
       OMNamespace omNs = fac.createOMNamespace(
               "http://ws.apache.org/axis2/xsd", "ns1");
       OMElement method = fac.createOMElement("Hello", omNs);
       OMElement value = fac.createOMElement("Hello", omNs);
       value.setText("Hello");
       method.addChild(value);
       return method;
   }
}

public class Client
{
   private static EndpointReference targetEPR = new EndpointReference

           ("http://localhost:8000/ServiceMetadata/DuplexService");

   public static void main(java.lang.String args[])
   {
       ServiceClient sender = null;
       try {
           OMElement payload = ClientUtil.getOMElement();
           Options options = new Options();
           options.setTo(targetEPR);
           options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
           options.setUseSeparateListener(true);
           options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
           //Callback to handle the response
           Callback callback = new Callback() {
               public void onComplete(AsyncResult result)
               {
                   System.out.println(result.getResponseEnvelope());
               }

               public void onError(Exception e)
               {
                   e.printStackTrace();
               }
           };

           //Non-Blocking Invocation
           sender = new ServiceClient();
           sender.engageModule(Constants.MODULE_ADDRESSING);
           sender.setOptions(options);
           sender.sendReceiveNonBlocking(payload, callback);
           //Wait till the callback receives the response.
           while (!callback.isComplete()) {
               Thread.sleep(1000);
           }
           //Need to close the Client Side Listener.
       }
       catch (Exception axisFault)
       {
           axisFault.printStackTrace();
       }

   }

a Timeout error occurs. I have Addressing library in Axis part so that can't
be a issue.

Axis client hangs in while (!callback.isComplete()) loop and Timeout error
occurs.

Can anyone point what could be the problem? I need a callback feature so,
thats why I'm using wsHttpDualBinding.

Thanks
CharlieH - 29 Aug 2007 22:12 GMT
You might find this discussion and example of some help. Maybe not, but take
a look:
http://dotnetaddict.dotnetdevelopersjournal.com/wcf_alarmclock.htm

Signature

Charlie

> Hello,
>
[quoted text clipped - 103 lines]
>
> Thanks

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.