web services & firefox.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sonic_soul

    #1

    web services & firefox.

    Hi,
    I was curious if I could make my webservice work with firefox client
    webservice functionality. (i got it to work with webservice.htc)

    I am able to get firefox to see my serverside web service methods
    (instantiate a proxy and alert proxy.MyMethod to tell its a valid
    function), but when I submit to them, I either get, "Cannot convert
    javascript arg 0" or "not enough arguments" javascript errors. I am
    thinking that perhaps firefox does not understand auto generated WSDL.
    I do not have much experience with WSDL and so perhaps someone has
    attempted such feat....

    FireFoxTest.asp x
    <script>
    var proxy = null;
    var wsdl_uri = "http://localhost/webtesting/service.xml";
    function run (aValue1, aValue2)
    {
    if (!proxy) {

    var listener = {
    onLoad: function (aProxy)
    {
    proxy = aProxy;
    proxy.setListen er(listener);
    requestTranslat ion(aValue1, aValue2);
    },
    onError: function (aError)
    {
    alert(aError);
    },

    MyMathCallback : function (val)
    {
    alert('inside callback');
    alert(val);
    }
    };

    createProxy(lis tener);

    }
    else {
    requestTranslat ion(aValue1, aValue2);
    }
    }
    function createProxy(aCr eationListener)
    {
    try {
    var factory = new WebServiceProxy Factory();

    factory.createP roxyAsync(wsdl_ uri, "MyMathSoap ", "", true,
    aCreationListen er);

    }
    catch (ex) {
    alert(ex);
    }
    }
    function requestTranslat ion (value1, value2)
    {
    if (proxy) {
    alert(proxy.Add );
    proxy.Add();
    }
    else {
    alert("Error: Proxy set up not complete!");
    }
    }
    </script>
    </head>
    <body MS_POSITIONING= "GridLayout ">
    firefox version<br><br>
    <form id="Form1" method="post" runat="server">
    <a href="javascrip t:;" onclick="run(2, 7);">run</a>


    WSDL:
    <?xml version="1.0" encoding="utf-8"?>
    <definitions xmlns:http="htt p://schemas.xmlsoap .org/wsdl/http/"
    xmlns:soap="htt p://schemas.xmlsoap .org/wsdl/soap/"
    xmlns:s="http://www.w3.org/2001/XMLSchema"
    xmlns:s0="http://tempuri.org/"
    xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
    xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
    xmlns:mime="htt p://schemas.xmlsoap .org/wsdl/mime/"
    targetNamespace ="http://tempuri.org/"
    xmlns="http://schemas.xmlsoap .org/wsdl/">
    <types>
    <s:schema elementFormDefa ult="qualified"
    targetNamespace ="http://tempuri.org/">
    <s:element name="Add">
    <s:complexTyp e>
    <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="n1"
    type="s:int" />
    <s:element minOccurs="1" maxOccurs="1" name="n2"
    type="s:int" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="AddRespon se">
    <s:complexTyp e>
    <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="AddResult "
    type="s:int" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="GetTest">
    <s:complexTyp e />
    </s:element>
    <s:element name="GetTestRe sponse">
    <s:complexTyp e>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1"
    name="GetTestRe sult" type="s0:TestOb ject" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:complexTyp e name="TestObjec t">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="Name"
    type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="Caption"
    type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="InnerObje ct"
    type="s0:TestIn nerObject" />
    </s:sequence>
    </s:complexType>
    <s:complexTyp e name="TestInner Object">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="InnerValu e"
    type="s:string" />
    </s:sequence>
    </s:complexType>
    </s:schema>
    </types>
    <message name="AddSoapIn ">
    <part name="parameter s" element="s0:Add " />
    </message>
    <message name="AddSoapOu t">
    <part name="parameter s" element="s0:Add Response" />
    </message>
    <message name="GetTestSo apIn">
    <part name="parameter s" element="s0:Get Test" />
    </message>
    <message name="GetTestSo apOut">
    <part name="parameter s" element="s0:Get TestResponse" />
    </message>
    <portType name="MyMathSoa p">
    <operation name="Add">
    <input message="s0:Add SoapIn" />
    <output message="s0:Add SoapOut" />
    </operation>
    <operation name="GetTest">
    <input message="s0:Get TestSoapIn" />
    <output message="s0:Get TestSoapOut" />
    </operation>
    </portType>
    <binding name="MyMathSoa p" type="s0:MyMath Soap">
    <soap:binding transport="http ://schemas.xmlsoap .org/soap/http"
    style="document " />
    <operation name="Add">
    <soap:operati on soapAction="htt p://tempuri.org/Add"
    style="document " />
    <input>
    <soap:body use="literal" />
    </input>
    <output>
    <soap:body use="literal" />
    </output>
    </operation>
    <operation name="GetTest">
    <soap:operati on soapAction="htt p://tempuri.org/GetTest"
    style="document " />
    <input>
    <soap:body use="literal" />
    </input>
    <output>
    <soap:body use="literal" />
    </output>
    </operation>
    </binding>
    <service name="MyMath">
    <port name="MyMathSoa p" binding="s0:MyM athSoap">
    <soap:address location="http://localhost/webtesting/testwebservice. asmx"
    />
    </port>
    </service>
    </definitions>
  • Ken Dopierala Jr.

    #2
    Re: web services &amp; firefox.

    Hi,

    I'm interested in working on this. Can you post your whole HTML file? I
    don't see below where you put the reference to webservice.htc. I put it in
    a div tag that has an onresult attribute when working with IE. Thanks.
    Ken.

    --
    Ken Dopierala Jr.
    For great ASP.Net web hosting try:
    http://www.webhost4life.com/default.asp?refid=Spinlight
    If you sign up under me and need help, email me.

    "sonic_soul " <squarewave24@h otmail.com> wrote in message
    news:f05c562f.0 410041503.51a48 b0f@posting.goo gle.com...[color=blue]
    > Hi,
    > I was curious if I could make my webservice work with firefox client
    > webservice functionality. (i got it to work with webservice.htc)
    >
    > I am able to get firefox to see my serverside web service methods
    > (instantiate a proxy and alert proxy.MyMethod to tell its a valid
    > function), but when I submit to them, I either get, "Cannot convert
    > javascript arg 0" or "not enough arguments" javascript errors. I am
    > thinking that perhaps firefox does not understand auto generated WSDL.
    > I do not have much experience with WSDL and so perhaps someone has
    > attempted such feat....
    >
    > FireFoxTest.asp x
    > <script>
    > var proxy = null;
    > var wsdl_uri = "http://localhost/webtesting/service.xml";
    > function run (aValue1, aValue2)
    > {
    > if (!proxy) {
    >
    > var listener = {
    > onLoad: function (aProxy)
    > {
    > proxy = aProxy;
    > proxy.setListen er(listener);
    > requestTranslat ion(aValue1, aValue2);
    > },
    > onError: function (aError)
    > {
    > alert(aError);
    > },
    >
    > MyMathCallback : function (val)
    > {
    > alert('inside callback');
    > alert(val);
    > }
    > };
    >
    > createProxy(lis tener);
    >
    > }
    > else {
    > requestTranslat ion(aValue1, aValue2);
    > }
    > }
    > function createProxy(aCr eationListener)
    > {
    > try {
    > var factory = new WebServiceProxy Factory();
    >
    > factory.createP roxyAsync(wsdl_ uri, "MyMathSoap ", "", true,
    > aCreationListen er);
    >
    > }
    > catch (ex) {
    > alert(ex);
    > }
    > }
    > function requestTranslat ion (value1, value2)
    > {
    > if (proxy) {
    > alert(proxy.Add );
    > proxy.Add();
    > }
    > else {
    > alert("Error: Proxy set up not complete!");
    > }
    > }
    > </script>
    > </head>
    > <body MS_POSITIONING= "GridLayout ">
    > firefox version<br><br>
    > <form id="Form1" method="post" runat="server">
    > <a href="javascrip t:;" onclick="run(2, 7);">run</a>
    >
    >
    > WSDL:
    > <?xml version="1.0" encoding="utf-8"?>
    > <definitions xmlns:http="htt p://schemas.xmlsoap .org/wsdl/http/"
    > xmlns:soap="htt p://schemas.xmlsoap .org/wsdl/soap/"
    > xmlns:s="http://www.w3.org/2001/XMLSchema"
    > xmlns:s0="http://tempuri.org/"
    > xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
    > xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
    > xmlns:mime="htt p://schemas.xmlsoap .org/wsdl/mime/"
    > targetNamespace ="http://tempuri.org/"
    > xmlns="http://schemas.xmlsoap .org/wsdl/">
    > <types>
    > <s:schema elementFormDefa ult="qualified"
    > targetNamespace ="http://tempuri.org/">
    > <s:element name="Add">
    > <s:complexTyp e>
    > <s:sequence>
    > <s:element minOccurs="1" maxOccurs="1" name="n1"
    > type="s:int" />
    > <s:element minOccurs="1" maxOccurs="1" name="n2"
    > type="s:int" />
    > </s:sequence>
    > </s:complexType>
    > </s:element>
    > <s:element name="AddRespon se">
    > <s:complexTyp e>
    > <s:sequence>
    > <s:element minOccurs="1" maxOccurs="1" name="AddResult "
    > type="s:int" />
    > </s:sequence>
    > </s:complexType>
    > </s:element>
    > <s:element name="GetTest">
    > <s:complexTyp e />
    > </s:element>
    > <s:element name="GetTestRe sponse">
    > <s:complexTyp e>
    > <s:sequence>
    > <s:element minOccurs="0" maxOccurs="1"
    > name="GetTestRe sult" type="s0:TestOb ject" />
    > </s:sequence>
    > </s:complexType>
    > </s:element>
    > <s:complexTyp e name="TestObjec t">
    > <s:sequence>
    > <s:element minOccurs="0" maxOccurs="1" name="Name"
    > type="s:string" />
    > <s:element minOccurs="0" maxOccurs="1" name="Caption"
    > type="s:string" />
    > <s:element minOccurs="0" maxOccurs="1" name="InnerObje ct"
    > type="s0:TestIn nerObject" />
    > </s:sequence>
    > </s:complexType>
    > <s:complexTyp e name="TestInner Object">
    > <s:sequence>
    > <s:element minOccurs="0" maxOccurs="1" name="InnerValu e"
    > type="s:string" />
    > </s:sequence>
    > </s:complexType>
    > </s:schema>
    > </types>
    > <message name="AddSoapIn ">
    > <part name="parameter s" element="s0:Add " />
    > </message>
    > <message name="AddSoapOu t">
    > <part name="parameter s" element="s0:Add Response" />
    > </message>
    > <message name="GetTestSo apIn">
    > <part name="parameter s" element="s0:Get Test" />
    > </message>
    > <message name="GetTestSo apOut">
    > <part name="parameter s" element="s0:Get TestResponse" />
    > </message>
    > <portType name="MyMathSoa p">
    > <operation name="Add">
    > <input message="s0:Add SoapIn" />
    > <output message="s0:Add SoapOut" />
    > </operation>
    > <operation name="GetTest">
    > <input message="s0:Get TestSoapIn" />
    > <output message="s0:Get TestSoapOut" />
    > </operation>
    > </portType>
    > <binding name="MyMathSoa p" type="s0:MyMath Soap">
    > <soap:binding transport="http ://schemas.xmlsoap .org/soap/http"
    > style="document " />
    > <operation name="Add">
    > <soap:operati on soapAction="htt p://tempuri.org/Add"
    > style="document " />
    > <input>
    > <soap:body use="literal" />
    > </input>
    > <output>
    > <soap:body use="literal" />
    > </output>
    > </operation>
    > <operation name="GetTest">
    > <soap:operati on soapAction="htt p://tempuri.org/GetTest"
    > style="document " />
    > <input>
    > <soap:body use="literal" />
    > </input>
    > <output>
    > <soap:body use="literal" />
    > </output>
    > </operation>
    > </binding>
    > <service name="MyMath">
    > <port name="MyMathSoa p" binding="s0:MyM athSoap">
    > <soap:address[/color]
    location="http://localhost/webtesting/testwebservice. asmx"[color=blue]
    > />
    > </port>
    > </service>
    > </definitions>[/color]


    Comment

    • SoniC SouL

      #3
      Re: web services &amp; firefox.

      Hi, thanks for replying.

      That was a complete call actually. firefox does not need a registration
      with a div like msie does and it has native support for webservices
      which means no .htc file is needed. its support is actually superior to
      that of msie, because all you do is instantiate a proxy and call it as
      if the webservice was a local object.

      here is an example of a working firefox webservice:
      The MDN Web Docs site provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and progressive web apps.

      x.html

      just look at the javascript include.

      the sample i posted gets to the point of seeing the service methods. it
      just seems to give weird errors when those methods are actually called
      (see error messages included in original post).

      thank you!

      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Rafal

        #4
        Re: web services &amp; firefox.

        Hi, thanks for replying.

        That was a complete call actually. firefox does not need a
        registration with a div like msie does and it has native support for
        webservices which means no .htc file is needed. its support is
        actually superior to that of msie, because all you do is instantiate a
        proxy and call it as if the webservice was a local object.

        here is an example of a working firefox webservice:
        The MDN Web Docs site provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and progressive web apps.


        just look at the javascript include.

        the sample i posted gets to the point of seeing the service methods.
        it just seems to give weird errors when those methods are actually
        called (see error messages included in original post).

        thank you!

        On Mon, 4 Oct 2004 19:33:50 -0500, "Ken Dopierala Jr."
        <kdopierala2@wi .rr.com> wrote:
        [color=blue]
        >Hi,
        >
        >I'm interested in working on this. Can you post your whole HTML file? I
        >don't see below where you put the reference to webservice.htc. I put it in
        >a div tag that has an onresult attribute when working with IE. Thanks.
        >Ken.[/color]

        Comment

        • Ken Dopierala Jr.

          #5
          Re: web services &amp; firefox.

          Hi,

          Okay I took a look and I'm getting the same result as you. It appears that
          the problem revolves around Firefox's inability to conform to the standards
          set forth by the W3C. Not surprising since they still have a handful of
          security and SSL standards open in Bugzilla. Anyways, to get this to work
          get rid of all your <s: tags, the ones that define elements and complex
          types. Then in your <message tags remove the <part tags that rely on the <s
          tags and define your arguments there instead. Basically you need to model
          this:



          Then you should be all set. Good luck! Ken.

          --
          Ken Dopierala Jr.
          For great ASP.Net web hosting try:
          http://www.webhost4life.com/default.asp?refid=Spinlight
          If you sign up under me and need help, email me.

          "Rafal" <no@spam.com> wrote in message
          news:0r84m059c6 v6g8lpvaforlkka rda3dkd35@4ax.c om...[color=blue]
          > Hi, thanks for replying.
          >
          > That was a complete call actually. firefox does not need a
          > registration with a div like msie does and it has native support for
          > webservices which means no .htc file is needed. its support is
          > actually superior to that of msie, because all you do is instantiate a
          > proxy and call it as if the webservice was a local object.
          >
          > here is an example of a working firefox webservice:
          >[/color]
          http://www.mozilla.org/projects/webs...sdl/index.html[color=blue]
          >
          > just look at the javascript include.
          >
          > the sample i posted gets to the point of seeing the service methods.
          > it just seems to give weird errors when those methods are actually
          > called (see error messages included in original post).
          >
          > thank you!
          >
          > On Mon, 4 Oct 2004 19:33:50 -0500, "Ken Dopierala Jr."
          > <kdopierala2@wi .rr.com> wrote:
          >[color=green]
          > >Hi,
          > >
          > >I'm interested in working on this. Can you post your whole HTML file? I
          > >don't see below where you put the reference to webservice.htc. I put it[/color][/color]
          in[color=blue][color=green]
          > >a div tag that has an onresult attribute when working with IE. Thanks.
          > >Ken.[/color]
          >[/color]


          Comment

          • Ken Dopierala Jr.

            #6
            Re: web services &amp; firefox.

            Hi,

            Okay I took a look and I'm getting the same result as you. It appears that
            the problem revolves around Firefox's inability to conform to the standards
            set forth by the W3C. Not surprising since they still have a handful of
            security and SSL standards open in Bugzilla. Anyways, to get this to work
            get rid of all your <s: tags, the ones that define elements and complex
            types. Then in your <message tags remove the <part tags that rely on the <s
            tags and define your arguments there instead. Basically you need to model
            this:



            Then you should be all set. Good luck! Ken.

            --
            Ken Dopierala Jr.
            For great ASP.Net web hosting try:
            http://www.webhost4life.com/default.asp?refid=Spinlight
            If you sign up under me and need help, email me.

            "Rafal" <no@spam.com> wrote in message
            news:0r84m059c6 v6g8lpvaforlkka rda3dkd35@4ax.c om...[color=blue]
            > Hi, thanks for replying.
            >
            > That was a complete call actually. firefox does not need a
            > registration with a div like msie does and it has native support for
            > webservices which means no .htc file is needed. its support is
            > actually superior to that of msie, because all you do is instantiate a
            > proxy and call it as if the webservice was a local object.
            >
            > here is an example of a working firefox webservice:
            >[/color]
            http://www.mozilla.org/projects/webs...sdl/index.html[color=blue]
            >
            > just look at the javascript include.
            >
            > the sample i posted gets to the point of seeing the service methods.
            > it just seems to give weird errors when those methods are actually
            > called (see error messages included in original post).
            >
            > thank you!
            >
            > On Mon, 4 Oct 2004 19:33:50 -0500, "Ken Dopierala Jr."
            > <kdopierala2@wi .rr.com> wrote:
            >[color=green]
            > >Hi,
            > >
            > >I'm interested in working on this. Can you post your whole HTML file? I
            > >don't see below where you put the reference to webservice.htc. I put it[/color][/color]
            in[color=blue][color=green]
            > >a div tag that has an onresult attribute when working with IE. Thanks.
            > >Ken.[/color]
            >[/color]


            Comment

            Working...